6

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?

Kos
  • 4,890
  • 9
  • 38
  • 42
Mike
  • 227
  • 1
  • 3
  • 17
  • Hi, are you still getting an error? I just tried it and it's working fine. – Iamblichus Jan 16 '20 at 12:37
  • it looks like it is working today, very weird. I didnt change a line of code – Mike Jan 16 '20 at 18:59
  • 1
    I got the same error...the strange thing is that this morning, as of 05/02/2020, the same exact code worked fine. I suppose it is an internal Google error, but I cannot guarantee anything – jcf Feb 05 '20 at 16:34
  • same issue here. i thought it was what i did – Denise Feb 16 '20 at 14:40
  • I got pretty the same issue with my code and Google Slides API. It can work for a week and then suddenly stop working for some reason. Have no idea why this is. – Sergei V Kim Feb 16 '20 at 23:09
  • it looks like I am getting the error again (Feb 17th) @1248 am – Mike Feb 17 '20 at 08:48
  • I started to get this error again @ May 19 2020 I implemented the changes below and still having trouble: add image to drive -> open permission -> copy it over from drive to slide -> close permissions. – Mike May 19 '20 at 21:33
  • 1
    I did not have this error a couple of hours ago and now have it. That's strange. No change in my code on my side. –  Oct 18 '21 at 02:26

2 Answers2

1

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.

-1

I ran into the same issue. You should check out this link, which describes changes to the Drive API: Upcoming changes to the Google Drive API and Google Picker API

The proposed solution here seems feasible, although I have not fully tested it myself: Google script replaceAllShapesWithImage with image from drive doesn"t work any more

miladio
  • 35
  • 7