Changes

stoney core: REST API

326 bytes added, 10:43, 11 December 2013
/* Pagination */
=== Pagination ===
Responses with multiple items will be '''limited and paginated to 30 items''' per default(defined on server-side). Further items can be accessed by appending the <code>page</code> query parameter. The number of items to be returned can be '''raised to a maximum of 100'''(defined on server-side), by specifying the <code>per_page</code> query parameter.
For example, to request page number 3 with 40 items per page, a client would send the following GET request:
</pre>
The If pagination is requested by the client and/or enforced by the server (e.g. if the number of available records is larger than the default count), the service returns [http://tools.ietf.org/html/rfc5988#section-6.2.2 official registered link relation types] (<code>next</code>, <code>prev</code>, <code>first</code>, <code>last</code>) within the HTTP [http://tools.ietf.org/html/rfc5988#section-5 Link header field] for pagination use:
<pre>
Link: <https://api.example.com/v1/users?page=1&per_page=40>; rel="first",
The client MUST use those pagination links, rather than constructing the URLs by itself.
 
Furthermore the service sets a custom header <code>X-Total-Count</code> containing the (estimation of) total number of records.
=== Field specifications and limitations ===
Bureaucrat, administrator
425
edits