Help

Re: 400 Bad Request in Postman GET

Solved
Jump to Solution
2210 0
cancel
Showing results for 
Search instead for 
Did you mean: 
msafi04
5 - Automation Enthusiast
5 - Automation Enthusiast

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

12 Replies 12
Menark4419
4 - Data Explorer
4 - Data Explorer

@msafi04 MyEnvoyAir wrote:

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


Have you checked if your API endpoint and headers are correct? Also, make sure you have a valid personal access token in the "Authorization" header. If you've done all that, please provide more details about the error message or any specific issues you're facing.

msafi04
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi, thank you for your response. This is my code 

const airtableURL = `https://api/airtable.com/v0/${baseName}/${tableName}`;

const headers = {
Authorization: "Bearer API_KEY",
"Content-Type": "application/json",
};

const options = {
method: "GET",
headers: headers,
};

const response = await fetch(airtableURL, options);

const tableData = await response.json();
console.log(tableData);
 
This the error
 
Uncaught (in promise) TypeError: Failed to fetch
msafi04
5 - Automation Enthusiast
5 - Automation Enthusiast

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