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,modifyDate 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

某些范围受到限制,您的应用必须接受安全评估才能使用这些范围。有关详情,请参阅授权指南