> 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/more/trusted-server/leeaderboard.md).

# Leeaderboard

## GET /server/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":{"/server/services/leaderboard":{"get":{"tags":["Leaderboard"],"summary":"Retrieves a list of leaderboards based on the provided parameters.","operationId":"TrustedServer.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 /server/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":{"/server/services/leaderboard/{leaderboardId}/me":{"post":{"tags":["Leaderboard"],"summary":"Retrieves the score of the current user based on the input parameters.","operationId":"TrustedServer.GetCurrentUserScore","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"caller","in":"query","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}}}}
```

## POST /server/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":{"/server/services/leaderboard/user/{leaderboardId}":{"post":{"tags":["Leaderboard"],"summary":"Obtains scores for individual users as specified by the input parameters.","operationId":"TrustedServer.GetUsersScores","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"caller","in":"query","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 /server/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":{"/server/services/leaderboard/party/{leaderboardId}":{"post":{"tags":["Leaderboard"],"summary":"Fetches scores for different parties according to the given parameters.","operationId":"TrustedServer.GetPartiesScores","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"caller","in":"query","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}}}}
```

## GET /server/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":{"/server/services/leaderboard/{leaderboardId}/friends":{"get":{"tags":["Leaderboard"],"summary":"Gathers scores specifically for friends of the current user.","operationId":"TrustedServer.GetFriendsScores","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"caller","in":"query","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 /server/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":{"/server/services/leaderboard/{leaderboardId}":{"post":{"tags":["Leaderboard"],"summary":"Submits a user's score and returns the result.","operationId":"TrustedServer.SubmitScore","parameters":[{"name":"leaderboardId","in":"path","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"caller","in":"query","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}}}}
```
