Skip to content

Files

Latest commit

21c06b9 · Aug 14, 2019

History

History
This branch is 52 commits behind googleworkspace/apps-script-oauth2:master.

NoLibrary

Connect to a Google API without this library

This sample demonstrates how to connect to a Google Search Console API, which is not available natively in Apps Script. The script's manifest file has been edited to include the additional scope that the API requires. When a user authorizes the script they will also be asked to approve that additional scope. We can then use the method ScriptApp.getOAuthToken() to access the OAuth2 access token the script has acquired and pass it in the Authorization header of a UrlFetchApp.fetch() call to the API.