OAuth2 - Google Sheets
The Google Sheets credential relies on the OAuth2 protocol. OAuth2 is an industry-standard protocol for authorization. It allows a client to easily authenticate and authorize access to resources.
This documentation is deprecated, follow the new guide for a
You will first need to go to the Google Cloud console. From there, you will need to go through the following steps:
- If you don’t have a Google project yet, or if you need to create a new project dedicated to your PROCESIO usage, you will need to create such a project and fill in the required information.
Note that if the Google Sheets API is already enabled in your project, it will appear listed in your dashboard.
2. If you have not enabled the Google Sheets API in your project yet, click on the button “Enable APIs and services” > Search for the Google Sheets API and select it.
3. Click Enable.
4. Click “Create Credentials” to create a new credential for your Google Sheets API.
5. Select “User data” and click Next.
6. Add a name, an email for support and developer contact information then save and continue.
7. In the Scopes section click Add or remove scopes and select the Google Sheets API scopes you need, then click Update.
8. After you added the Scopes click Save and Continue.
9. In the OAuth Client ID select Web application and add a name for the application. After selecting Web application as application type, the section will expand displaying Authorized redirect URIs.
10. Go in PROCESIO and Create an OAuth 2 Credential.
11. Copy the OAuth Redirect URL (Automatically generated by PROCESIO when creating the Credential).
11. Return to Google Cloud console in the OAuth Client ID section, and under Authorized redirect URIs click +Add URI and paste the link copied from PROCESIO.
12. Click Create and then Done.
13. Click on the OAuth consent screen in the right side panel, and under Test users, click +Add Users and enter your email address.
If the Application is created using an enterprise email within a specific organization:
- If the Application User Type is set to Internal, all users from that organization will have access to the App, and the Test users section will not be displayed.
- If the Application User Type is set to External, you should add the emails that need access to the App under Test users.
13. Click on the Credentials section in the right side panel, in the OAuth 2.0 Client IDs section, click on the newly created application.
14. Copy the Client ID and Client Secret.
15. Return to the Create Credential section in PROCESIO and finish creating the credential. All the URLs needed can be found in the API Documentation of the app (Google Sheets in this case):
- In the URL field you need to input the endpoint where the requests will be made: https://sheets.googleapis.com/v4
- In the Scopes field input the scopes you need to use: https://www.googleapis.com/auth/spreadsheets.readonly https://www.googleapis.com/auth/spreadsheets
- In the Client ID and Client Secret fields insert the values from the Credential created in Google Cloud. (copied at step 14)
- In the Auth URL field you need to input the Authorization URL: https://accounts.google.com/o/oauth2/v2/auth
- In the Token URL field you need to input the Token URL: https://oauth2.googleapis.com/token
16. Click "Save and Authorize" to generate your token.
17. If the Google app created in the Google Cloud Console is in testing (no need to publish the app), you will receive the following prompt:
If the Application is created using an enterprise email within a specific organization and with the User type set as Internal, this prompt will not be displayed.
- Click Continue.
18. In the following prompt check Select all and click Continue.
19. In the Test connection section add any GET request in order to confirm that everything was configured properly.
Endpoint: /spreadsheets/{SheetId}/values/A1:B9
- Replace {SheetId} with your Sheet Id
20. Click Save to save the credential.