Closed Peter-Valenta closed 7 years ago
I have the same issue.
Instead of
//.setParam('approval_prompt', 'force');
try
.setParam('approval_prompt', 'auto');
Also, did you activate the Search Console API in the Developer Console project where you set up the OAuth2 credentials?
Thank you, mihaiaperghis - after changing to 'auto' authorization now works like a charm and im making all the calls to Search Console API that I need!
@mihaiaperghis, thanks!
Glad it works!
PS: I'm using the same API for my Search Analytics for Sheets add-on.
Yes, I use your plugin for some time now, its really fantastic for pulling data. But I needed something a bit more tailored this time around, into an existing sheet that already includes a bunch of automation and custom functions.
Specifically I have the need to pull data automatically on a schedule from cell values and put the data back into a table in specific spots. Sort of an automated SERP tracker/reporting system.
Is it safe to close this issue now?
Think it is, setting approval_prompt to auto seems to have done the trick.
Sorry, I dont know if this is the correct forum for receiving support. Please let me know if this is out of line.
Im using your Oauth2 library from within google sheets to access google search console data via the webmaster v3 API. Ive implemented the code as closely as I could to your examples, but im running into the following error when making requests: Access not granted or expired. (line 352, file "Service", project "OAuth2") .
Validation with getService() seems to work fine. Ive set up my project to use OAuth 2.0 client ID credentials with: Application type: Web application Authorised JavaScript origins: https://script.google.com, https://docs.google.com & https://google.com Authorised Redirect URIs: https://script.google.com/macros/d/{SCRIPT ID}/usercallback
I hope someone here can help me out. Here is my code (very closely copied from the examples).