Error with Drive APIs and Service Account in Google Workspace

Uzair1
New Member

In the Google Workspace, I created a developer account and then set up a service account. I'm using the service account to call the Drive APIs. When attempting to fetch an image from Drive and add it to documents, I occasionally encounter the following error:

googleapiclient.errors.HttpError: <HttpError 400 when requesting https://docs.googleapis.com/v1/documents/1RujzFaOALdLonX0l9VSFYWmf0_HSxCWhIaqoEkd7UAo:batchUpdate?alt=json  returned "Invalid requests[1].insertInlineImage: Access to the provided image was forbidden.". Details: "Invalid requests[1].insertInlineImage: Access to the provided image was forbidden.">

Interestingly, it works fine at times, but intermittently gives the error. I have also granted delegated permissions to the service account and encountered the same issue with impersonation. It works correctly sometimes but suddenly produces an error.

There is no error of api hit limit.

0 0 168
0 REPLIES 0