Document AI Permission Denied

565 views
Skip to first unread message

Sachin Tiwari

unread,
Feb 7, 2022, 9:45:15 AM2/7/22
to Google Cloud Developers
I am trying to parse large files through Document AI and while sending get request to operations to get my response I am getting this error which is "Caller Does not have permission" as shown in the picture attached.Can anyone help me in this please
Screenshot 2022-02-07 at 2.01.12 PM.png

Darrell (Cloud Platform Support)

unread,
Feb 7, 2022, 6:01:30 PM2/7/22
to Google Cloud Developers
Hi,

It looks like you are making the call using Postman. I can see that you are using an API key to try and authorize the call from the URL.

If you are using an API key, you will also need to authenticate the principal(User or Service Account) as mentioned here[2]: "When using API keys, the principal must be authenticated by other means."

Can you try setting the following in the headers as mentioned in the "try this API -> credentials -> click on (?)"[4]:

```
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
```
where YOUR_ACCESS_TOKEN can be found using the Cloud SDK and using this command:

```
gcloud auth application-default print-access-token[3]
```
Reply all
Reply to author
Forward
0 new messages