با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
با تنظیم فیلد 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
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 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"]]