เลื่อนดูรายการทรัพยากร
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คุณควบคุมจำนวนสูงสุดของทรัพยากรที่เซิร์ฟเวอร์แสดงใน
การตอบกลับคำขอรายการได้โดยการตั้งค่าฟิลด์ maxResults
นอกจากนี้
สําหรับคอลเล็กชันบางรายการ (เช่น เหตุการณ์) จะมีขีดจํากัดที่แน่นอนเกี่ยวกับจํานวน
รายการที่ดึงข้อมูลซึ่งเซิร์ฟเวอร์จะไม่เกิน หากจำนวนเหตุการณ์ทั้งหมดเกินขีดจำกัดสูงสุดนี้ เซิร์ฟเวอร์จะแสดงผลลัพธ์ 1 หน้า
โปรดทราบว่า 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 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"]]