GET uri/api/highscores/gamescore/:playerId/:gameId
Parameters:
- playerId (String, must be a valid MongoDB ID)
- gameId (String, must be a valid MongoDB ID)
Returns the highest score a user with playerId for game with gameId on the form:
[
{
"_id": (String, valid MongoDB ID),
"gameId": (String, valid MongoDB ID),
"playerId": (String, valid MongoDB ID),
"value": Int
}
]
POST uri/api/highscores/highscore
Posts the score if it is higher than the already existing one for the game and player. If the player has no exisiting score for said game a new one is created.
Body:
{
"playerId": (String, valid MongoDB ID),
"gameId": (String, valid MongoDB ID),
"value": (Int),
}
GET uri/api/highscores/playerscore/:playerId
Parameters:
- playerId (String, must be a valid MongoDB ID)
Returns all the highscores a user has on the form:
[
{
"_id": (String, valid MongoDB ID),
"gameId": (String, valid MongoDB ID),
"playerId": (String, valid MongoDB ID),
"value": Int
}
]
GET uri/api/highscores/gamescores/:gameId
Parameters:
- gameId (String, must be a valid MongoDB ID)
Returns the five best highscores for the game with id = gameId sorted from high to low on the form:
[
{
"_id": (String, valid MongoDB ID),
"gameId": (String, valid MongoDB ID),
"playerId": (String, valid MongoDB ID),
"value": Int
}
]