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。請注意,如果使用者擁有約一百萬個檔案,系統目前會忽略要求的排序順序。

pageToken

string

兒童的網頁權杖。

q

string

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

要求主體

要求主體必須為空白。

回應主體

檔案的子項清單。

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

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

object (ChildReference)

孩子清單。如果已填入 nextPageToken,則這個清單可能不完整,應擷取其他結果頁面。

nextPageToken

string

下一頁子項的頁面符記。如果已到達子項清單結尾,則不會顯示這個項目。如果系統基於任何原因拒絕符記,就應捨棄該符記,並從第一頁結果重新開始分頁。

kind

string

這個值一律為 drive#childList

etag

string

清單的 ETag。

授權範圍

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

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