Retrieve the average rating for a content
Request
To retrieve the average rating for a content, send a GET request to:
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/jsontoken– the standard NAGRAVISION HTTP Token, as required for authentication purposes
Mandatory arguments
contentId– the content ID
Other arguments
cache– if set tofalse, this disables the caching of responses from this servicepretty– if set totrue, 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:
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.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"contentId": "string",
"average": 3,
"count": 254,
"timestamp": "2021-06-03T08:44:40.075Z"
}
See also
For full details of this API, see User Activity Vault (UAV) API documentation.