Method: changes.watch

訂閱使用者的變更。

HTTP 要求

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

這個網址使用 gRPC 轉碼語法。

查詢參數

參數
driveId

string

要傳回變更的共用雲端硬碟。如果指定變更 ID 會反映共用雲端硬碟,請使用合併雲端硬碟 ID 和變更 ID 做為 ID。

includeCorpusRemovals

boolean

如果在要求存取期間,使用者仍可存取檔案,即使變更已從變更清單移除,該檔案也不會有其他變更項目,所以變更是否應該包含檔案資源。

includeItemsFromAllDrives

boolean

結果是否應包含「我的雲端硬碟」和共用雲端硬碟項目。

includeRemoved

boolean

是否要包含表示變更已從清單中移除,例如刪除或失去存取權。

includeTeamDriveItems
(deprecated)

boolean

已淘汰:請改用 includeItemsFromAllDrives

pageSize

integer

每頁傳回的變更數量上限。

pageToken

string

接續下一頁要求清單要求的下一頁。這個參數應設為前一個回應中的「nextPageToken」值,或是來自 getStartPageToken 方法的回應。

restrictToMyDrive

boolean

是否將結果限制在「我的雲端硬碟」階層中。系統會略過檔案變更,例如「應用程式資料」資料夾中的檔案,或未新增至「我的雲端硬碟」的共用檔案。

spaces

string

要在主體中查詢的空格清單 (以半形逗號分隔)。支援的值為「drive」和「appDataFolder」。

supportsAllDrives

boolean

提出要求的應用程式是否支援「我的雲端硬碟」和共用雲端硬碟。

supportsTeamDrives
(deprecated)

boolean

已淘汰:請改用 supportsAllDrives

teamDriveId
(deprecated)

string

已淘汰:請改用 driveId

includePermissionsForView

string

指定要在回應中包含哪些額外檢視畫面的權限。僅支援「已發布」。

includeLabels

string

以半形逗號分隔的清單,包含要在回應的 labelInfo 部分加入的標籤。

要求主體

要求主體包含 Channel 的例項。

回應主體

如果成功,回應主體會包含 Channel 的執行例項。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.appdata
  • 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

部分範圍會受到限制,而且需要應用程式接受安全性評估才能使用這些範圍。詳情請參閱授權指南