Retrieve scores via API
Last updated
Was this helpful?
Last updated
Was this helpful?
After a user plays a game, their scores are saved in your database. You can quickly retrieve the scored data using the API within your Console.
Here we're using the Games API to retrieve a player's scores for a specific game using /games/getPlayerScores
You can also retrieve all scored game objects for a particular user with the Game Objects resource. Get ranked Game Object results for a player using /game-objects/ranked
Get a Player's score data for a specific Game.
The game id to get scores for
^[a-zA-Z0-9_-]+$
The player id to get scores for
^[a-zA-Z0-9_-]+$
Whether to include game objects in the response
false
GET /api/games/getPlayerScores?game_id=text&player_id=text HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"playerScores": [
{
"createdAt": "text",
"updatedAt": "text",
"score": 1,
"playerId": "text",
"gameObjectId": "text",
"gameObject": {
"id": "text",
"createdAt": "text",
"updatedAt": "text",
"name": "text",
"description": "text"
}
}
]
}
Get ranked Game Object results for a player
ID value. Only alphanumeric, underscore, and hyphen are allowed.
^[a-zA-Z0-9_-]+$
Specify comma-separated input tags that will be used to score the game objects associated with the output tag.
If the output tag is included in the input tags, the player's score for those game object will be used as base scores
Specify the output tag of the game objects to get ranked results for
GET /api/game-objects/ranked?playerId=text&inputTags=text&outputTag=text HTTP/1.1
Host:
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"scores": [
{
"gameObject": {
"id": "text",
"name": "text"
},
"score": 1
}
]
}