I want access to the Cloud Print JSON interface via a Google Apps Script. I know that I need to get an authorization token but, when I try to invoke "UrlFetchApp.addOAuthService("google");" it only shows me:
Authorization is required to perform that action
My project is already published as a web app, and when I was looking for an answer I found one in what somebody said that Google Latitude API is using OAuth2 and Google Apps Script engine is using OAuth1, so there was no way to get a token from it.
I want to know if this also applies to Google Cloud Print, because I need a token to send in every call to the JSON API.
If the error message says "Authorization is required to perform that action.", all you have to do is authorize your script. Just attempt to run any function manually from the script editor and you'll be asked to authorize.
However, if the script is published as a web app and set to run as the user running the script, then each user accessing the script will be asked to authorize for the first time.