Category / Section
Comprehensive Guide to Setting Up Google Console Project for Sheets and Drive API Integration
3 mins read
Updated:
Overview
This guide provides a step-by-step process to set up a Google Cloud project and configure it for integrating Google Sheets and Drive APIs. It includes instructions for enabling APIs, configuring OAuth credentials, and completing the authentication process.
Steps to Set Up Google Console Project
1. Create a Google Cloud Project
- Log in to the Google Cloud Console.
- Click on the Select a project dropdown at the top of the page, then click on New Project.
- Provide the following details:
– Project Name: Enter a meaningful name (e.g., “Google Sheets API Integration”).
– Location: Leave it as “No organization” if you do not have an organization. - Click Create. Google will redirect you to the project dashboard
2. Enable Google Sheets and Drive APIs
- Navigate to APIs & Services > Library.
- In the API Library:
– Search for Google Sheets API, click on it, and then click Enable.
– Search for Google Drive API, click on it, and then click Enable.
3. Configure the OAuth Consent Screen
- Go to APIs & Services > OAuth consent screen.
- Choose External as the user type and click Create.
- Fill out the following details:
– App Name: Enter a meaningful name (e.g., “FlowMattic Google Integration”).
– User Support Email: Enter your email address.
– App Logo: Optional, but you can upload a logo if desired.
– Authorized Domains: Add the following domain: flowmattic.com
– Developer Contact Information: Enter your email address. - Click Save and Continue.
4. Add Scopes
- On the “Scopes” screen:
- Click Add or Remove Scopes.
– Select the following scopes from the list or manually add them:https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/drive
- Click Update and then Save and Continue
5. Add Test Users
- On the “Audience{target=”_blank"}" tab, under “Test Users” ssection:
– Click Add Users.
– Enter the email addresses of the Google accounts you will use to test the integration (e.g., your own or any users who will authenticate the connection).
– You can add multiple email addresses, separated by commas or one per line. - Click Save and Continue.
6. Create OAuth 2.0 Credentials
- Go to APIs & Services > Credentials.
- Click + Create Credentials and select OAuth Client ID.
- On the Create OAuth Client ID screen:
- Select Web Application as the application type.
- Provide a name for the credential.
- Add the callback URL to the Authorized Redirect URIs :
https://api.flowmattic.com/google/spreadsheets
- Save the credentials and securely store the Client ID and Client Secret.
7. Configure Connect in FlowMattic
- Navigate to the FlowMattic -> Connects settings in your WordPress dashboard.
- Click Connect Integration button
- Search for Google Sheets and click the box
- Provide the following details:
- Connect Name: Enter a meaningful name.
- Client ID: Paste the Client ID from Google Cloud.
- Client Secret: Paste the Client Secret from Google Cloud.
- Click Save Connect & Authenticate
8. Authenticate and Generate Tokens
- After saving the connection, you will be redirected to Google’s login page.
- Log in using one of the test user accounts.
- Grant permissions for the specified scopes.
- Upon successful authentication, the application will store the Access Token and Refresh Token for future API requests.
Tips
- Ensure that you have enabled both the APIs for Google Spreadsheets and Google Drive API
- FlowMattic needs your site’s cron jobs to be functional in order ro auto renew the Access Token. Make sure the cron jobs are working fine and you have set up the server side crons.
- Read more about cron jobs here -
Authentication keeps expiring or Delay not working - Regularly review and update test users as needed.