Pagination in API
Requests that return multiple items will be paginated to 50 items by default.
You can specify further pages with the page
parameter. You can also set a custom page size up to 250 with the per_page
parameter (default value is 50). Example:
http://helloworld.voog.co/admin/api/pages?page=1&per_page=50
Every response that includes paginated items are including also detailed info about pagination in response header. The pagination info is included in the Link header.
Example value for Link
header (NB! actual value does not include line brakes):
Link: <http://helloworld.voog.co/admin/api/pages?page=1&q.language.id=1>; rel="first",
<http://helloworld.voog.co/admin/api/pages?page=2&q.language.id=1>; rel="next",
<http://helloworld.voog.co/admin/api/pages?page=2&q.language.id=1>; rel="last"
The possible rel
values are:
next
- shows the URL of the immediate next page of results.last
- shows the URL of the last page of results.first
- shows the URL of the first page of results.prev
- shows the URL of the immediate previous page of results.
The response includes also additional information about pagination like total entries and total pages.
Example headers:
X-Total-Entries: 60
X-Total-Pages: 2