Google Drive
Connect Google Drive to your Appstrate agents.
Overview
Google Drive is Google's cloud file storage. The integration lets agents list, read, upload and organize files through the Drive API, including resumable uploads.
Integration: @appstrate/google-drive (version 1.0.5), reached through the api_call tool. For how this works, see How integrations work.
Authentication
| Property | Value |
|---|---|
| Type | oauth2 |
| Credential sent as | Authorization: Bearer <credential> |
| Default scopes | openid, email, https://www.googleapis.com/auth/drive.file |
| Token endpoint auth | client_secret_post |
| Uploads | google-resumable upload protocol for api_upload |
Scopes
The scopes below are the catalogue the integration declares. An agent gets the default scopes plus any it lists under scopes in its integrations_configuration.
| Scope | Description | Default |
|---|---|---|
openid | Identity (OpenID) | yes |
email | Email address | yes |
https://www.googleapis.com/auth/userinfo.email | Email address (Google canonical scope) | |
https://www.googleapis.com/auth/drive.file | Per-file access (recommended) | yes |
https://www.googleapis.com/auth/drive.readonly | Read-only access | |
https://www.googleapis.com/auth/drive | Full access | |
https://www.googleapis.com/auth/drive.metadata.readonly | Read metadata only | |
https://www.googleapis.com/auth/drive.appdata | App data folder | |
https://www.googleapis.com/auth/drive.photos.readonly | Read photos/videos |
Authorized URIs
The sidecar sends the credential only to URLs that match one of these patterns:
https://www.googleapis.com/drive/**https://www.googleapis.com/upload/drive/**
Connect Google Drive
An administrator registers an OAuth client once, then members connect their own accounts.
Create or select a Google Cloud project (open).
Enable the API you need in that project.
Configure the OAuth consent screen (open).
Create an OAuth client ID of type "Web application" and register the Appstrate redirect URI (open).
Register the redirect URI in the OAuth client's authorized redirect URIs: it is APP_URL followed by /api/integrations/callback, also shown in the integration's setup panel.
In Appstrate, open the integration and register the OAuth client (client ID and client secret). See How integrations work.
Use it in an agent
Excerpt of the agent manifest:
{
"dependencies": {
"integrations": { "@appstrate/google-drive": "^1.0.0" }
},
"integrations_configuration": {
"@appstrate/google-drive": {
"tools": ["api_call"]
}
}
}Example prompt:
Every Monday, list the files added to the "Reports" folder last week and write a one-paragraph summary of each.