Data and Paging Attributes
All APIs are expected to wrap their resource and collection data in a data
attribute. Resources have a single object under data, and collections have an array of objects.
Collections are paged and have a paging
attribute in the response, in addition to data. When there is more paged data available, a next
attribute is present on paging with a link to the next data set. If no more data is available, the next attribute is not part of the paging response. Alternatively, page
and pageSize
parameters can be used to access paged data. For example, GET /apis/assets?page=2&pageSize=100
tries and fetch videos (assets
) 101-200 from the collection.
For example:
{ "data": [ { "title": "InfoDevSession - 18/03/2014, 15:06", "description": "API Test", "active": false, "id": "3bc946a6-6720-41c0-8246-55e8119d1a5a", "ctime": 1401997809, "mtime": 1402002014, "tag": null, "duration": 60.34700000000001, "recording": false, "trimming": false, "importing": false, "movieTrackCount": 1 } ], "paging": { "results": 3, "pageSize": 1, "next": "https:/calypso.example.com/apis/assets?page=2&pageSize=1" } } |
Note
Many collections limit the maximum pageSize
that can be used to 100. Requests that use a larger pageSize
are automatically adjusted to the maximum value and the change is reflected in the paging properties returned in the API response.
This affects the main GET request on the collection (for example, GET /asset
) on the following APIs: Assets, Sessions, Sources, Sections, Distribution Policies, EPG Schedules, Exports, Gateways, Groups, Schedules, Users.