Appendix 15: Google Refresh Token Generation
It is assumed that you have a Google developer console account created on https://console.developers.google.com.
In this Appendix we complete the Google Spreadsheet steps prerequisites.
- Enable APIs for Google Drive and Google Spreadsheet
- Generate Client ID and Client Secret
- Generate Refresh Token in exchange for the Client ID and Client Secret
References
Google Spreadsheet documentation
https://developers.google.com/sheets/api
Enable APIs
In this section we will Enable APIs for Google Drive and Google Spreadsheet.
- Go to the Google Developer Console (https://console.developers.google.com/)
- Click Select a Project or create a New Project. If you have an existing project, you can select it from ALL.
- Provide valid values for the project and click on the Create button.
- Navigate to Dashboard on Google Developer console and Click on ENABLE APIS AND SERVICES.
- Search for Google Drive API and Google Sheets API. Click on Enable.
- The following screenshot shows Google Sheets API. Click on Enable.
Get a Client ID and Client Secret
- Navigate to the tab OAuth consent screen and choose the valid option.
- Enter the Application name, Authorized domains, and click on the Save button.
- Click on Credentials menu >> Create Credentials and from the dropdown list select OAuth client ID.
- From the Application type, select the Web Application.
- Enter valid Name and Authorized Redirect URIs. Click on the Create button.
- Copy Client ID and Client Secret. Click on the OK button.
- Get Client ID and Client Secret by clicking on the OAuth 2.0 Client IDs.
Generate Refresh Token
In this section we will generate Refresh Tokens using Client ID and Client Secret on Google OAuth 2.0 Playground.
- Go to the Google OAuth Playground (https://developers.google.com/oauthplayground/)
- Click on the Settings icon.
- Click on Use your own OAuth credentials and enter OAuth Client ID and OAuth Client secret generated from the previous step.
- Copy the following URL ‘https://developers.google.com/oauthplayground’