Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jul 28, 2023 11:13 PM
I am trying to do a simple GET request using Airtable API in Postman to retrieve my records. But it's not working. I am a newbie here, any help is much appreciated.
GET: https://api.airtable.com/v0/appkEdlvHkUVyG1QC/Sample%201?maxRecords=3
Headers: "Authorization": Bearer Personal_Access_token
Solved! Go to Solution.
Aug 07, 2023 01:12 AM
silly mistake from my side
https://api/airtable.com/v0/${baseName}/${tableName}
should be https://api.airtable.com/v0/${baseName}/${tableName}
Thank you all for your response
Jul 29, 2023 01:29 AM - edited Jul 29, 2023 05:37 AM
You may want to specify either a formula or a view (or both).
This tool will help you create a valid GET request that you can use in Postman:
https://codepen.io/airtable/full/MeXqOg
Alternatively, for a no-code way of retrieving records from Airtable (or interacting with Airtable through its API), you can always use Make’s Airtable integrations.
@SeanKeenan may have more insights.
Jul 29, 2023 02:06 AM
Thank you @ScottWorld for your response. I tried your suggestion but its not working.
https://api.airtable.com/v0/appkEdlvHkUVyG1QC/Sample%201?maxRecords=3&view=Grid%20view
Jul 29, 2023 05:13 AM - edited Jul 29, 2023 05:38 AM
Then the problem seems to be with either your authorization or your personal access token.
Your quotation marks look incorrectly placed in your authorization example above, so I would play around with that.
Also, make sure that your personal access token is configured to give you access to what you want.
Jul 29, 2023 09:27 AM
It's not working either.
I made a simple fetch request in an extension like below and its throwing error too.
Jul 29, 2023 09:56 AM - edited Jul 29, 2023 09:57 AM
Did you check your personal access token settings?
Sorry, I don't know Javascript, so I can't help you there. I would try doing it with Make's Airtable modules because Make doesn't require any coding at all on your end. Then, after Make is successful, you can examine all the code that Make successfully sent to Airtable.
There can be a bit of a learning curve with Make, which is why I created this basic navigation video for Make, along with the links to a few other Make training resources.
Jul 29, 2023 11:52 AM
Yes I did. I have given read access to my particular base.
Jul 29, 2023 11:56 AM
Just in case, make sure that you've got it set for both "data.records:read" and "schema.bases:read".
If that doesn't work, I would try the Make route that I mentioned above.
Aug 01, 2023 08:13 PM
* ScopesWith this token, you will be able to:
I have done both.
Aug 01, 2023 08:47 PM
Here, this code works for me within a scripting extension. Once you've swapped out "YOUR_TOKEN" you should be good to go
Could you provide a screenshot of the relevant table and view as well?
If this doesn't work DM me an invite link to your base and I'll take a look at it for you
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer YOUR_TOKEN");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
await fetch("https://api.airtable.com/v0/appkEdlvHkUVyG1QC/Sample%201?maxRecords=3", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));