Sometimes, API calls return a large number of results. Our pagination component, allows you to easily handle results. Modzy has pagination available for all collection routes.
Modzy provides the option to manage results by adding the pagination component to the URL of a request and setting the values accordingly.
By default, the component is built to provide 10 records per page, starting at page 1. But you can adjust this preset.
To set a limit of records per page, use the per-page parameter with a value that matches the number of records you need.
GET /api/accounting/users?per-page=5 HTTP/1.1
The number of records returned per page. Defaults to 10.
To see another page, perform a new call adding the page parameter with a value that matches the page number you want to see.
GET /api/accounting/users?page=2&per-page=5 HTTP/1.1
The page number to be returned. Defaults to 0.
Modzy has an option to order and sort records. If you want to see the results in a specific way, you can add the
direction parameters to the header, and set them accordingly.
When more than one sort parameter is provided, the pagination component initially sorts by the first parameter, next by the second parameter, and so on. Parameter values are available for list routes and described on each route's topic.
Separate query values with a
, to sort-by multiple values.
GET /api/models/all/versions/all?sort-by=processing.minimumParallelCapacity,processing.maximumParallelCapacity HTTP/1.1
Orders the records in ascending
ASC or descending
DESC order. It defaults to