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 Header

Name Required Type Description
None True

string

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

Request Body

Name Type Description
CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Entity

EntityKey

The optional entity to perform this action on. Defaults to the currently logged in entity.

Responses

Name Type Description
200 OK

GetEntityTokenResponse

400 Bad Request

ApiErrorWrapper

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

Name Description
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

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

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://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types

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
CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Entity

EntityKey

The optional entity to perform this action on. Defaults to the currently logged in entity.

GetEntityTokenResponse

Name Type Description
Entity

EntityKey

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
EncryptionKeyBroken 1291
NoValidCertificateForAad 1376