Collection Pagination

Overview

Most collection resources need some kind of pagination. Without it, a simple search could return millions of records, bringing your network to a crawl. So, instead of receiving all the records of a collection resource, you can limit the number of records that are displayed on a page in the REST client response.

ClosedURL Format for Collection Resource Parameters

Pagination Request Parameters

To limit the number of records returned, set the following parameters in the request payload:

Request Parameters Description

limit

Used to specify the paging size, up to 1000. If no limit is specified or if a limit greater than 1000 is specified, a pagination limit of 1000 will be used.

offset

Used to specify the starting point from which the resources are returned.
This parameter is usually used in conjunction with limit to obtain the next set of record.

Notes:

  • When limit=1, the offset parameter is ignored in the query specifications.
  • When you specify the limit and offset parameters, the paginated result isn't ordered. If you update the collection resource between paging requests, the records displayed in each page may vary.

totalResults

Used to set to true to include the total number of search records that match the query.
The default value is 'false', which will not include the total count of search records.

Notes:

  • This parameter is only effective when limit or offset are specified
  • If totalResults is not specified, the total count of records will not be included in the response.

Example Requests

Pagination Response Parameters

The following pagination fields are returned in the response payload:

Request Parameters Description

count

The number of records included in the response.

hasMore

Indicates if there are more records to be returned from the collection.

  • Set to 'true' when there are more records to be returned.
  • Set to 'false' when this is the last set of records retrieved.

totalResults

The total number of records in the collection

Related Topics

Related Topics Link IconSee Also