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

要加入回應 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

供日後變更的起始網頁權杖。只有在目前變更清單結束時才會顯示此選項。

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

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