v1

latestOpenAPI 3.0.12026-07-24210349345.4 KB

Leaderboard

This endpoint allows you to query leaderboard data for a campaign. It provides information such as player rankings, scores, and time played. Use this endpoint if you want to display a real-time leaderboard in your system to showcase player achievements and encourage competition.

get/campaigns/{campaignId}/leaderboard

Path parameters

campaignIdinteger required

The ID of the campaign you want to retrieve the leaderboard for.

Query parameters

limitinteger required

The number of leaderboard rows to return (min 1, max 500).

playerstring

The ID of a specific player. If included, this player's leaderboard data is returned in the special me object in the response.

sorting'score' | 'time'

The leaderboard sorting basis. Can be score or time. Defaults to score.

fromDatestring

A timestamp in ISO8601 format. If included, only leaderboard entries from this date forward will be returned.

Response

200

Example response

{
  "me": {
    "place": "101",
    "score": 5500,
    "gameDurationInSeconds": 35,
    "leaderboardName": "YourPlayerName"
  },
  "leaderboards": [
    {
      "place": "1",
      "score": 9800,
      "gameDurationInSeconds": 45,
      "leaderboardName": "PlayerOne"
    }
  ]
}