bergant / airtabler

R interface to the Airtable API
Other
91 stars 16 forks source link

Upcoming deprecation of Airtable API Keys #18

Closed schafnoir closed 1 year ago

schafnoir commented 1 year ago

Hello @bergant - first I wanted to say thank you for this excellent package of functions! I use this package all the time for accessing my Airtable data via a Shiny application.

My question/issue is related to the recent communications from Airtable related to the deprecation of Airtable API Keys, which apparently are meant to be replaced with authentication tokens. I imagine this change will affect the implementation of the airtabler package functions. Are there updates planned before February 2024 when the API Keys will cease working?

Cheers, Courtney

marks commented 1 year ago

Hey @schafnoir - I use airtabler too and have tested it with the new personal access tokens (PATs) and it should work without any code changes to airtabler.

You'll want to make sure you give your PAT the necessary scopes, which is one added step compared to now-legacy API keys. Based on my knowledge of this library's functionality, you should be able to have full functionality by including both data.records:read and data.records:write scopes on your PAT, but it's best to include only the scopes absolutely necessary.

Hope this helps!

schafnoir commented 1 year ago

@marks - thanks for the info, and interesting to hear my assumption was off-base! The current airtabler instructions involve setting the API Key as an environment variable. Did you set your Airtable PAT as an environment variable as well? With the same name as the API Key?

Cheers, Courtney

marks commented 1 year ago

No problem! And yeah, you can just put your personal access token in the same AIRTABLE_API_KEY environment variable. The legacy user API key (looks like keyXXXX) and PAT (looks like patXXX) both end up being put in the HTTP Authorization header after the word Bearer so the value effectively goes to the same place (code ref).

schafnoir commented 1 year ago

Excellent - those were the details that I clearly hadn't tested out yet for myself. Thank you!