> For the complete documentation index, see [llms.txt](https://dynamicpixels.gitbook.io/dynamicpixels-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dynamicpixels.gitbook.io/dynamicpixels-docs/web-api/leaderboard.md).

# Leaderboard

Explore the list of Web APIs functions available for managing leaderboards and player scores, including detailed descriptions and usage examples.

{% hint style="warning" %}
To use services functions, first ensure that the service is activated before. You can see services by opening "Service Hub" From game's dashboard header.&#x20;
{% endhint %}

## GET /api/table/services/leaderboard

> Retrieves a list of leaderboards based on the provided parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/leaderboard":{"get":{"tags":["Leaderboards"],"summary":"Retrieves a list of leaderboards based on the provided parameters.","operationId":"GetLeaderboards","parameters":[{"name":"label","in":"query","schema":{"type":"string"}},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32","default":25}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/LeaderboardRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/LeaderboardRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/LeaderboardRowsResponse"}}}}}}}},"components":{"schemas":{"LeaderboardRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/Leaderboard"},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false},"Leaderboard":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"desc":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"unique_by":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/LeaderboardAggregation"},"actions":{"type":"string","nullable":true},"extend_table":{"type":"string","nullable":true},"participants":{"$ref":"#/components/schemas/LeaderboardParticipantsType"},"course":{"type":"integer","format":"int32"},"timeframe":{"type":"integer","format":"int32"},"ttl":{"type":"integer","format":"int32"},"round":{"type":"integer","format":"int32"},"winners_count":{"type":"integer","format":"int32"},"last_wipe":{"type":"string","format":"date-time"}},"additionalProperties":false},"LeaderboardAggregation":{"enum":[0,1,2,3],"type":"integer","format":"int32"},"LeaderboardParticipantsType":{"enum":[0,1],"type":"integer","format":"int32"}}}}
```

## POST /api/table/services/leaderboard/user/{leaderboardId}

> Obtains scores for individual users as specified by the input parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/leaderboard/user/{leaderboardId}":{"post":{"tags":["Leaderboards"],"summary":"Obtains scores for individual users as specified by the input parameters.","operationId":"GetUsersScores","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32","default":25}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ObjectRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ObjectRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ObjectRowsResponse"}}}}}}}},"components":{"schemas":{"GetScoresRequest":{"type":"object","properties":{"conditions":{"$ref":"#/components/schemas/QueryParam"},"return_me":{"type":"boolean"}},"additionalProperties":false},"QueryParam":{"type":"object","properties":{"op":{"type":"string","nullable":true},"field":{"type":"string","nullable":true},"value":{"nullable":true},"values":{"type":"array","items":{},"nullable":true},"list":{"type":"array","items":{"$ref":"#/components/schemas/QueryParam"},"nullable":true}},"additionalProperties":false},"ObjectRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false}}}}
```

## POST /api/table/services/leaderboard/party/{leaderboardId}

> Fetches scores for different parties according to the given parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/leaderboard/party/{leaderboardId}":{"post":{"tags":["Leaderboards"],"summary":"Fetches scores for different parties according to the given parameters.","operationId":"GetPartiesScores","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32","default":25}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ObjectRowsResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ObjectRowsResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ObjectRowsResponse"}}}}}}}},"components":{"schemas":{"GetScoresRequest":{"type":"object","properties":{"conditions":{"$ref":"#/components/schemas/QueryParam"},"return_me":{"type":"boolean"}},"additionalProperties":false},"QueryParam":{"type":"object","properties":{"op":{"type":"string","nullable":true},"field":{"type":"string","nullable":true},"value":{"nullable":true},"values":{"type":"array","items":{},"nullable":true},"list":{"type":"array","items":{"$ref":"#/components/schemas/QueryParam"},"nullable":true}},"additionalProperties":false},"ObjectRowsResponse":{"type":"object","properties":{"list":{"type":"array","items":{},"nullable":true},"totalCount":{"type":"integer","format":"int32"}},"additionalProperties":false}}}}
```

## POST /api/table/services/leaderboard/{leaderboardId}/me

> Retrieves the score of the current user based on the input parameters.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/leaderboard/{leaderboardId}/me":{"post":{"tags":["Leaderboards"],"summary":"Retrieves the score of the current user based on the input parameters.","operationId":"GetCurrentUserScore","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/GetScoresRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ObjectRowResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ObjectRowResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ObjectRowResponse"}}}}}}}},"components":{"schemas":{"GetScoresRequest":{"type":"object","properties":{"conditions":{"$ref":"#/components/schemas/QueryParam"},"return_me":{"type":"boolean"}},"additionalProperties":false},"QueryParam":{"type":"object","properties":{"op":{"type":"string","nullable":true},"field":{"type":"string","nullable":true},"value":{"nullable":true},"values":{"type":"array","items":{},"nullable":true},"list":{"type":"array","items":{"$ref":"#/components/schemas/QueryParam"},"nullable":true}},"additionalProperties":false},"ObjectRowResponse":{"type":"object","properties":{"row":{"nullable":true}},"additionalProperties":false}}}}
```

## GET /api/table/services/leaderboard/{leaderboardId}/friends

> Gathers scores specifically for friends of the current user.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/leaderboard/{leaderboardId}/friends":{"get":{"tags":["Leaderboards"],"summary":"Gathers scores specifically for friends of the current user.","operationId":"GetFriendsScores","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"skip","in":"query","schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","schema":{"type":"integer","format":"int32","default":25}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryParamDto"}},"text/json":{"schema":{"$ref":"#/components/schemas/QueryParamDto"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/QueryParamDto"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ObjectRowResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ObjectRowResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ObjectRowResponse"}}}}}}}},"components":{"schemas":{"QueryParamDto":{"type":"object","properties":{"op":{"type":"string","nullable":true},"field":{"type":"string","nullable":true},"value":{"nullable":true},"values":{"type":"array","items":{},"nullable":true},"list":{"type":"array","items":{"$ref":"#/components/schemas/QueryParamDto"},"nullable":true}},"additionalProperties":false},"ObjectRowResponse":{"type":"object","properties":{"row":{"nullable":true}},"additionalProperties":false}}}}
```

## POST /api/table/services/leaderboard/{leaderboardId}

> Submits a user's score and returns the result.

```json
{"openapi":"3.0.4","info":{"title":"DynamicPixels GameService V2","version":"v2"},"paths":{"/api/table/services/leaderboard/{leaderboardId}":{"post":{"tags":["Leaderboards"],"summary":"Submits a user's score and returns the result.","operationId":"SubmitScore","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitScoreRequest"}},"text/json":{"schema":{"$ref":"#/components/schemas/SubmitScoreRequest"}},"application/*+json":{"schema":{"$ref":"#/components/schemas/SubmitScoreRequest"}}}},"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/ActionResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/ActionResponse"}},"text/json":{"schema":{"$ref":"#/components/schemas/ActionResponse"}}}}}}}},"components":{"schemas":{"SubmitScoreRequest":{"type":"object","properties":{"score":{"type":"integer","format":"int32"},"other_data":{"type":"object","additionalProperties":{},"nullable":true},"party_Id":{"type":"integer","format":"int32"}},"additionalProperties":false},"ActionResponse":{"type":"object","properties":{"affected":{"type":"integer","format":"int32"}},"additionalProperties":false}}}}
```
