浏览资源列表
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以通过设置 maxResults
字段来控制服务器在对列表请求的响应中返回的最大资源数量。此外,对于某些集合(例如“事件”),检索到的条目数量存在硬性限制,服务器永远不会超过此限制。如果事件总数超过此上限,服务器将返回一页结果。
请注意,maxResults
并不保证一页上的结果数量。
如果结果中包含非空的 nextPageToken
字段,则表示结果不完整。如需检索下一页,请执行与之前完全相同的请求,并附加一个 pageToken
字段,其值为上一页中的 nextPageToken
。在后续页面上,系统会提供新的 nextPageToken
,直到检索到所有结果。
例如,以下查询后跟用于检索分页列表中的下一页结果的查询:
GET /calendars/primary/events?maxResults=10&singleEvents=true
//Result contains
"nextPageToken":"CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA",
后续查询会从 nextPageToken
中获取值,并将其作为 pageToken
的值提交:
GET /calendars/primary/events?maxResults=10&singleEvents=true&pageToken=CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[],[],null,["# Page through lists of resources\n\nYou can control the maximum number of resources the server returns in the\nresponse to a list request by setting the `maxResults` field. Furthermore,\nfor some collections (such as Events) there is a hard limit on the number of\nretrieved entries that the server will never exceed. If the total number of\nevents exceeds this maximum, the server returns one page of results.\n\nRemember that `maxResults` does not guarantee the number of results on one page.\nIncomplete results can be detected by a non-empty `nextPageToken` field in\nthe result. In order to retrieve the next page, perform the exact same request\nas previously and append a `pageToken` field with the value of\n`nextPageToken` from the previous page. A new `nextPageToken` is provided\non the following pages until all the results are retrieved.\n\nFor example, here is a query followed by the query for retrieving the\nnext page of results in a paginated list: \n\n GET /calendars/primary/events?maxResults=10&singleEvents=true\n\n //Result contains\n\n \"nextPageToken\":\"CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA\",\n\nThe subsequent query takes the value from `nextPageToken` and\nsubmits it as the value for `pageToken`: \n\n GET /calendars/primary/events?maxResults=10&singleEvents=true&pageToken=CiAKGjBpNDd2Nmp2Zml2cXRwYjBpOXA"]]