Filtering and paging
If "collection": [] is in the response JSON, then it is an enumeration of items. Collections can be large, and you might want to filter out some results, or limit the number of results in each response or get a specific range (also called "paging"). To do this, each URL in the REST API may support URL parameters, JSON attributes, or both.
For example, a GET request to the URL:
https://HOST_OR_IP/api/v1/CameraStatus
returns a list of all cameras, but a request with this URL parameter (shown in bold typeface):
https://HOST_OR_IP/api/v1/CameraStatus?showInactiveCamera=0
returns a filtered list of only active cameras, and:
https://HOST_OR_IP/api/v1/CameraStatus?showInactiveCamera=1
returns a list of only inactive cameras.
Other URLs let you use JSON attributes in the request to specify which item number to start with, and how many to include in the response:
{
startIndex: 10,
pageSize: 20
}
Responses indicate either that you have downloaded all items in the collection:
{
"nextPage": false
}
or more items still exist, and how many of them were in the response:
{
"nextPage": true,
"totalRemoteCount": 100,
"subCount": 20,
"remoteSorting": true
}
To get more of the items in the collection, make another request with a different startIndex, depending on which page of data you want to get.