Pagination

Looping pages

To all suitable GET methods, we have added pagination. This will increase performance when receiving large chunks of data. Some more technical info:

  • Standard objects/page: 50
  • Max objects/page: 1000

In order to loop through pages there's a few options for you:

  • Use the response header named "Link". It contains a link to the next page and also a link to the last page.
  • You can specify query string parameters. There are two parameters available, page and pagesize. Here's an example of how it can look like in the URL: v2/articles?$page=2&$pagesize=100

Paginated Response

The response object looks a bit different when making a request towards a paginated endpoint. It contains a Meta object and a Data object.

The Meta object consists of a few properties:

  • CurrentPage
  • PageSize
  • TotalNumberOfPages
  • TotalNumberOfResults
  • ServerTimeUtc

The Data object is a array of the requested data objects.

Here's an example of a paginated response:

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
     "Meta": {
        "CurrentPage": 1,
        "PageSize": 50,
        "TotalNumberOfPages": 22,
        "TotalNumberOfResults": 1100,
        "ServerTimeUtc": "2018-03-05T15:14:04.0225761Z"
    },
    "Data": [
    	{...}
    ]
}