Method: files.generateIds

產生可在插入或複製要求中提供的一組檔案 ID。

HTTP 要求

GET https://www.googleapis.com/drive/v2/files/generateIds

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

查詢參數

參數
maxResults

integer

要傳回的 ID 數量上限。

space

string

可用來建立新檔案的 ID 空間。支援的值為 driveappDataFolder。(預設值:drive)

type

string

可用於 ID 的項目類型。支援的值為 filesshortcuts。請注意,shortcuts 僅支援 drive space。(預設值:files)

要求主體

要求主體必須為空白。

回應主體

可在插入要求中提供的產生 ID 清單

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

JSON 表示法
{
  "ids": [
    string
  ],
  "space": string,
  "kind": string
}
欄位
ids[]

string

在指定空間中為要求使用者產生的 ID。

space

string

可使用這些 ID 建立的檔案類型。

kind

string

這個值一律為 drive#generatedIds

授權範圍

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

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