Google Drive Tools – Setup with Google Workspace API
A concise guide for configuring service account credentials and shared folders, enabling bots or workflows to interact with Google Drive under a service account.
Overview
Purpose
This guide walks you through obtaining and configuring Google Workspace credentials for Google Drive Tools. By following these steps, you’ll enable your bots or workflows to seamlessly read, write, and organize files in Google Drive, leveraging a secure service account.
Steps
Enable Google APIs
Activate Google Drive, Sheets, or Docs APIs within your Google Cloud project.
Service Account Creation
Generate a new service account with a JSON key file for secure API access.
Shared Folder Configuration
Share a Google Drive folder with your service account to store or retrieve files.
Workflow Testing
Validate your configuration by listing files or performing read/write operations.
Step-by-Step Setup
Step 1: Access the Google Cloud Platform (GCP)
-
Open GCP Console: Go to https://console.cloud.google.com/
-
Sign Up or Log In: Use your Google account credentials.
-
Create / Select a Project:
-
If you don’t have a project, click New Project
-
Example name:
"Genesis_Google_Integration"
-
Step 2: Enable Google APIs
Within your GCP project:
-
Go to APIs & Services > Library
-
Enable the following:
-
Google Drive API
-
Google Sheets API (if you need spreadsheet operations)
-
(Optional) Google Docs API (for document editing)
-
-
Confirm that these APIs are now active in your project.
Step 3: Create a Service Account
-
IAM & Admin > Service Accounts in the GCP Console
-
Create Service Account:
-
Provide a name (e.g.,
"GenesisBot_ServiceAccount"
) and description -
Click Create and Continue
-
-
Assign Roles:
-
Editor for full read/write (or Viewer if you need limited privileges)
-
Click Done once selected
-
Step 4: Generate Service Account Credentials (Key File)
-
In Service Accounts, locate your new account. Click Actions (…) > Manage Keys
-
Add Key > Create New Key
-
Choose JSON and download the file
Important: Store this file securely. It grants API access with your private key information.
Step 5: Set Up Shared Folder for File Access
-
Create a Folder in Google Drive (e.g.,
"Genesis_Shared_Folder"
) -
Share the folder with your service account email:
-
Example:
service-account-id@genesis_gcp_project.iam.gserviceaccount.com
-
Grant Editor role for writing or editing files
-
-
Copy the Folder ID: This is the alphanumeric string in the folder URL:
- E.g.,
https://drive.google.com/drive/folders/<Folder-ID>
- E.g.,
Step 6: Fill in the API Parameters
In the Genesis Bots configuration interface (or similar):
-
Project ID: Found in your GCP project settings or JSON key file
-
Client ID: From the key file or OAuth consent screen
-
Client Email: Copied from the service account details
-
Private Key:
-
Open the JSON file
-
Copy the
"private_key"
value, including the lines:"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
-
-
Private Key ID: Found within the JSON (
"private_key_id"
) -
Shared Folder ID: The ID from Step 5
Step 7: Save and Apply Configuration
- After inputting your credentials, click “Add Google Worksheet API parameters to access Google Worksheet account from Genesis.”
Step 8: Test the Google Drive Tools Integration
-
Perform a Basic Test:
-
Example: List files in your shared Drive folder using the tool
-
Or read data from a Google Sheet (if configured)
-
-
Check for any errors such as unauthorized or invalid credentials
Additional Tips
-
API Key Security: Keep the JSON file private. Revoking and regenerating keys periodically is good practice
-
Quota Monitoring: GCP imposes usage limits; regularly check your console for errors or exceeded quotas
-
Troubleshooting: If unsuccessful:
-
Confirm your service account email has folder access
-
Ensure
private_key
lines are intact and properly formatted
-
Integration Relevance
-
File Management: Automated workflows can upload, download, or manage Google Drive items under the service account
-
ETL & Reporting: Pair with
database_tools
orprocess_scheduler_tools
to store processed datasets or logs -
Collaboration: Combine with Slack or email integrations to share Drive file links among teams
Configuration Details
-
Role Assignments: If read-only is sufficient, use
Viewer
role for extra security -
Parent Folders: Keep the folder structure in mind—child folders must inherit or be granted the same sharing settings
-
Key Rotation: If compromised or outdated, generate a new service account key, remove the old one
Example
After setting these parameters, try a sample call to list files in "Genesis_Shared_Folder"
. If you see the correct file list, your bot is ready to read or write in Google Drive under the configured service account.