This is part of the writeup on Using Google Cloud Storage with Apps Script. In Setting up or creating a console project I showed how to create a project and to enable billing to be able to use Google Cloud Storage. The next step is to enable the APIS you'll need, and set up OAuth2.
In the Developers console entry for your project you'll see an API library. This shows all the APIS that you can enable from the console.
In your dashboard you'll see the ones that are already enabled for your project. It may be that the ones you want are enabled by default. Here's how they look in my dashboard
Oauth2 can be difficult to come to grips with. There are essentially two flows
I'm using my cGoa library to handle all OAuth2, so there's very little coding you need to do. There are other libraries available, but they will all start with creating the credentials in the console, which is what we're about to do here. For other OAuth2 scenarios and information on my cGoa library see OAuth2 for Apps Script in a few lines of code
In the credentials section of the console, create new credentials
We're creating a service account, so the user doesn't need to go through an oauth dialog.
This service account will be the project owner, as per this dialog.
When you create this, it will download a json file. Move this somewhere private on your google drive and take a note of its file id. You don't need to look inside the file, as cGoa knows what to do with such a file, given its id.
Now the service account is set up and we can use it for future apps that need to access this project's storage as described in Using the service account to enable access to cloud storage
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Google cloud topics > Cloud Storage and Apps Script >