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.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

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