Method: children.list

列出資料夾的子項。

HTTP 要求

GET https://www.googleapis.com/drive/v2/files/{folderId}/children

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

路徑參數

參數
folderId

string

資料夾的 ID。

查詢參數

參數
maxResults

integer

要傳回的子項數量上限。

orderBy

string

以逗號分隔的排序鍵清單。有效的金鑰包括 createdDatefolderlastViewedByMeDatemodifiedByMeDatemodifiedDatequotaBytesUsedrecencysharedWithMeDatestarredtitle。每個鍵都會預設為遞增排序,但可以使用 desc 修飾符反向排序。使用範例:?orderBy=folder,modifiedDate desc,title。請注意,目前對使用者有大約 100 萬個檔案設有略過要求排列順序的限制。

pageToken

string

子項的頁面權杖。

q

string

用於搜尋子項的查詢字串。

要求主體

要求主體必須為空白。

回應主體

這是檔案的子項清單。

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

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

string

下一頁子項的頁面權杖。如果已達子項清單的結尾,則不會顯示這個屬性。如果權杖因任何原因遭拒,則應捨棄權杖,且應從結果的第一頁重新開始分頁。

kind

string

一律為 drive#childList

etag

string

清單的 ETag。

items[]

object (ChildReference)

子項清單。如果填入 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.metadata
  • https://www.googleapis.com/auth/drive.metadata.readonly
  • https://www.googleapis.com/auth/drive.photos.readonly
  • https://www.googleapis.com/auth/drive.readonly

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