Help

Re: Please explain how to retrieve a particular record

778 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Helen_Kent
4 - Data Explorer
4 - Data Explorer

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.

image

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.
image

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?

1 Reply 1

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)