API Reference > Manage data collections > Retrieve data collection rating
  

Retrieve data collection rating

Use REST APIs to retrieve the rating of a data collection. You can use this API to retrieve the average rating of the data collection and the rating for each usage context.

Endpoint and method

The following table describes the connection properties for the API:
Property
Description
Endpoint
/integration/collaboration/<objectId>/interactions/ratings
<objectId>: Required. Enter the system generated unique identifier of the data collection whose ratings you want to retrieve.
For more information about how you can use an API to get the system generated unique identifier of a data collection, see Retrieve data collections.
To get the system generated unique identifier of a data collection from the Data Marketplace interface, open the data collection. The data collection page's URL contains the system generated unique identifier.
For example, in the URL https://{{CDMP_URL}}/datacollection/25158afc-3dfb-44ef-8f3e-cec1e171d0f1?dtn=&tab=summary, the system generated unique identifier is 25158afc-3dfb-44ef-8f3e-cec1e171d0f1.
Method
GET
Note: Before you call this API, consider the following:
For more information, see How to call a Data Marketplace API.

Request

The API has no payload.

Example request

The following example shows how you can use an API to retrieve the rating of a data collection:
https://{{CDMP_URL}}/api/v1/integration/collaboration/d2313aed-330e-44a0-bcfa-380ee4a95a62/interactions/ratings

Response

When you pass the API query parameters in the REST client, the client displays a response for the parameter values that you have entered.
The following example shows the response of the API call:

{
"id": "d2313aed-330e-44a0-bcfa-380ee4a95a62",
"globalRating": 4,
"contextRatings": [
{
"id": "16a5e036-02d7-4c01-a5f7-c99ffca90cde",
"averageRating": 2
}
]
}
The following table contains the parameters in the response body:
Parameter
Description
id
System generated unique identifier of the data collection.
globalRating
Average rating of the data collection for all the usage contexts. This parameter can have a value between 0 and 5.
contextRatings > id
System generated unique identifier of the usage context for which a Data User has rated the data collection.
contextRatings > averageRating
Average rating of the data collection for a usage context. This parameter can have a value between 0 and 5.