This describes how to get an access token from the Goa library using a service account, as described in Oauth2 for Apps Script in a few lines of code (which you should read first for background).
If you have initialized the credentials as described in Goa Setup, this is good to go. There is no consent dialog required for a service account.
This example does a query using the Google DataStore API and a service account flow.

getting the token


consuming the token


Using a service account service.

When the service account one off credentials package is created, it uses the data from the JSON file, as in this example.

Notice the use of the service definition ‘google_service’, which looks like this.


For more like this, see OAuth2 for Apps Script in a few lines of code

Why not join our forum, follow the blog or follow me on Twitter to ensure you get updates when they are available.