Documentation

GetCharacterReadOnlyData

Retrieves the title-specific custom data for the user's character which can only be read by the client

Request Details

Data is stored as JSON key-value pairs. If the Keys parameter is provided, the data object returned will only contain the data specific to the indicated Keys. Otherwise, the full set of custom data will be returned.

GetCharacterDataRequest
Request Properties
CharacterId (required) String

Unique PlayFab assigned ID for a specific character owned by a user

IfChangedFromDataVersion uint32

The version that currently exists according to the caller. The call will return the data for all of the keys if the version in the system is greater than this.

Keys List<String>

Specific keys to search for in the custom user data.

PlayFabId (required) String

Unique PlayFab assigned ID of the user on whom the operation will be performed.

POST https://{{TitleID}}.playfabapi.com/Server/GetCharacterReadOnlyData
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "2039475",
  "CharacterId": "98342357",
  "Keys": [
    "preferences",
    "progress"
  ],
  "IfChangedFromDataVersion": 1
}
        

Response Details

GetCharacterDataResult
Result Properties
CharacterId String

Unique PlayFab assigned ID for a specific character owned by a user

Data Dict<String, UserDataRecord>

User specific data for this title.

DataVersion (required) uint32

Indicates the current version of the data that has been set. This is incremented with every set call for that type of data (read-only, internal, etc). This version can be provided in Get calls to find updated data.

PlayFabId String

Unique PlayFab assigned ID of the user on whom the operation will be performed.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "PlayFabId": "2039475",
    "DataVersion": 12,
    "Data": {
      "preferences": {
        "Value": "alpha",
        "LastUpdated": "2014-08-20T12:30:45Z",
        "Permission": "Public"
      },
      "progress": {
        "Value": "level_twenty",
        "LastUpdated": "2014-09-01T10:12:30Z",
        "Permission": "Private"
      }
    },
    "CharacterId": "3945734562"
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
CharacterNotFound 1135
UserisNotValid 1030