Method: revisions.list

列出檔案的修訂版本。

HTTP 要求

GET https://www.googleapis.com/drive/v2/files/{fileId}/revisions

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

路徑參數

參數
fileId

string

檔案的 ID。

查詢參數

參數
maxResults

integer

要傳回的修訂版本數量上限。

pageToken

string

修訂版本的頁面符記。若要取得結果的下一頁,請將此參數設為前一個回應的「nextPageToken」值。

要求主體

要求主體必須為空白。

回應主體

檔案修訂版本清單。

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

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

string

下一頁修訂版本的頁面符記。如果修訂版本清單的結尾已達修訂版本清單的結尾,就不會顯示這個欄位。如果權杖因任何原因而遭拒,請捨棄權杖,並在結果第一頁重新開始分頁。

kind

string

一律為 drive#revisionList

etag

string

清單的 ETag。

items[]

object (Revision)

修訂版本清單。如果已填入 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.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

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