This is a sample script for retrieving the access token for Service Account using Google Apps Script. The flow for using this script is as follows.
- At first, please create the Service Account and retrieve JSON file.
- Put Scopes,
private_key
andclient_email
to the script. - Run the script.
var private_key = "#####"; // private_key of JSON file retrieved by creating Service Account
var client_email = "#####"; // client_email of JSON file retrieved by creating Service Account