Skip to main content
Solved

Block SDK: Invalid Airtable API key specified

  • July 28, 2024
  • 9 replies
  • 92 views

Rupert_Hoffsch1
Forum|alt.badge.img+21

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?

Any help is highly appreciated! 

 

Best answer by Rupert_Hoffsch1

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!!

9 replies

TheTimeSavingCo
Forum|alt.badge.img+31

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


Rupert_Hoffsch1
Forum|alt.badge.img+21

@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.


TheTimeSavingCo
Forum|alt.badge.img+31

@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
Forum|alt.badge.img+21

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?

 


TheTimeSavingCo
Forum|alt.badge.img+31

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?

 


Here!

CLI:

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

 


Rupert_Hoffsch1
Forum|alt.badge.img+21

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!!


TheTimeSavingCo
Forum|alt.badge.img+31

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!


TheTimeSavingCo
Forum|alt.badge.img+31

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!


Rupert_Hoffsch1
Forum|alt.badge.img+21

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)