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