Method: files.generateIds

產生一組檔案 ID,可在建立或複製要求中提供。

HTTP 要求

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

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

查詢參數

參數
count

integer

要傳回的 ID 數量。

space

string

可用來建立新檔案的 ID 空間。支援的值為「drive」和「appDataFolder」。(預設值:'drive')

type

string

可用於 ID 的項目類型。支援的值為「files」和「shortcuts」。請注意,系統僅支援 drive 的「空間」中的「捷徑」。(預設值:'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/drive
  • https://www.googleapis.com/auth/drive.appdata
  • https://www.googleapis.com/auth/drive.file

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