Pagination
APIs with larger collection payloads must support pagination to mitigate the increasing lookup time and size of the responses.
Swift supports two pagination types: offset/limit and cursor/limit
- Offset - Defines the moving 'window' of results to return relative to the start of the collection.
- Cursor - opaque keys (cursors) passed to get the next results.
- Limit - The maximum number of items to return in a page. If unspecified, the default limit will be returned. If the limit specified is greater than the maximum permitted by the API, then the API will return the maximum permitted limit.
Pagination is requested by a client through query parameters and represented as a JSON object.
When returning paginated results, a service should support JSON formatted responses based on the standard template with the following fields:
- first: The link for the first page of resources
- next: The link for the next page of resources
- previous: The link for the previous page of resources
- last: The link for the last page of resources
| Offset/Limit | Cursor/Limit | |
|---|---|---|
| Advantages |
|
|
| Drawbacks |
|
Previous page Rate Limit
Next pageError Codes