Documentation

SetPlayerSecret

Sets or resets the player's secret. Player secrets are used to sign API requests.

Request Details

APIs that require signatures require that the player have a configured Player Secret Key that is used to sign all requests. Players that don't have a secret will be blocked from making API calls until it is configured. To create a signature header add a SHA256 hashed string containing UTF8 encoded JSON body as it will be sent to the server, the current time in UTC formatted to ISO 8601, and the players secret formatted as 'body.date.secret'. Place the resulting hash into the header X-PlayFab-Signature, along with a header X-PlayFab-Timestamp of the same UTC timestamp used in the signature.

SetPlayerSecretRequest
Request Properties
PlayerSecret String

Player secret that is used to verify API request signatures (Enterprise Only).

PlayFabId (required) String

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

POST https://{{TitleID}}.playfabapi.com/Admin/SetPlayerSecret
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayerSecret": "secretkeyforthisplayer",
  "PlayFabId": "ABCD1234"
}
        

Response Details

SetPlayerSecretResult
Result Properties

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8


Authentication

SecretKey

Possible Error Codes

Name Code