When querying for multiple instances of a particular content type, you can supply the page
parameter in order to paginate the response.
The page parameter accepts two attributes, these are limit
and skip
. Providing one or both of these enables you to ‘page’ through your content.
The value of limit must be an integer between 0 and 100, and has a default value of 20.
The following example will retrieve 10 books while skipping the first 5:
curl https://{SPACE_ID}.spaces.lexascms.com/delivery/jsonapi/book?page[limit]=10&page[skip]=5 \
-H 'Content-Type: application/vnd.api+json'
The page
parameter can also be used to paginate relationship data.
Taking the previous example, if the book
content type had a relationship field called reviews
, the following example would return 10 books, with each book containing 5 reviews.
curl https://{SPACE_ID}.spaces.lexascms.com/delivery/jsonapi/book?page[limit]=10&page[reviews][limit]=5 \
-H 'Content-Type: application/vnd.api+json'
© 2022 Status200 Ltd.