リソースの一覧を順番に確認する
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
maxResults
フィールドを設定することで、リスト リクエストに対するレスポンスでサーバーが返すリソースの最大数を制御できます。また、一部のコレクション(Events など)では、サーバーが取得するエントリ数に上限が設定されており、この上限を超えることはありません。イベントの総数がこの最大値を超えると、サーバーは結果の 1 ページを返します。
maxResults
は 1 ページの結果数を保証するものではありません。不完全な結果は、結果の nextPageToken
フィールドが空でない場合に検出できます。次のページを取得するには、前と同じリクエストを実行し、前のページの nextPageToken
の値を持つ pageToken
フィールドを追加します。すべての結果が取得されるまで、次のページに新しい 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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[],[],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"]]