Method: changes.watch

为用户订阅更改。

HTTP 请求

POST https://www.googleapis.com/drive/v2/changes/watch

网址采用 gRPC 转码语法。

查询参数

参数
driveId

string

要返回更改的共享云端硬盘。如果指定,则更改 ID 会反映共享云端硬盘;请使用合并后的云端硬盘 ID 和更改 ID 作为标识符。

includeCorpusRemovals

boolean

在提出请求时用户仍可访问相应文件(即使某个文件已从更改列表中移除,且此文件不再有对应的更改条目),更改是否应包含文件资源。

includeDeleted

boolean

是否包含更改,以指明相关项目已从更改列表中移除,例如已删除或失去访问权限。

includeItemsFromAllDrives

boolean

“我的云端硬盘”和共享云端硬盘内容是否应该包含在结果中。

includeSubscribed

boolean

是否将“我的云端硬盘”层次结构之外的更改纳入到结果中。如果此政策设为 false,系统会从结果中省略对“Application Data”文件夹中的文件或未添加到“我的云端硬盘”的共享文件等更改。

includeTeamDriveItems
(deprecated)

boolean

已废弃:请改用 includeItemsFromAllDrives

maxResults

integer

要返回的更改数上限。

pageToken

string

用于继续下一页面中的上一个列表请求的令牌。此值应设为上一个响应或 getStartPageToken 方法中的响应的 nextPageToken 值。

spaces

string

要查询的空格的逗号分隔列表。支持的值包括 driveappDataFolderphotos

startChangeId
(deprecated)

string (int64 format)

已废弃:请改用 pageToken

supportsAllDrives

boolean

发出请求的应用是否同时支持“我的云端硬盘”和共享云端硬盘。

supportsTeamDrives
(deprecated)

boolean

已废弃:请改用 supportsAllDrives

teamDriveId
(deprecated)

string

已废弃:请改用 driveId

includePermissionsForView

string

指定要包含在响应中的其他视图权限。仅支持 published

includeLabels

string

以英文逗号分隔的 labelInfo 部分所含标签的 ID 列表。

请求正文

请求正文包含一个 Channel 实例。

响应正文

如果成功,则响应正文包含一个 Channel 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/docs
  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.appdata
  • https://www.googleapis.com/auth/drive.apps.readonly
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.metadata
  • https://www.googleapis.com/auth/drive.metadata.readonly
  • https://www.googleapis.com/auth/drive.photos.readonly
  • https://www.googleapis.com/auth/drive.readonly

某些范围受到限制,您的应用必须接受安全评估才能使用这些范围。有关详情,请参阅授权指南