Method: changes.watch

訂閱使用者的變更。

HTTP 要求

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

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

查詢參數

參數
driveId

string

要傳回變更的共用雲端硬碟。如果指定變更 ID,系統會將變更 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 部分中的標籤 ID 清單 (以半形逗號分隔)。

要求主體

要求主體包含 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

部分範圍受到限制,應用程式必須進行安全性評估,才能使用這些範圍。詳情請參閱授權指南