Pagination

An HTTP API/IP response to the GET method may support pagination to handle large data volumes if specified as a requirement for the integration point. Additional information must be supplied along with URI regarding the "offset" and "limit":

  • "offset: Specifies the n^th ^resource as starting point for retrieval. "offset" starts with 0.

  • "limit: Specifies the maximum number of resources to be returned in one go.

By default, "offset" is set to 0 and "limit" is set at 50. So if only the URI is specified, the first 50 resources will be returned in the response along with the links "next" and "prev" as applicable

Example URI to fetch next 50 resources (51-100), that match the search criteria.

<URI>?offset=50&&limit=50

When pagination is used, the response indicates which subset is retrieved:

{
   "offset" : "0",
   "count" : "8",
   "hasMore" : false
   "limit" : "200"
...
}
  1. "offset" is the value for the "offset" parameter used in the request (the supplied value or the default value).

  2. "count" is the number of resources included in the response.

  3. "hasMore": true when a next set exists, false otherwise.

  4. "limit" is the value for the "limit" parameter used in the request (the supplied value or the default value).

Retrieving a next or previous set of resources can be done by following the links included in the response:

   "links" : [ {
      "rel" : "prev",
      "href" : "<URI>?offset=0&&limit=50",
   }, {
      "rel" : "next",
      "href" : "<URI>?offset=100&&limit=50",
   } ]

Those links are only present if there is a previous or next set respectively.