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。請注意,只有 drive space 支援 shortcuts。(預設值: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

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