Note that there are some explanatory texts on larger screens.

plurals
  1. POEmail Settings APIs Authentication
    text
    copied!<p>I would like to use the Email Settings API with Apps Script to manage all users signatures on a Google Site. I have used Documents Data APIs before with 2-legged OAuth and it worked just fine. I am currently stuck on the authentication step for Email Settings API.</p> <p>Code example: </p> <pre><code>// Setup OAuthServiceConfig var oAuthConfig = UrlFetchApp.addOAuthService("signature"); oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken"); oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken"); //I left scope empty to gain access to all APIs would this scope work scope=https://apps-apis.google.com/a/feeds/emailsettings/2.0/ oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken"); oAuthConfig.setConsumerKey("domain.com"); oAuthConfig.setConsumerSecret("consumerSecret"); // Setup optional parameters to point request at OAuthConfigService. The "signature" // value matches the argument to "addOAuthService" above. var options = { "method" : method, "oAuthServiceName" : "signature", "oAuthUseToken" : "always" }; var result = UrlFetchApp.fetch("https://apps-apis.google.com/a/feeds/emailsettings/2.0/"+domainName+"/"+userName+"/signature", options); Logger.log(result); </code></pre> <p>I get this error: "Unexpected Error (line 37)" which is var result = UrlFetchApp.fetch("https://apps-apis.google.com/a/feeds/emailsettings/2.0/"+domainName+"/"+userName+"/signature", options);</p> <p>Any thoughts on what I am doing wrong? </p> <p>Scopes are here: <a href="http://support.google.com/a/bin/answer.py?hl=en&amp;answer=162105" rel="nofollow">http://support.google.com/a/bin/answer.py?hl=en&amp;answer=162105</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload