Documentation

GetPlayerStatistics

Retrieves the indicated statistics (current version and values for all statistics, if none are specified), for the local player.

Request Details

GetPlayerStatisticsRequest
Request Properties
StatisticNames List<String>

statistics to return (current version will be returned for each)

StatisticNameVersions List<StatisticNameVersion>

statistics to return, if StatisticNames is not set (only statistics which have a version matching that provided will be returned)

POST https://{{TitleID}}.playfabapi.com/Client/GetPlayerStatistics
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{
  "StatisticNames": [
    "Points",
    "Wins"
  ]
}
        

Response Details

In addition to being available for use by the title, the statistics are used for all leaderboard operations in PlayFab.

GetPlayerStatisticsResult
Result Properties
Statistics List<StatisticValue>

User statistics for the requested user.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "Statistics": [
      {
        "StatisticName": "Points",
        "Value": 570,
        "Version": 2
      },
      {
        "StatisticName": "Wins",
        "Value": 15,
        "Version": 0
      }
    ]
  }
}

Authentication

SessionTicket

Possible Error Codes

Name Code