Player Data Management - Increment Player Statistic Version

Resets the indicated statistic, removing all player entries for it and backing up the old values.

POST https://titleId.playfabapi.com/Admin/IncrementPlayerStatisticVersion

Request Header

Name Required Type Description
X-SecretKey True

string

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Request Body

Name Type Description
CustomTags

object

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

StatisticName

string

unique name of the statistic

Responses

Name Type Description
200 OK

IncrementPlayerStatisticVersionResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-SecretKey

This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

IncrementPlayerStatisticVersionRequest

Statistics are numeric values, with each statistic in the title also generating a leaderboard. When this call is made on a given statistic, this forces a reset of that statistic. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions).

IncrementPlayerStatisticVersionResult
PlayerStatisticVersion
StatisticVersionStatus

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

IncrementPlayerStatisticVersionRequest

Statistics are numeric values, with each statistic in the title also generating a leaderboard. When this call is made on a given statistic, this forces a reset of that statistic. Upon reset, the statistic updates to a new version with no values (effectively removing all players from the leaderboard). The previous version's statistic values are also archived for retrieval, if needed (see GetPlayerStatisticVersions). Statistics not created via a call to CreatePlayerStatisticDefinition by default have a VersionChangeInterval of Never, meaning they do not reset on a schedule, but they can be set to do so via a call to UpdatePlayerStatisticDefinition. Once a statistic has been reset (sometimes referred to as versioned or incremented), the now-previous version can still be written to for up a short, pre-defined period (currently 10 seconds), to prevent issues with levels completing around the time of the reset. Also, once reset, the historical statistics for players in the title may be retrieved using the URL specified in the version information (GetPlayerStatisticVersions).

Name Type Description
CustomTags

object

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

StatisticName

string

unique name of the statistic

IncrementPlayerStatisticVersionResult

Name Type Description
StatisticVersion

PlayerStatisticVersion

version change history of the statistic

PlayerStatisticVersion

Name Type Description
ActivationTime

string

time when the statistic version became active

ArchiveDownloadUrl

string

URL for the downloadable archive of player statistic values, if available

DeactivationTime

string

time when the statistic version became inactive due to statistic version incrementing

ScheduledActivationTime

string

time at which the statistic version was scheduled to become active, based on the configured ResetInterval

ScheduledDeactivationTime

string

time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval

StatisticName

string

name of the statistic when the version became active

Status

StatisticVersionStatus

status of the statistic version

Version

number

version of the statistic

StatisticVersionStatus

Name Type Description
Active

string

ArchivalPending

string

Archived

string

Snapshot

string

SnapshotPending

string

Error Codes

Name Code
StatisticNotFound 1195
StatisticUpdateInProgress 1276
StatisticVersionIncrementRateExceeded 1204