Learn how to get filtered results from REST API queries made in the Wowza Streaming Cloud™ service.
Using the filter parameter Example requests
Using the filter parameter
To execute a request that returns filtered results, use the filter parameter in the query. The filter parameter restricts the data that gets returned to one or more values associated with a field.
You can use the filter parameter with any GET call to the transcoders endpoint:
To use the filter parameter, append the query URL with a two-part expression that specifies the field on which to filter and the logic (comparison operator) to use to filter. Use the syntax
n is a zero-based index.
You can use as many filters as you want, combining them with an ampersand (&). Order doesn't matter; multiple filters are additive.
Note: The filters parameter is available from API version 1.1.
|broadcast_location||The location where Wowza Streaming Cloud servers transcode the stream. Valid values are asia_pacific_australia, asia_pacific_india, asia_pacific_japan, asia_pacific_s_korea, asia_pacific_singapore, asia_pacific_taiwan, eu_belgium, eu_germany, eu_ireland, south_america_brazil, us_central_iowa, us_east_s_carolina, us_east_virginia, us_west_california, and us_west_oregon.|
The date and time the transcoder was created. Format as YYYY-MM-DDTHH:MM:SS.000Z where HH is a 24-hour clock in UTC.
|id||The unique, eight-character alphanumeric string that identifies the transcoder.|
|name||The descriptive name of the transcoder.|
|state||The state of the transcoder. Valid values are starting, stopping, started, stopped, and resetting.|
Filter comparision operators
|eq||Equals. Accepts one value. Returns only data whose field equals that value.|
|in||Equals any of. Accepts a comma-separated string of values. Returns any item whose field includes any of those values.|
- For [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
- For [version], substitute the version number of the API that you're using. For the current version, use v1.2.
- If you're using a request tool that has a globbing parser, turn off the parser so that the brackets don't generate an error. In cURL, pass the -g flag with the request.
Return only transcoders whose state is stopped:
curl -X GET -g --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/transcoders/?filter[field]=state&filter[eq]=stopped"
Return all transcoders that aren't actively running (all transcoders whose state isn't started):
curl -X GET -g --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/transcoders/?filter[field]=state&filter[in]=starting,resetting,stopping,stopped"
Return only transcoders that are started and are being broadcast from California or Ireland:
curl -X GET -g --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/transcoders/?filter[field]=state&filter[eq]=started&filter[field]=broadcast_location&filter[in]=us_west_california,eu_ireland"