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"
}
}
Links
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.
Attribute | Type | Description |
---|---|---|
first | null | Not in use. |
last | null | Not in use. |
prev | String or null | URL for the previous request in the paginated set. |
next | String or null | URL 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.
Attribute | Type | Description |
---|---|---|
path | String | The base URI path of the API endpoint being requested. |
per_page | Integer | Set to the value of the limit parameter on the request. |
next_cursor | String or null | Cursor value for the next request in the paginated set. |
prev_cursor | String or null | Cursor 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"
}