list endpoints.
Currently, we support pagination for access codes, access system users,
Connect Webviews, connected accounts, and devices.
limit and page_cursor parameters, along with the pagination response object. The pagination object provides the following information:
| Property | Type | Description |
|---|---|---|
next_page_cursor | String | Opaque value that you use to select the next page of results through the
page_cursor parameter. |
has_next_page | Boolean | Indicates whether there is another page of results after this one. |
next_page_url | String (URI) | URL to get the next page of results. |
SeamPaginator in the Seam JavaScript and Python SDKs and Paginator in the Seam PHP and Ruby SDKs.
The following examples show you how to use pagination in a variety of scenarios:
Manually Fetch Pages
You can specify the number of records per page and the desired page of results. The firstlist request returns the first set of records, as well as the pagination object. If pagination.has_next_page is true, you can request an additional page of records. For all list requests after the first, use the pagination.next_page_cursor as the value for the page_cursor parameter.
The following example gets the first page of 20 devices and then the second page of 20 devices:
- JavaScript
- cURL
- Python
- Ruby
- PHP
- C#
Code:Output:
Resume Pagination
You can get the first page on initial load, store the state, and then get the next page at a later time using the stored state. The following example gets the first page of 20 records from the list of devices and, later, gets the next page of 20 devices:- JavaScript
- cURL
- Python
- Ruby
- PHP
- C#
Code:Output:
Iterate Over All Pages
You can iterate over all pages of records. The following example uses a loop to get all pages of records for a list of 65 devices, at 20 records per page:- JavaScript
- cURL
- Python
- Ruby
- PHP
- C#
Code:Output:
Iterate Over All Resources
You can iterate over all resources within all pages. The following example uses a loop to get all records for a list of devices, at 20 records per page, and then prints out the device ID for each record:- JavaScript
- cURL
- Python
- Ruby
- PHP
- C#
Code:Output:
Return All Resources Across All Pages as an Array
You can iterate over all resources within all pages and return a single array or list. The following example returns an array containing all devices:- JavaScript
- cURL
- Python
- Ruby
- PHP
- C#
Code:Output: