correct-apricot
correct-apricot12mo ago

Has anyone gotten Airtable to work with a Personal Access Token?

Hello, I'm just starting out and I'm having a hard time getting my app to work with Airtable; I'm curious if it could be because I'm using a Personal Access Token as opposed to an API token. Have other folks gotten it to work with the PAT?
8 Replies
kapa.ai
kapa.ai12mo ago
Hi @its_a_lisa. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The information extracts provided do not specify whether a Personal Access Token (PAT) can be used in place of an API token when working with Airtable in a refine application. However, in the provided code examples, an API token is used to connect to the Airtable base. Here's an example:
import React from "react";
import { Refine } from "@refinedev/core";
import dataProvider from "@refinedev/airtable";
import routerProvider from "@refinedev/react-router-v6";

function App() {
const API_TOKEN = "your-airtable-api-token";
const BASE_ID = "your-airtable-base-id";

return (
<Refine
dataProvider={dataProvider(API_TOKEN, BASE_ID)}
routerProvider={routerProvider}
/>
);
}

export default App;
import React from "react";
import { Refine } from "@refinedev/core";
import dataProvider from "@refinedev/airtable";
import routerProvider from "@refinedev/react-router-v6";

function App() {
const API_TOKEN = "your-airtable-api-token";
const BASE_ID = "your-airtable-base-id";

return (
<Refine
dataProvider={dataProvider(API_TOKEN, BASE_ID)}
routerProvider={routerProvider}
/>
);
}

export default App;
In this example, API_TOKEN is used as a parameter for the dataProvider function from @refinedev/airtable. This suggests that an API token is required to connect to Airtable. For more detailed information, you might want to check out the refine documentation (https://refine.dev/docs/getting-started/overview/) or the Airtable API documentation (https://airtable.com/api). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai12mo ago
<@402247437043105803> kapa.ai is still learning and improving, please let us know how it did by reacting below
rare-sapphire
rare-sapphire12mo ago
Hello @its_a_lisa we are using this package https://github.com/airtable/airtable.js to access airtable API and unfortunately this requires apiKey not PAT
correct-apricot
correct-apricot12mo ago
Ok. That was what I was afraid of. I accidentally deleted my API Key and as of Aug 1st, you can't regenerate a new one in Airtable
rare-sapphire
rare-sapphire12mo ago
I came across this issue: https://github.com/Airtable/airtable.js/issues/357. We'll monitor it, and when they update to support PAT, we'll do the same.
correct-apricot
correct-apricot12mo ago
ok, appreciate it, thanks
silky-coral
silky-coral10mo ago
Was anyone able to get AirTable working with PAT? It's not working for me, but unsure if I have something misconfigured. Also, any way to have something logged to the console? Nevermind, I was able to get it to work. Turns out I had created an "id" column in Airtable. This cause a naming collision with the Airtable's concept of "resource id". Seems like I should be able to use an "id" column in Airtable, but my workaround is to use a different name for the column.
correct-apricot
correct-apricot10mo ago
interesting; I did end up getting it to work eventually I believe