Help

Re: Block SDK: Invalid Airtable API key specified

Solved
Jump to Solution
1799 0
cancel
Showing results for 
Search instead for 
Did you mean: 

I can't get Block SDK to work with Personal Access Tokens. It doesn't accept the format and returns...

Error: Invalid Airtable API key specified. Make sure you copied it correctly from airtable.com/account.
Code: airtableApiKeyMalformed

@Olafur_Petursso: I saw your post from a few weeks ago and adding the secret key seemed to work for you. You do mean this key, correct?

Rupert_Hoffsch1_0-1722182012841.png

Any help is highly appreciated! 

 

1 Solution

Accepted Solutions
Rupert_Hoffsch1
10 - Mercury
10 - Mercury

Puh, realized I was still using an old version of the Blocks CLI. Played around with Node.JS versions and eventually managed to update. Now all is working! Thanks for your support and sharing!!

See Solution in Thread

9 Replies 9
TheTimeSavingCo
18 - Pluto
18 - Pluto

Is this during `block init`?  If so, I vaguely recall hitting something similar; ended up solving it by just making a PAT with access to everything with all workspaces forever heh

And yeap I used that key; lemme know if you're still facing issues with a key that has access to everything and I'll run some tests

@TheTimeSavingCo Thank you! This is happening for 'block set-api-key' and also on 'block submit'. I've tried using a PAT with access to everything, but that didn't solve it. I feel that there is a validator inside of the Blocks SDK that isn't allowing the PAT format and still relies on the old API key format. Setting legacy API keys still works via 'set-api-key', but fails when submitting.

I've reached out to AT support.

Weird!  I just created a new PAT with only block scopes and access to current and future workspaces.  I then did a `block set-api-key` and it saved it fine

Let me know if I can test anything to help!

Rupert_Hoffsch1
10 - Mercury
10 - Mercury

Tried the same again (hadn't used "access to current and future workspaces" before), but with no luck. What's your blocks version in package.json?

Rupert_Hoffsch1_0-1722238583923.png

 

Here!
Screenshot 2024-07-29 at 9.03.55 PM.png
CLI:

@airtable/blocks-cli/2.0.4 darwin-x64 node-v19.5.0

 

Rupert_Hoffsch1
10 - Mercury
10 - Mercury

Puh, realized I was still using an old version of the Blocks CLI. Played around with Node.JS versions and eventually managed to update. Now all is working! Thanks for your support and sharing!!

Ahh yeah, been there man.  Glad you got it sorted!

If you've already tried a PAT with only block scopes and access to current and future workspaces and it still isn't working you may want to open a support ticket with Airtable directly!

Have you checked your Block CLI version? Not updating that caused the issue for me (had to play with Node versions a bit as far as I remember)