Leaderboards - Get Leaderboard Definition

Gets the specified leaderboard definition.

POST https://titleId.playfabapi.com/Leaderboard/GetLeaderboardDefinition

Request Header

Name Required Type Description
X-EntityToken True

string

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Request Body

Name Required Type Description
Name True

string

The name of the leaderboard to retrieve the definition for.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Responses

Name Type Description
200 OK

GetLeaderboardDefinitionResponse

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-EntityToken

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

GetLeaderboardDefinitionRequest
GetLeaderboardDefinitionResponse
LeaderboardColumn
LeaderboardSortDirection
LinkedStatisticColumn
ResetInterval
VersionConfiguration

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

GetLeaderboardDefinitionRequest

Name Type Description
CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Name

string

The name of the leaderboard to retrieve the definition for.

GetLeaderboardDefinitionResponse

Name Type Description
Columns

LeaderboardColumn[]

Sort direction of the leaderboard columns, cannot be changed after creation.

Created

string

Created time, in UTC

EntityType

string

The entity type being represented on the leaderboard. If it doesn't correspond to the PlayFab entity types, use 'external' as the type.

LastResetTime

string

Last time, in UTC, leaderboard version was incremented.

Name

string

A name for the leaderboard, unique per title.

SizeLimit

number

Maximum number of entries on this leaderboard

Version

number

Latest Leaderboard version.

VersionConfiguration

VersionConfiguration

The version reset configuration for the leaderboard definition.

LeaderboardColumn

Name Type Description
LinkedStatisticColumn

LinkedStatisticColumn

If the value for this column is sourced from a statistic, details of the linked column. Null if the leaderboard is not linked.

Name

string

A name for the leaderboard column, unique per leaderboard definition.

SortDirection

LeaderboardSortDirection

The sort direction for this column.

LeaderboardSortDirection

Name Type Description
Ascending

string

Descending

string

LinkedStatisticColumn

Name Type Description
LinkedStatisticColumnName

string

The name of the statistic column that this leaderboard column is sourced from.

LinkedStatisticName

string

The name of the statistic.

ResetInterval

Name Type Description
Day

string

Hour

string

Manual

string

Month

string

Week

string

VersionConfiguration

Name Type Description
MaxQueryableVersions

number

The maximum number of versions of this leaderboard/statistic that can be queried.

ResetInterval

ResetInterval

Reset interval that statistics or leaderboards will reset on. When using Manual intervalthe reset can only be increased by calling the Increase version API. When using Hour interval the resetwill occur at the start of the next hour UTC time. When using Day interval the reset will occur at thestart of the next day in UTC time. When using the Week interval the reset will occur at the start ofthe next Monday in UTC time. When using Month interval the reset will occur at the start of the nextmonth in UTC time.

Error Codes

Name Code
ApiNotEnabledForTitle 1520
LeaderboardColumnLengthMismatchWithStatDefinition 1584
LeaderboardNotFound 1567