Get Credentials for Google Spreadsheet¶
To obtain the Access Token, Client Id, Client Secret and Refresh Token, we need to follow the below steps.
Open the Google API Console Credentials page. You will be prompted to log in to a Google Account. Log in to your relevant Google Account.
Click on Select a Project and click NEW PROJECT, to create a project.
SpreadsheetConnectoras the name of the project and click Create.
Click Configure consent screen in the next screen.
- Provide the Application Name as
SpreadsheetConnectorin the Consent Screen.
- Click Create credentials and click OAuth client ID.
- Enter the following details in the Create OAuth client ID screen and click Create.
|Application type||Web Application|
|Authorized redirect URIs||https://developers.google.com/oauthplayground|
A Client ID and a Client Secret are provided. Keep them saved.
Click Library on the side menu, search for Google Sheets API and click on it.
Click Enable to enable the Google Sheets API.
Obtaining Access Token and Refresh Token¶
Navigate to OAuth 2.0 Playground and click the OAuth 2.0 Configuration button in the top right corner of your screen.
Select Use your own OAuth credentials, and provide the obtained Client ID and Client Secret values. Click on Close.
Under Step 1, select
Google Sheets API v4from the list of APIs and select all the scopes.
Click on Authorize APIs button and select your Gmail account when you are asked and allow the scopes.
Under Step 2, click Exchange authorization code for tokens to generate and display the Access Token and Refresh Token. Now we are done with configuring the Google Sheets API.