Getting Started
In order to access and call the API, you will need to do the following:
Enable the API
Before you can call the API, you'll need to enable it. To do so, navigate to Enable the API in the Cloud Console.
Create an OAuth Client
- Navigate to Configure OAuth consent screen
- Choose Internal, then click Create
- Add the Data Studio read+write scope:
- Click Add Scope
- Click the manually paste link at the bottom of the pop-up
- Enter
https://www.googleapis.com/auth/datastudio
- Click Add
- Fill out any other required fields, then click Save
- Navigate to Credentials
- Click the CREATE CREDENTIALS button
- Select OAuth client ID
- Choose the appropriate
Application Type
. (You probably want Web application) - Fill out the required fields then click Create
Authorize OAuth client
- Navigate to domain wide delegation in Google Admin console
- In
API clients
, click Add new - Enter the
Client ID
for the OAuth client you created in the previous step - Enter all OAuth scopes needed for the application. At a minimum you will
need to add the following scopes:
https://www.googleapis.com/auth/datastudio
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
openid
- Click Authorize
Next Steps
After completing these steps you will have the necessary access to call the API. In order to actually call the API, you will need to get an OAuth token, and include it in your request. Programmatically getting an OAuth token is out of scope for this doc, but Using OAuth 2.0 to Access Google APIs should get you started.