Starting in version
0.49, some of the endpoints support the query parameters
sort. However, the defaults are different per server due to configuration settings.
offset - number of items to "skip" in the query, is zero based so it starts off at
0 being the first item.
count - the number of items to "get" in the query, is one based so to get only one you would pass in
1. If you want to get all of the records, then pass in
0 but this will only work if the setting (see below) allows it.
sort - specify the order in which the results should be returned. Sort hash uses attribute name for key and value of
1 for asc,
-1 for desc.
These are the settings for the REST API which relate to the offset and count. If you need to change them, go to
Administration -> General -> REST API.
API_Default_Count (Default Count) - Defines the default
count for when the parameter is not provided
API_Upper_Count_Limit (Max Record Amount) - Defines ceiling for the
count and this value will be set if the
count is higher
API_Allow_Infinite_Count (Allow Getting Everything) - Determines whether
0 can be passed into the
count to allow getting all of the records.
To limit the results to 5 items and to get the third "page", you would provide
To sort by name descending, and status ascending, you would provide