API Reference

This API reference is organized by resource type. Each resource type has one or more data representations and one or more methods.

Resource types

  1. About
  2. Changes
  3. Channels
  4. Comments
  5. Files
  6. Permissions
  7. Replies
  8. Revisions
  9. Teamdrives

About

For About Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
get GET  /about Gets information about the user, the user's Drive, and system capabilities.

Changes

For Changes Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
getStartPageToken GET  /changes/startPageToken Gets the starting pageToken for listing future changes.
list GET  /changes Lists the changes for a user or Team Drive.

Required query parameters: pageToken

watch POST  /changes/watch Subscribes to changes for a user.

Required query parameters: pageToken

Channels

For Channels Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
stop POST  /channels/stop Stop watching resources through this channel

Comments

For Comments Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
create POST  /files/fileId/comments Creates a new comment on a file.
delete DELETE  /files/fileId/comments/commentId Deletes a comment.
get GET  /files/fileId/comments/commentId Gets a comment by ID.
list GET  /files/fileId/comments Lists a file's comments.
update PATCH  /files/fileId/comments/commentId Updates a comment with patch semantics.

Files

For Files Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
copy POST  /files/fileId/copy Creates a copy of a file and applies any requested updates with patch semantics.
create POST
https://www.googleapis.com/upload/drive/v3/files

and
POST  /files
Creates a new file.
delete DELETE  /files/fileId Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.
emptyTrash DELETE  /files/trash Permanently deletes all of the user's trashed files.
export GET  /files/fileId/export Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.

Required query parameters: mimeType

generateIds GET  /files/generateIds Generates a set of file IDs which can be provided in create requests.
get GET  /files/fileId Gets a file's metadata or content by ID.
list GET  /files Lists or searches files.
update PATCH
https://www.googleapis.com/upload/drive/v3/files/fileId

and
PATCH  /files/fileId
Updates a file's metadata and/or content with patch semantics.
watch POST  /files/fileId/watch Subscribes to changes to a file

Permissions

For Permissions Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
create POST  /files/fileId/permissions Creates a permission for a file or Team Drive.
delete DELETE  /files/fileId/permissions/permissionId Deletes a permission.
get GET  /files/fileId/permissions/permissionId Gets a permission by ID.
list GET  /files/fileId/permissions Lists a file's or Team Drive's permissions.
update PATCH  /files/fileId/permissions/permissionId Updates a permission with patch semantics.

Replies

For Replies Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
create POST  /files/fileId/comments/commentId/replies Creates a new reply to a comment.
delete DELETE  /files/fileId/comments/commentId/replies/replyId Deletes a reply.
get GET  /files/fileId/comments/commentId/replies/replyId Gets a reply by ID.
list GET  /files/fileId/comments/commentId/replies Lists a comment's replies.
update PATCH  /files/fileId/comments/commentId/replies/replyId Updates a reply with patch semantics.

Revisions

For Revisions Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
delete DELETE  /files/fileId/revisions/revisionId Permanently deletes a revision. This method is only applicable to files with binary content in Drive.
get GET  /files/fileId/revisions/revisionId Gets a revision's metadata or content by ID.
list GET  /files/fileId/revisions Lists a file's revisions.
update PATCH  /files/fileId/revisions/revisionId Updates a revision with patch semantics.

Teamdrives

For Teamdrives Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v3, unless otherwise noted
create POST  /teamdrives Creates a new Team Drive.

Required query parameters: requestId

delete DELETE  /teamdrives/teamDriveId Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items.
get GET  /teamdrives/teamDriveId Gets a Team Drive's metadata by ID.
list GET  /teamdrives Lists the user's Team Drives.
update PATCH  /teamdrives/teamDriveId Updates a Team Drive's metadata

发送以下问题的反馈:

此网页
Drive REST API
Drive REST API