Google Drive

Google Drive logo

Google Drive

Connect your Google Drive data to Airweave

Overview

The Google Drive connector allows you to sync data from Google Drive into Airweave, making it available for search and retrieval by your agents.

Configuration

GoogleDriveSource

Google Drive source implementation (read-only).

Retrieves and yields:

  • GoogleDriveDriveEntity objects, representing shared drives
  • GoogleDriveFileEntity objects, representing files in each shared drive
  • GoogleDriveFileEntity objects, representing files in the user’s My Drive

Authentication

This connector uses OAuth 2.0 with refresh token.

You can connect through the Airweave UI, which will guide you through the OAuth flow.

Entities

The following data models are available for this connector:

Schema for a Drive resource (shared drive).

Reference: https://developers.google.com/drive/api/v3/reference/drives

FieldTypeDescription
drive_idstrUnique ID of the shared drive.
nameOptional[str]The name of this shared drive.
kindOptional[str]Identifies what kind of resource this is; typically “drive#drive”.
color_rgbOptional[str]The color of this shared drive as an RGB hex string.
created_timeOptional[datetime]When the shared drive was created (RFC 3339 date-time).
hiddenboolWhether the shared drive is hidden from default view.
org_unit_idOptional[str]The organizational unit of this shared drive, if applicable.

Integrate Airweave with Google APIs on localhost

This guide will walk you through connecting Google Workspace APIs to Airweave when running locally. Google provides extensive documentation on setting up your workspace. Below is a streamlined process for connecting Google APIs to Airweave.

  1. Create a Google Cloud project for your Google Workspace (if you don’t already have one)
  2. Enable the Google Workspace APIs for Gmail, Google Calendar, and Google Drive
  3. Configure Google OAuth 2.0 consent screen
  4. Under Audience, select Make external and add test users
  5. Under Data Access, add the following scopes:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.metadata.readonly
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/calendar.events.public.readonly
https://www.googleapis.com/auth/calendar.freebusy
https://www.googleapis.com/auth/calendar.readonly
https://www.googleapis.com/auth/calendar.calendars.readonly
https://www.googleapis.com/auth/calendar.events.owned.readonly
https://www.googleapis.com/auth/calendar.events.readonly
  1. Create OAuth client ID credentials
  2. Under “Authorized redirect URIs,” click ”+ Add URI” and add the following URIs:
    http://localhost:8080/auth/callback/gmail
    http://localhost:8080/auth/callback/google_calendar
    http://localhost:8080/auth/callback/google_drive
  3. Locate the client ID and client secret from your newly created OAuth client. Add these credentials to the dev.integrations.yml file to enable Google API integration.