Method: changes.list

列出使用者或共用雲端硬碟的異動。

HTTP 要求

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

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

查詢參數

參數
driveId

string

要傳回變更的共用雲端硬碟。如果指定變更 ID,系統會將變更 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

要包含在回應的 labelInfo 部分中的標籤 ID 清單 (以半形逗號分隔)。

要求主體

要求主體必須為空白。

回應主體

使用者的變更清單。

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

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

用於日後變更的起始頁面符記。只有在目前變更清單已屆滿時,才會出現這個 ID。

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

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