Skip to main content

Google Drive Connector

The Google Drive connector allows agents to access files and folders from Google Drive using either OAuth or Service Account authentication.

Prerequisites

Before creating a Google Drive connector, you need to:

  1. Create a Google Cloud Project
  2. Enable the Google Drive API
  3. Set up authentication credentials (OAuth Client or Service Account)

Getting Google Cloud Credentials

Method 1: OAuth Client Credentials

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Navigate to APIs & Services > Library
  4. Search for and enable the Google Drive API
  5. Go to APIs & Services > Credentials
  6. Click Create Credentials > OAuth client ID
  7. Configure the OAuth consent screen if prompted
  8. Select Web application as the application type
  9. Add your redirect URI: https://your-domain.com/api/auth/google-drive/callback
  10. Download the JSON file containing your client credentials
  1. In the Google Cloud Console, go to APIs & Services > Credentials
  2. Click Create Credentials > Service account
  3. Fill in the service account details
  4. Grant the service account appropriate roles (e.g., Editor or custom role)
  5. Create and download a JSON key file
  6. Share the Google Drive folders/files with the service account email address

Configuration Fields

When creating a Google Drive connector, you'll need to provide:

Google Drive Configuration

Required Fields:

  • Title: A descriptive name for your connector (e.g., "Team Drive Documents")
  • Client ID: From your Google Cloud OAuth client or service account
  • Client Secret: From your Google Cloud OAuth client (not needed for service accounts)
  • Redirect URI: The callback URL for OAuth authentication

Optional Fields:

  • Description: Description of the connector's purpose
  • Target Folder ID: Specific Google Drive folder ID to sync (leave empty for root access)
  • Shared Drive ID: ID of a Google Shared Drive to access

Finding Google Drive IDs

To get folder or shared drive IDs:

  1. Open Google Drive in your browser
  2. Navigate to the desired folder or shared drive
  3. Look at the URL: https://drive.google.com/drive/folders/FOLDER_ID_HERE
  4. Copy the ID from the URL

Testing the Connection

After configuring your Google Drive connector:

  1. Click Test Connection to verify the setup
  2. The system will attempt to authenticate and list sample files
  3. Fix any configuration issues if the test fails
  4. Click Create Connector once the test succeeds