Retrieve scores via API

To learn about how game objects are scored, learn about Classic Mode.

Getting game results

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

Get Player Scores

get

Get a Player's score data for a specific Game.

Authorizations
Query parameters
game_idstringRequired

The game id to get scores for

Pattern: ^[a-zA-Z0-9_-]+$
player_idstringRequired

The player id to get scores for

Pattern: ^[a-zA-Z0-9_-]+$
include_game_objectsbooleanOptional

Whether to include game objects in the response

Default: false
Responses
200

Successful response

application/json
get
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"
      }
    }
  ]
}

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 Ranked Results

get

Get ranked Game Object results for a player

Authorizations
Query parameters
playerIdstringRequired

ID value. Only alphanumeric, underscore, and hyphen are allowed.

Pattern: ^[a-zA-Z0-9_-]+$
inputTagsstringRequired

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

outputTagstringRequired

Specify the output tag of the game objects to get ranked results for

Responses
200

Successful response

application/json
get
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
    }
  ]
}

Last updated

Was this helpful?