Get leaderboard
This route can be used to retrieve the global leaderboard with optional filters.
GET /v2/:game/:discr
Route parameters
Key |
Description |
---|---|
|
the game name |
|
the major discriminant (a discriminant is a criteria that identify the board where the score has to be put. Note that a game can have several independent leaderboard which are identified by a distinct discriminant) |
Query parameters
Query parameters are optional and are useful to filter the global leaderboard.
Field |
Default |
Remarks |
---|---|---|
|
0 |
|
|
50 |
|
|
n/a |
Required if |
|
n/a |
|
|
n/a |
|
|
n/a |
An array of additional discriminants which are cumulative |
|
n/a |
An array of launcher names which are not cumulative |
|
n/a |
|
|
0 |
If 1 extra fields are returned |
|
0 |
If 1 stats fields are returned |
Response
Code |
Remarks |
---|---|
200 |
The global leaderboard have been returned with success |
400 |
|
500 |
Internal error |
The response is sent in the JSON format.
[
{ ... }, { ... },
{
"rank": 35,
"platform": "octopod",
"session": "a",
"user": "b",
"pseudo": "c",
"score": 42,
"created_at": "2020/12/01 10:09:08",
"extra": "<data of format texte ou binaire retourné via un Base64>",
"discr": ["time:10mn", "difficulty:hard"],
"launcher": "wanadev2",
"stats": {"foo": "bar"}
},
{ ... }, { ... }
]
Note that:
extra
field is returned only ifextra
query parameter is equal to 1stats
field is returned only ifstats
query parameter is equal to 1the number of results depends on the
limit
query parameters (50 by default)the board starts with the rank
offset
+ 1 (starts with the 1st by default)if there is no entry for the requested leaderboard, an empty array is returned