Forum Discussion

wpigoury's avatar
wpigoury
Mentor
11 years ago

Retrieve contest entries 1-5 stars average rating

Hi,   I can't find how to retrieve the average rating for contest entries when rating system is set to 1-5 stars. Anyone ?   Thanks.
  • AdamN's avatar
    11 years ago

    Hi wpigoury,

     

    I believe this is the call you're looking for:

    http://lithosphere.lithium.com/t5/rest-api/bd-p/developers-rest-api?leaf-id=Message.ratings.key.key#Message.ratings.key.key.ratings.histogram

     

    You'll need to know the key of the ratings system you're using on that particular node. For example, if you're using the 1-5 ratings on a contest, the key is probably "contest_ratings", but you'll want to double-check in the admin under "Features > Ratings" for that contest.

     

    So your call might look like:

    /restapi/vc/messages/id/5187/ratings/key/contest_ratings/ratings/histogram

     

    If you want to get the average directly, you can chain "/average" to your call. For example:

    /restapi/vc/messages/id/5187/ratings/key/contest_ratings/ratings/histogram/average