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

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