Content API

Pagination

Whenever you request a list of objects you will receive a paginated response.

There will be a top level data key that contains the objects you have requested, and then links and meta keys containing the pagination information.


Paginated response

The whole response will look a little something like this:

{
  "data": [
    ...
  ],
  "links": {
    "first": null,
    "last": null,
    "prev": "https://app.contento.io/api/v1/content?cursor=eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjpmYWxzZX0",
    "next": "https://app.contento.io/api/v1/content?cursor=eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ"
  },
  "meta": {
    "path": "https://app.contento.io/api/v1/content",
    "per_page": 20,
    "next_cursor": "eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
    "prev_cursor": "eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjpmYWxzZX0"
  }
}

Provides an interface for quickly getting the previous or next request in the paginated set. URLs will have their cursor parameter set to the correct value and any other parameters that are present in the request will remain in place.

AttributeTypeDescription
firstnullNot in use.
lastnullNot in use.
prevString or nullURL for the previous request in the paginated set.
nextString or nullURL for the next request in the paginated set.

Example:

{
  "first": null,
  "last": null,
  "prev": "https://app.contento.io/api/v1/content?cursor=eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjpmYWxzZX0",
  "next": "https://app.contento.io/api/v1/content?cursor=eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ"
}

Meta

Details of the pagination configuration for this request.

AttributeTypeDescription
pathStringThe base URI path of the API endpoint being requested.
per_pageIntegerSet to the value of the limit parameter on the request.
next_cursorString or nullCursor value for the next request in the paginated set.
prev_cursorString or nullCursor value for the previous request in the paginated set.

Example:

{
  "path": "https://app.contento.io/api/v1/content",
  "per_page": 20,
  "next_cursor": "eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjp0cnVlfQ",
  "prev_cursor": "eyJwdWJsaXNoZWRfYXQiOiIyMDIyLTA2LTA3IDExOjU0OjI5IiwiX3BvaW50c1RvTmV4dEl0ZW1zIjpmYWxzZX0"
}
Previous
Authentication