Google APIs use the OAuth 2.0 protocol for authentication and authorization. Google supports common OAuth 2.0 scenarios such as those for web server, installed, and client-side applications.
Read about using OAuth2 for accessing Google AdWords API.
To connect to the Google service using OAuth2 protocol you will need the following:
Client ID and Client Secret
To obtain the Client ID and Client Secret:
Step 1. Login to https://console.cloud.google.com/ with your Google Account.
Step 2. Click Select a project and click New Project.
Step 3. Give the project a name and click Create. Wait until the project is created.
Step 4. Click APIs and Services/Credentials and click Create credentials.
Step 5. Select OAuth client id.
Step 6. Click Configure consent screen.
Step 7. Give the application a name and save it.
Step 8. Select Web application, enter
https://developers.google.com/oauthplayground in Authorized redirect URIs, and click Create.
Step 9. Copy client ID and client secret. You will need them later.
Step 1. Go to https://developers.google.com/oauthplayground/
Step 2. Select scope from the list or input your own scope.
For example, for Google AdWords API, the scope is
Step 3. Click the "gears" button and select Use your own OAuth credentials.
Step 4. Enter the client id and client secret and click Authorize APIs.
Step 5. Login with your Google account and click Allow.
Step 6. Click Exchange authorization code for tokens and copy Refresh token. You will need it later.
The development token is issued per API (also not all APIs require a development token). In this example, we will walk you through creating a development token for Google AdWords API.
Assuming that you already have a manager Google AdWords account:
Step 1. Go to https://ads.google.com/home/tools/manager-accounts/ and click Sign In.
Step 2. Sign in with your AdWords manager account.
Step 3. Click Tools icon and select API Center.
Step 4. Create and copy a Developer token. You will need it later.
Step 5. By default, a token is created with a Test Account level. To use this in production apply for Basic Access.
it takes a few days to activate the basic access level.