Jun 24, 2020 02:47 PM
I am using the Airtable Python API
With the following code I get a successful response, minus the API key I removed.
*from airtable import Airtable*
import os*
table_name = ‘PeachTree 903’;*
base_key = ‘app9F0yiPo2kvFBsA’;*
api_key = ‘’;*
airtable = Airtable(base_key, table_name, api_key)*
print(airtable)*
The response I get from the above is:
Which matches my table_name.
Now when I go to add this next line and run the script I get the following errors like nothing is returned which does not make any sense.
airtable.get_all()
Anyone solve this?
Solved! Go to Solution.
Jun 25, 2020 01:05 PM
Pretty sure that’s not the code that you used to get this response because it returned an object and did so without URI encoding of the table name? Very hard to believe; it should have thrown an error as it seems to be doing now.
Did you also remove the space from the table name in Airtable? And what was the outcome?
If you URI encode the table name, you don’t need to remove spaces.
Jun 24, 2020 05:32 PM
Hi James, and welcome to the community!
I see a few issues, but I can’t be certain because the actual code you are running is not visible here, right? You should share the actual code (without API key) so we can see exactly what’s running.
One issue is the fact that the table name includes a space. The only way for this to work is if the table name is URI encoded. Failing to do so would cause the exact issue I see in the screen shot.
Jun 25, 2020 12:39 PM
Code:
I did remove api key. I also took your advice and removed the space from the table name.
PS I did place code in original post, but looks like formatting got messed up and confusing.
Jun 25, 2020 01:05 PM
Pretty sure that’s not the code that you used to get this response because it returned an object and did so without URI encoding of the table name? Very hard to believe; it should have thrown an error as it seems to be doing now.
Did you also remove the space from the table name in Airtable? And what was the outcome?
If you URI encode the table name, you don’t need to remove spaces.
Jun 26, 2020 09:00 AM
I was calling the base name, not the table name. That is what thru the error in the code. Everything is working now.