Learn how to get paginated results from REST API queries made in the Wowza Video™ service.
The Wowza Video REST API allows you to retrieve a paginated view of results from any GET request made to the following endpoints:
/assets/live_streams/players/recordings/schedules/stream_sources/stream_targets/transcoders/vod_streams
You can use the following sample request, making sure to:
- Set the
pageandper_pagequery parameters to the page of the results that should be displayed and how many records should be included in a page.
curl -X GET \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/live_streams/?page=1&per_page=25"The response includes a paginated list of live streams that shows 25 streams per page. The first page of results will display the 25 oldest streams.
{
"live_streams": [
{
"id": "rtL9S9mf",
"name": "My Live Stream",
"created_at": "2020-03-23T17:40:34.000Z",
"updated_at": "2020-03-25T01:16:12.000Z"
},
...
],
"pagination": {
"payload_version": 1.0,
"total_records": 541,
"page": 1,
"per_page": 25,
"total_pages": 22,
"page_first_index": 0,
"page_last_index": 24
}
}Slightly different parameters are required when querying the usage/stream_targets and usage/vod_streams endpoints.
The workflow described in this section is only valid for v1.5 of the REST API and later.
You can use the following sample request, making sure to:
- Set the
pageandper_pagequery parameters to the page of the results that should be displayed and how many records should be included in a page.
curl -X GET \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/usage/stream_targets?next_page_key=1lk0syln&per_page=10"The response includes a paginated list of stream targets that shows 10 stream targets per page.
{
"stream_targets": [
{
"id": "1bwvmtlv",
"name": "My Stream Target",
"archived": false,
"type": "fastly",
"unique_viewers": 0,
"viewing_seconds": 0,
"avg_viewing_seconds": 0,
"viewing_bytes": 2547
},
...
],
"pagination": {
"payload_version": 2.0,
"total_records": 269,
"next_page_key": "2jj8syfl",
"per_page": 10,
"total_pages": 27
}
}