Airtable Python library not recognizing authentication token

I’m having trouble with the Airtable Python library when trying to authenticate with my API token. When I create an instance of the Airtable class and provide my authentication credentials, it doesn’t seem to work properly.

Here’s what I’m trying to do:

from airtable import Airtable

my_base_id = 'app123456789'
table_id = 'Users'

client = Airtable(my_base_id, table_id, api_key='key987654321')
result = client.get_all()

The connection fails even though I’m passing the API key as a parameter. Has anyone encountered this issue before? I’ve double-checked my credentials and they seem correct. Any suggestions would be helpful.

I faced a similar authentication issue earlier with the Airtable library. It’s crucial to ensure that you’re using the updated authentication method. Airtable has transitioned from using the traditional API key to Personal Access Tokens. Verify that your token is a Personal Access Token and not an older API key, which started with ‘key.’ You can generate a new token in your Airtable account settings. Additionally, make sure your version of the python-airtable library is up to date, as older versions may have compatibility issues. After I switched to a Personal Access Token and updated the library, the authentication process worked seamlessly.