Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here
Dec 16, 2021 02:38 PM
I don’t quite understand the api documentation for how to retrieve one particular record. You can’t send a body in a get request can you so it all has to go in the url. I’m not sure of how to format it.
I have an emails table. I want to do a GET request when a user enters their email address to see if we already have it in the table.
The api documentation says to retrieve a record I have to set the url up like this but I can’t get it to work.
Please could somebody tell me how to construct the GET request url for this so i can pass in my api key and the email that i’d like to search for?
Dec 16, 2021 09:00 PM
Hi,
construct your URL here:
Airtable API Encoder
Set base ID, table name, filter by formula (put email in " duoble quotes, %22 )
field name is case-sensitive(maybe) and if it contains spaces, should be in { }
Result will be smth like:
const link = 'https://api.airtable.com/v0/app_YOUR_BASEID/yourTableName?filterByFormula=email%3D%22username%40domain.com
then add:
const options={
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer '+ YOUR_KEY}
}
let response = await remoteFetchAsync(link, options)
const pageSummary = await response.json();
output.inspect(pageSummary)