Solution Rating Resources

Get rating

GET /solutions/:id/rating

Retrieves the rating given by the current user. Will be null if no rating is given yet.

{
    "solution": "/solutions/42",
    "rating": 5,
    "total": 2,
    "average": 2.5,
    "details": {
        "5": 0,
        "4": 1,
        "3": 0,
        "2": 0,
        "1": 1,
    }
}

Submit rating

PUT /solutions/:id/rating
Parameter Type Required Description
rating int Rating, ranging from 1 to 5.

Set the rating for the given solution. This can only be done by users, or admins posing as users.

If the user has already rated the solution, the rating will simply be updated.

The response is the current rating for the solution.

{
    "solution": "/solutions/42",
    "rating": 5,
    "total": 2,
    "average": 3,
    "details": {
        "5": 1,
        "4": 0,
        "3": 0,
        "2": 0,
        "1": 1,
    }
}