Documentation

GrantCharacterToUser

Grants the specified character type to the user. CharacterIds are not globally unique; characterId must be evaluated with the parent PlayFabId to guarantee uniqueness.

Request Details

Grants a character to the user of the type and name specified in the request.

GrantCharacterToUserRequest
Request Properties
CharacterName (required) String

Non-unique display name of the character being granted (1-20 characters in length).

CharacterType (required) String

Type of the character being granted; statistics can be sliced based on this value.

PlayFabId (required) String

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

POST https://{{TitleID}}.playfabapi.com/Server/GrantCharacterToUser
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "20394883567",
  "CharacterName": "FighterDude",
  "CharacterType": "Blue Warrior"
}
        

Response Details

GrantCharacterToUserResult
Result Properties
CharacterId String

Unique identifier tagged to this character.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "CharacterId": "98765432"
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
AccountNotFound 1001