Skip to main content
Solved

"INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND" error


Forum|alt.badge.img+4

Invoke-WebRequest -Uri "https://api.airtable.com/v0/{baseId}/{tableIdOrName}?maxRecords=3&view=Grid%20view" -Headers @{"Authorization"="Bearer YOUR_SECRET_API_TOKEN"}

 

Error Message in Windows Power Shell

Invoke-WebRequest : {"error":{"type":"INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND","message":"Invalid permissions, or the
requested model was not found. Check that both your user and your token have the required permissions, and that the
model names and/or ids are correct."}}
At line:1 char:1
+ Invoke-WebRequest -Uri "https://api.airtable.com/v0/{baseId} ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

I tried using curl command also, 

curl "https://api.airtable.com/v0/{baseId}/{tableIdOrName}?maxRecords=3&view=Grid%20view" -H "Authorization: Bearer YOUR_SECRET_API_TOKEN"

Error Message in Windows Power Shell

Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Authorization: Bearer
YOUR_SECRET_API_TOKEN" value of type "System.String" to
type "System.Collections.IDictionary".
At line:1 char:96
+ ... %20view" -H "Authorization: Bearer YOUR_SECRET_API_TOKEN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Best answer by philm

Can you try the example curl request that you will find here:

https://airtable.com/{YOUR_BASE_ID}/api/docs#curl/table:table%201:retrieve

Just add your access token in the reqest. If you not receiving the correct response, check the permission for your access token. 

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+4
  • New Participant
  • 2 replies
  • August 24, 2023

I had the same issue. Visit this page there you will find the example request that worked for me:

https://airtable.com/{YOUR_BASE_ID}/api/docs#curl/table:table%201:retrieve

Make sure to replace {YOUR_BASE_ID} with your id "app...."


Forum|alt.badge.img+4
  • Author
  • New Participant
  • 2 replies
  • August 24, 2023
philm wrote:

I had the same issue. Visit this page there you will find the example request that worked for me:

https://airtable.com/{YOUR_BASE_ID}/api/docs#curl/table:table%201:retrieve

Make sure to replace {YOUR_BASE_ID} with your id "app...."


Thanks @philm for the reply. Have already tried this but still not working. Tried in postman.

1) https://localhost:5001/api/airtable/read/{recordId}

2) https://api.airtable.com/v0/{_baseId}/{_tableName}/{recordId}

 

Added Authorization as Headers 'Key' and "Bearer YOUR_APP_KEY_OR_ACCESS_TOKEN" as 'Value' for both 1) and 2)


Forum|alt.badge.img+4
  • New Participant
  • 2 replies
  • Answer
  • August 24, 2023

Can you try the example curl request that you will find here:

https://airtable.com/{YOUR_BASE_ID}/api/docs#curl/table:table%201:retrieve

Just add your access token in the reqest. If you not receiving the correct response, check the permission for your access token. 


Forum|alt.badge.img+4
  • Author
  • New Participant
  • 2 replies
  • August 24, 2023

Thanks @philm . The issue was I hadn't granted read permission to my personal access token. Please see attached image as reference.


Reply