Google Sheets API - IMPORT / Image - Bypass User Consent

I’ve wracked my brain with the recent update to google sheets api that fixes the issue of inserting images into sheets and needing user consent each time. I’ve tried numerous variations of the api call and the hangup is “requests” isn’t recognized or at least I am unable to figure out how to set up the module. After running my head around in circles for hours, I’m simply going to ask, as I’ve obviously not wrapped this brain around this one.

Links for reference
Short read about it
Official Ref

I’m simply getting 400 INVALID_ARGUMENT at best… I’ve deleted all efforts at this point, with exception of the most basic api call. I surrender to the hive mind to help me on this one, already been to long a day on this one.


Hey @SuperFunness - It looks like you may be using the wrong API endpoint. In both the article you sent as well as the official documentation it makes reference to the batch endpoint (" Developers can use the spreadsheets.batchUpdate method in the Sheets API to set this property to true and allow access to external URLs for the IMAGE and IMPORT functions without requiring user consent.") whereas as you’re using the append endpoint. Try using spreadsheets/{spreadsheetId}:batchUpdate in your URL instead and see if that does the trick!

If you have any issues let me know, I’d be happy to try and help troubleshoot further.

2 Likes

That was it!

And this is why I’m constantly thankful for everyone here. One simple point of focus and I missed the initial detail as I got so focused on the later function. Thank you, this worked as smooth as I had hoped and keeps it all in one place.

3 Likes

Happy to help and thank you for linking the relevant documentation. Makes it much easier to serve as a second set of eyes when you don’t need to go searching for the documentation yourself!

2 Likes