OpenTV ENTera & OpenTV Platform Documentation

Retrieve the average rating for a content

Request

To retrieve the average rating for a content, send a GET request to:

Bash
http://<server>:<port>/useractivityvault/v1/ratings/content/{contentId}/average

This will return a response containing both the average rating and the number of ratings made against this content.

Headers

  • Content-Type: application/json

  • token – the standard NAGRAVISION HTTP Token, as required for authentication purposes

Mandatory arguments

  • contentId – the content ID

Other arguments

  • cache – if set to false, this disables the caching of responses from this service

  • pretty – if set to true, the response is formatted in a human-readable format

Example

In the example below, a user would like to find out the rating of the content with content ID DH1:

Bash
http://server:port/useractivityvault/v1/ratings/content/DH1/average

Response

A successful request returns an HTTP 200 status.

A bad request returns an HTTP 400 status.

If the specified contentId does not exist, the request returns an HTTP 404 status.

Example

This will return a response containing both the average rating and the number of ratings made against this content.

JSON
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "contentId": "string",
  "average": 0,
  "count": 0,
  "timestamp": "2021-06-03T08:44:40.075Z"
}

See also

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