Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

"INVALID_PERMISSIONS_OR_MODEL_NOT_FOUND" error

Solved
Jump to Solution
8177 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Nevin06
5 - Automation Enthusiast
5 - Automation Enthusiast

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

1 Solution

Accepted Solutions
philm
4 - Data Explorer
4 - Data Explorer

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. 

See Solution in Thread

4 Replies 4
philm
4 - Data Explorer
4 - Data Explorer

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

Nevin06
5 - Automation Enthusiast
5 - Automation Enthusiast

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

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

Nevin06_1-1692869836419.png

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

Nevin06_2-1692869865032.png

 

Nevin06_0-1692869615095.png

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

philm
4 - Data Explorer
4 - Data Explorer

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. 

Nevin06
5 - Automation Enthusiast
5 - Automation Enthusiast

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