Method: changes.list

列出使用者或共用雲端硬碟的變更。

HTTP 要求

GET https://www.googleapis.com/drive/v2/changes

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

查詢參數

參數
driveId

string

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

includeCorpusRemovals

boolean

如果使用者在要求時仍可存取檔案,即使檔案已從變更清單中移除,且不會有任何其他變更項目,變更是否應納入檔案資源。

includeDeleted

boolean

是否要納入變更,指出項目已從變更清單中移除,例如遭到刪除或失去存取權。

includeItemsFromAllDrives

boolean

是否要將「我的雲端硬碟」和共用雲端硬碟的項目納入搜尋結果。

includeSubscribed

boolean

是否要在結果中納入「我的雲端硬碟」階層以外的變更。如果設為 false,系統就不會將檔案的變更納入結果,例如應用程式資料資料夾中的檔案,或是尚未新增至「我的雲端硬碟」的共用檔案。

includeTeamDriveItems
(deprecated)

boolean

已淘汰:請改用 includeItemsFromAllDrives

maxResults

integer

要傳回的變更次數上限。

pageToken

string

用於在下一頁繼續先前列出要求的符記。這個值應設為先前回應中的 nextPageToken 值,或 getStartPageToken 方法的回應。

spaces

string

以半形逗號分隔的查詢空間清單。支援的值為 driveappDataFolderphotos

startChangeId
(deprecated)

string (int64 format)

已淘汰:請改用 pageToken

supportsAllDrives

boolean

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

supportsTeamDrives
(deprecated)

boolean

已淘汰:請改用 supportsAllDrives

teamDriveId
(deprecated)

string

已淘汰:請改用 driveId

includePermissionsForView

string

指定要納入回應的其他檢視畫面權限。系統僅支援 published

includeLabels

string

以半形逗號分隔的標籤 ID 清單,用於納入回應的 labelInfo 部分。

要求主體

要求主體必須為空白。

回應主體

使用者的變更清單。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{
  "largestChangeId": string,
  "nextPageToken": string,
  "kind": string,
  "etag": string,
  "newStartPageToken": string,
  "selfLink": string,
  "nextLink": string,
  "items": [
    {
      object (Change)
    }
  ]
}
欄位
largestChangeId

string (int64 format)

目前最大的變更 ID。

nextPageToken

string

下一頁變更的頁面符記。如果已到達變更清單的結尾,則不會出現這個值。如果符記因任何原因遭到拒絕,則應將其捨棄,並從第一頁結果重新開始分頁。

kind

string

這個值一律為 drive#changeList

etag

string

清單的 ETag。

newStartPageToken

string

用於日後變更的起始網頁符記。只有在已達到目前變更清單的結尾時,才會顯示這個值。

items[]

object (Change)

變更清單。如果填入 nextPageToken,則這份清單可能不完整,因此應擷取其他結果頁面。

授權範圍

需要下列其中一種 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.meet.readonly
  • 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

部分權限受限制,應用程式必須通過安全性評估才能使用。詳情請參閱授權指南