Documentation

IncrementPlayerStatisticVersion

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

Request Details

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).

IncrementPlayerStatisticVersionRequest
Request Properties
StatisticName String

unique name of the statistic

POST https://{{TitleID}}.playfabapi.com/Admin/IncrementPlayerStatisticVersion
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "StatisticName": "headshots"
}
        

Response Details

IncrementPlayerStatisticVersionResult
Result Properties
StatisticVersion PlayerStatisticVersion

version change history of the statistic

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "StatisticVersion": {
      "StatisticName": "headshots",
      "Version": 2,
      "ActivationTime": "2016-12-05T10:02:01Z",
      "ArchivalStatus": "NotScheduled",
      "Status": "Archived",
      "ArchiveDownloadUrl": "https://Someurl"
    }
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
StatisticNotFound 1195
StatisticUpdateInProgress 1276
StatisticVersionIncrementRateExceeded 1204