Google Drive

File Sharing and Storage

Google Drive API (v3) provides full access to files and folders stored in Google Drive. You can upload, download, search, share, organize files, and export Google Docs/Sheets/Slides to various formats. The API integrates tightly with the Google Workspace ecosystem and uses OAuth 2.0. For OpenClaw agents, Google Drive is a powerful integration for document workflows. Your agent can search for documents by name or content, download files for analysis, upload generated content, export Google Docs as PDF or Markdown, and manage sharing permissions — all from chat commands or automated workflows.

Tags: files, storage

Category: Cloud Storage & File Sharing

Use Cases

  • Search Google Drive for documents by keyword and return links via chat
  • Export Google Docs to Markdown for processing in OpenClaw skills
  • Upload generated reports or data exports to specific Drive folders

Tips

  • Use fields parameter to limit response data — Drive responses can be very verbose
  • Combine Gmail + Calendar + Drive OAuth in one credential for a complete Google integration
  • The 'fullText contains' query searches inside document content, not just filenames

Known Issues & Gotchas

  • Google Docs/Sheets/Slides have no direct download — you must 'export' them to a format
  • The 'q' search parameter uses a custom query syntax, not standard SQL
  • Shared drives have different API endpoints and permission models than personal 'My Drive'

Frequently Asked Questions

Can I download Google Docs/Sheets as other formats?

Yes. The export endpoint lets you convert Google Docs to PDF, DOCX, Markdown, plain text, and more. Google Sheets can be exported as CSV, XLSX, or PDF.

Does Google Drive API share the same OAuth setup as Gmail and Calendar?

Yes. If you've already set up Google OAuth for Gmail or Calendar, adding Drive scopes is just one extra permission. All three use the same Google Cloud project.

How do I handle large file uploads?

Use resumable uploads for files over 5MB. The API supports chunked uploads that can be resumed if the connection drops, which is important for automation reliability.