Authentication - Get Entity Token

Method to exchange a legacy AuthenticationTicket or title SecretKey for an Entity Token or to refresh a still valid Entity Token.

POST https://titleId.playfabapi.com/Authentication/GetEntityToken

Request Body

Name Type Description
Entity

The entity to perform this action on.

Responses

Name Type Description
200 OK
400 Bad Request

This is the outer-wrapper for all responses with errors

Security

None

This API requires no authentication headers (usually provides one to other calls).

Type: apiKey
In: header

Definitions

ApiErrorWrapper

The basic wrapper around every failed API response

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

GetEntityTokenRequest

This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and cannot be expired or revoked.

GetEntityTokenResponse

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code
  • number

Numerical HTTP code

error
  • string

Playfab error code

errorCode
  • number

Numerical Playfab error code

errorDetails
  • object

Detailed description of individual issues with the request object

errorMessage
  • string

Description for the Playfab errorCode

status
  • string

String HTTP code

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

Name Type Description
Id
  • string

Unique ID of the entity.

Type
  • string

Entity type. See https://api.playfab.com/docs/tutorials/entities/entitytypes

TypeString
  • string

Alternate name for Type.

GetEntityTokenRequest

This API must be called with X-SecretKey, X-Authentication or X-EntityToken headers. An optional EntityKey may be included to attempt to set the resulting EntityToken to a specific entity, however the entity must be a relation of the caller, such as the master_player_account of a character. If sending X-EntityToken the account will be marked as freshly logged in and will issue a new token. If using X-Authentication or X-EntityToken the header must still be valid and cannot be expired or revoked.

Name Type Description
Entity

The entity to perform this action on.

GetEntityTokenResponse

Name Type Description
Entity

The entity id and type.

EntityToken
  • string

The token used to set X-EntityToken for all entity based API calls.

TokenExpiration
  • string

The time the token will expire, if it is an expiring token, in UTC.

Error Codes

Name Code
EntityTokenExpired 1336
EntityTokenInvalid 1335
EntityTokenRevoked 1337
NotAuthenticated 1074