Skip to main content
Skip table of contents

Rate content for an account

Request

To rate a content for an account, send a POST request to:

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

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 (typically a value between one and five)

  • name – must be "rating"

  • metadata – a block containing one or more key/value pairs in the following form:

    JSON
    [{
       "key": "<key_name>",
       "value": "<value>"
    }]

    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"
}

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 an ID avatar1 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"
  }
}

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.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.