This API is called to invoke the encoding process in the recommendation engine. The goal is to input a CSV file containing the asset viewing information of the users and convert it into corresponding implied rating (as per the chosen rating algorithm). The rated data is stored as a CSV file and the access URL is returned on completion. This encoded CSV file can be used as input to the Recommendation Rating Computation Engine.
POST DATA:
1 2 3 4 5 6 |
{ "RatingAlgorithm": "explicit", //"conservative", "aggressive" "RatingData": "<CSV-URL>", "Catalog": "<CSV-URL>", "Callback": "<Callback-URL>" //Optional } |
Notes:
Each row in the CSV file has these fields: itemId, tags, type, seriesId, duration
itemId: string
tags: pipe-separated list of tags
type: string //vod, series, episode
seriesId: string // in case the asset is an episode, this is the itemId of its series. Otherwise “”
duration: int // runtime in seconds — for series it will be sum of runtime of all its episodes
1 2 3 4 5 |
{ "status": "completed", "id": "<request_id>", "output_url": "<file_url>" } |
In case of failure, a JSON with error message is POST to the callback endpoint:
1 2 3 4 5 |
{ "status": "error", "id": "<request_id>", "msg": "<error message>" } |
1 2 3 4 5 6 |
{ "RatingAlgorithm":"explicit", //"conservative", "aggressive" "RatingData":"http://example.org/view.csv", "Catalog":"http://example.org/assets.csv", "Callback":"http://example.org/callback?id=1234" //Optional } |
1 2 3 4 |
{ "status": "success", "id": "<request_id>" } |
1 2 3 4 |
{ "status":"error", "msg": "<error message>" } |