

Discovery API Reference
version 1.5
http://personalization/v1/
Introduction
Ooyala Discovery APIs can be used by client applications to present consumers with content recommendations.
Note that if you are already using an Ooyala Discovery 1.0 API or Ooyala Player-integrated solution for your consumer app, you must not use these in conjunction with an Ooyala Discovery 1.5 API.
Request Authentication
The Ooyala Discovery REST APIs require that you include the <account_token> parameter in each request, as illustrated in the examples. For more information, see the Ooyala Account Token API.Filters
Filters may be applied along with any Ooyala Discovery API query to restrict the content to specific labels and other available metadata fields. Apart from metadata filters, a content_type filter can also be used to restrict the content to (say) a TV Series (instead of individual video assets that may represent Episodes or Trailers). Note that content_type filtering is available only when your Ooyala content management system (CMS) has content groups configured for your data model.For a list of all available asset or content group metadata fields, use your Ooyala CMS' /assets API response as reference. Any asset metadata field in that API response can generally be applied as a filter.
For example, if the /assets API response included the following metadata snippet for an asset:
{ "labels" : {"name" : "spotlight", "id" : "12345"} }then Ooyala Discovery would convert the nested metadata structure into a flattened form that can be used in API filter queries. So, to restrict content recommendations to those assets that are labeled ‘spotlight’, you would use the following filter:
filters=labels.name==["spotlight"]A Boolean expression with two or more filters may be applied. For example:
filters=labels.name==["spotlight"] AND genre==["action"] AND rating==["PG-13"] AND content_type==["movie"]
API Response
Ooyala Discovery API responses include a list of assets, as well as asset metadata for each asset. These include title and thumbnail, among others available from your Ooyala CMS. Responses will automatically exclude content not in an active state in the CMS.Responses include an ooyalaDiscoveryContext opaque string with each asset. This string must be returned with all user events (e.g.,
PLAY
) reported via an Ooyala Analytics SDK or API.
For You API
Get content recommendations for the user based on their cross-platform or device-specific consumption history.
Trending API
Get content recommendations based on what is currently trending.
GET
/personalization/v1/trending?account_token=<account_token>&filters=<filters>&content_type=<content_type>
The Trending API returns a list of content ranked based on growth in the recent past. The content that has seen the most growth in terms of views in the recent past will be ranked first.