Help

Re: Create Field API End Point

Solved
Jump to Solution
2009 0
cancel
Showing results for 
Search instead for 
Did you mean: 
seregoalighieri
4 - Data Explorer
4 - Data Explorer

Hi everyone, 

Excited to be using the Airtable API!

I'm trying to add new fields to a given table in a given base via this endpoint, but keep getting a 404 {'error': 'NOT_FOUND'}

Here's my code:

payload = json.dumps(payload)
response = requests.get("https://api.airtable.com/v0/meta/bases/{base_id}/tables/{table_id}/fields".format(base_id=base_id,table_id=table_id),
headers={"Authorization":"Bearer {token}".format(token=API_TOKEN),"Content-Type": "application/json",},
data=payload)
 
Could anyone advise?
1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Can you tell a little more about where this code came from,  what language you are using, and how you are running it?

These issues jumped out at me. There may be other issues.

- You are using GET request instead of a POST request.

- You are using an API key, which is not supported for creating fields. You should use a personal access token (or oAuth) instead.

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Can you tell a little more about where this code came from,  what language you are using, and how you are running it?

These issues jumped out at me. There may be other issues.

- You are using GET request instead of a POST request.

- You are using an API key, which is not supported for creating fields. You should use a personal access token (or oAuth) instead.

seregoalighieri
4 - Data Explorer
4 - Data Explorer

Thank you so much! Yes, my bad, I changed this to a post request, and it works now. I was using a personal access token, but realize the labeling was probably confusing. Will fix.

This code is in python, I'm running it within a script.