Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why call of Google Slides API returns error?

I have essentially been using this code to load an image into Google Drive and then transferring that image over to Google Slides using Python and for some reason it stopped working today.

The code I based mine off of is located here: http://wescpy.blogspot.com/2016/11/using-google-slides-api-with-python.html

However, today I reran it and am getting an error:

googleapiclient.errors.HttpError: https://slides.googleapis.com/v1/presentations/PRESENTATION_ID returned "Invalid requests[0].createImage: Access to the provided image was forbidden.">

I am wondering if anything have changed in Google API?

like image 909
Mike Avatar asked Jan 15 '20 23:01

Mike


2 Answers

Are you getting the same error today 2020/3/6?

<HttpError 400 when requesting https://slides.googleapis.com/v1/presentations/6-7HI:batchUpdate?fields=&alt=json returned "Invalid requests[24].createImage: Access to the provided image was forbidden.">

The error happens every time I am trying to push any image stored in Google Slides using either createImage or replaceAllShapesWithImage.

Note that the URLs pointing at Google Drive content are related to Public content. Thus, the workaround above mentioned by @miladio is not useful at this time.

like image 78
Alejandro Perez Avatar answered Sep 21 '22 15:09

Alejandro Perez


Error again occuring @ 2020-05-17:

Before this moment it has been working flawlessly with the update to add image to drive -> open permission -> copy it over from drive to slide -> close permissions.

googleapiclient.errors.HttpError: <HttpError 400 when requesting https://slides.googleapis.com/v1/presentations/<SLIDE_ID>?alt=json returned "Invalid requests[152].createImage: Access to the provided image was forbidden.">
like image 42
Mike Avatar answered Sep 18 '22 15:09

Mike