Files
2026-04-11 09:45:12 -05:00

3.7 KiB

Google Drive Routing Reference

App name: google-drive Base URL proxied: www.googleapis.com

API Path Pattern

/google-drive/drive/v3/{endpoint}

Common Endpoints

List Files

GET /google-drive/drive/v3/files?pageSize=10

With query:

GET /google-drive/drive/v3/files?q=name%20contains%20'report'&pageSize=10

Only folders:

GET /google-drive/drive/v3/files?q=mimeType='application/vnd.google-apps.folder'

Files in specific folder:

GET /google-drive/drive/v3/files?q='FOLDER_ID'+in+parents

With fields:

GET /google-drive/drive/v3/files?fields=files(id,name,mimeType,createdTime,modifiedTime,size)

Get File Metadata

GET /google-drive/drive/v3/files/{fileId}?fields=id,name,mimeType,size,createdTime

Download File Content

GET /google-drive/drive/v3/files/{fileId}?alt=media

Export Google Docs (to PDF, DOCX, etc.)

GET /google-drive/drive/v3/files/{fileId}/export?mimeType=application/pdf

Create File (metadata only)

POST /google-drive/drive/v3/files
Content-Type: application/json

{
  "name": "New Document",
  "mimeType": "application/vnd.google-apps.document"
}

Create Folder

POST /google-drive/drive/v3/files
Content-Type: application/json

{
  "name": "New Folder",
  "mimeType": "application/vnd.google-apps.folder"
}

Update File Metadata

PATCH /google-drive/drive/v3/files/{fileId}
Content-Type: application/json

{
  "name": "Renamed File"
}

Move File to Folder

PATCH /google-drive/drive/v3/files/{fileId}?addParents=NEW_FOLDER_ID&removeParents=OLD_FOLDER_ID

Delete File

DELETE /google-drive/drive/v3/files/{fileId}

Copy File

POST /google-drive/drive/v3/files/{fileId}/copy
Content-Type: application/json

{
  "name": "Copy of File"
}

Create Permission (Share File)

POST /google-drive/drive/v3/files/{fileId}/permissions
Content-Type: application/json

{
  "role": "reader",
  "type": "user",
  "emailAddress": "user@example.com"
}

Query Operators

Use in the q parameter:

  • name = 'exact name'
  • name contains 'partial'
  • mimeType = 'application/pdf'
  • 'folderId' in parents
  • trashed = false
  • modifiedTime > '2024-01-01T00:00:00'

Combine with and:

name contains 'report' and mimeType = 'application/pdf'

Common MIME Types

  • application/vnd.google-apps.document - Google Docs
  • application/vnd.google-apps.spreadsheet - Google Sheets
  • application/vnd.google-apps.presentation - Google Slides
  • application/vnd.google-apps.folder - Folder
  • application/pdf - PDF

Notes

  • Authentication is automatic - the router injects the OAuth token
  • Use fields parameter to limit response data
  • Pagination uses pageToken from previous response's nextPageToken

Resources