OpenTV ENTera & OpenTV Platform Documentation
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2

Rate content for a user profile

Request

To rate a content for a user profile, send a POST request to:

Bash
https://<host>:<port>/useractivityvault/v1/useractivity/rating

You do not need to specify the user profile – UAV reads it from the token.

Headers

  • Content-Type: application/json

Mandatory arguments

  • accountId – the ID of the account

  • deviceId – the ID of the device

  • contentId – the ID of the content being rated

  • rating – the rating, as a whole number from 1 to 10. Recommendations use only ratings from 1 to 10; a rating with any other value is stored but is not used for recommendations.

  • name – must be "rating"

  • metadata – an object containing key/value pairs, for example "contentType": "vod-ed".

    This must contain the details listed in the Required metadata section below. These are required for recommendation functionality.

Required metadata

The required metadata varies according to the type of content, as shown in the following examples.

Note that:

  • seriesId – is only required for series and seasons.

  • contentType – the values are those used by ION, for example, "vod-ed".

BTV (live)

JSON
"metadata": {
  "contentType": "live-event",
  "programmeId": "btv-prog-1",
  "editorialId": "GLOBAL_20711",
  "seriesId": "298940",
  "deviceType": "Android"
}

VOD

JSON
"metadata": {
  "contentType": "vod-ed",
  "technicalId": "vod-tech-1",
  "editorialId": "GLOBAL_20711",
  "seriesId": "298940",
  "deviceType": "Android"
}
JSON
"metadata": {
  "contentType": "deeplink",
  "deeplinkId": "link-1",
  "editorialId": "GLOBAL_20711",
  "seriesId": "298940",
  "deviceType": "Android"
}

Series

JSON
"metadata": {
  "contentType": "series",
  "seriesId": "298940",
  "editorialId": "GLOBAL_20711",
  "deviceType": "Android"
}

Season

JSON
"metadata": {
  "contentType": "season",
  "seriesId": "298940",
  "editorialId": "GLOBAL_20711",
  "deviceType": "Android"
}

For a season, set seriesId to the season’s series.id from the metadata – in the OPF model, a season is a series entity.

Channel

JSON
"metadata": {
  "contentType": "channel",
  "editorialId": "channel-1",
  "deviceType": "Android"
}

Example

A POST request with this payload submits a rating of 3 for the content with the ID GLOBAL_20711 for the specified account:

JSON
{
  "accountId": "Account1234",
  "deviceId": "619e24ef63865312a726323e",
  "contentId": "GLOBAL_20711",
  "rating": 3,
  "name": "rating",
  "metadata": {
    "contentType": "vod-ed",
    "technicalId": "vod-tech-1",
    "editorialId": "GLOBAL_20711",
    "seriesId": "298940",
    "deviceType": "Android"
  }
}

Effect on recommendations. A rating replaces the score that the user’s earlier activities have built up for that content; later activities then adjust it again. For how ratings are converted, see Recommendations in Reporting activity and event metrics to UAV.

Response

A successful request returns an HTTP 202 status.

A bad request returns an HTTP 400 status.

An unauthorised request returns an HTTP 401 status.

See also

For full details of this API, see User Activity Vault (UAV) API documentation.