Pagination & Sorting
Pagination
To paginate through a list of objects, you can configure the following parameters:
- page size: Defines the number of objects to be returned on a single page. The default value is 10.
- page number: Specifies the page number to retrieve. The default is page 1.
When making an API call, include the parameters page[size] and page[number] to set the above values.
Example: To retrieve the third page with 10 objects per page, use: ?page[size]=10&page[number]=3.
Sorting
You can also sort the list of objects using the following parameter:
- sort: Orders the list in ascending or descending order. Use
+createdAtfor ascending orcreatedAtfor descending, where+signifies ascending and-signifies descending. When making the request, it is expected that the + character is URL-encoded as %2B, e.g.?sort=%2BcreatedAt, since an unencoded+will be interpreted as a space in URL query strings.
Include the sort parameter in your API call to apply sorting.
Example: To sort the list by creation date in ascending order, use: ?sort=%2BcreatedAt.
Updated 7 months ago
