How to use pagination

Many of the endpoints are paged. This means that sequential requests are required, each one specifying a different page number, to retrieve all the available data. Pagination ensures that the volume of the data returned in the response does not overwhelm the Sesame Data servers, or your own servers.

Sending a request without pagination will cause partial data to be retrieved.

Sesame Data pagination endpoints are Zero index-based, which means the first page is 0 and the second page is 1.

While doing an integration, users will need to use the below metadata fields to ensure that all elements in the response are retrieved:

  • totalElements: The total number of items in the response

  • size: The number of records per page of the response

Alternatively, it's possible to wrap the calls inside a While loop that keep requesting pages until the parameter last is equals to true.

{
   "content": [ /*DATA HERE*/ ]
   "totalPages": 3,
   "totalElements": 270,
   "last": false,
   "size": 100,
   "first": true,
   "number": 0,
   "numberOfElements": 100,
   "empty": false
}

Last updated