Offset and Count Information
Starting in version 0.49, some of the endpoints support the query parameters offset, count and sort.
However, the defaults are different per server due to configuration settings.
Query Parameter Information
offset- number of items to “skip” in the query, is zero based so it starts off at0being the first item.count- the amount of items to “get” in the query, is one based so to get only one you would pass in1. If you want to get all of the records, then pass in0but 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 of1for asc,-1for desc.
Settings
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 defaultcountfor when the parameter is not providedAPI_Upper_Count_Limit(Max Record Amount) - Defines ceiling for thecountand this value will be set if thecountis higherAPI_Allow_Infinite_Count(Allow Getting Everything) - Determines whether0can be passed into thecountto allow getting all of the records.
Example
To limit the results to 5 items and to get the third “page”, you would provide count=5 and offset=10.
http://localhost:3000/api/v1/channels.list?count=5&offset=10
To sort by name descending, and status ascending, you would provide sort={"name":-1,"status":1}
http://localhost:3000/api/v1/users.list?sort={"name":-1,"status":1}