Documentation

LoginWithXboxId

Signs the user in using an Xbox ID and Sandbox ID, returning a session identifier that can subsequently be used for API calls which require an authenticated user

Request Details

If this is the first time a user has signed in with the Xbox ID and CreateAccount is set to true, a new PlayFab account will be created and linked to the Xbox Live account. In this case, no email or username will be associated with the PlayFab account. Otherwise, if no PlayFab account is linked to the Xbox Live account, an error indicating this will be returned, so that the title can guide the user through creation of a PlayFab account.

LoginWithXboxIdRequest
Request Properties
CreateAccount Boolean

Automatically create a PlayFab account if one is not currently linked to this ID.

InfoRequestParameters GetPlayerCombinedInfoRequestParams

Flags for which pieces of info to return for the user.

Sandbox (required) String

The id of Xbox Live sandbox.

XboxId (required) String

Unique Xbox identifier for a user

POST https://{{TitleID}}.playfabapi.com/Server/LoginWithXboxId
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "XboxId": "12344553",
  "Sandbox": "RETAIL",
  "CreateAccount": false
}
        

Response Details

ServerLoginResult
Result Properties
EntityToken EntityTokenResponse

If LoginTitlePlayerAccountEntity flag is set on the login request the title_player_account will also be logged in and returned.

InfoResultPayload GetPlayerCombinedInfoResultPayload

Results for requested info.

LastLoginTime DateTime

The time of this user's previous login. If there was no previous login, then it's DateTime.MinValue

NewlyCreated (required) Boolean

True if the account was newly created on this login.

PlayFabId String

Player's unique PlayFabId.

SessionTicket String

Unique token authorizing the user and game at the server level, for the current session.

SettingsForUser UserSettings

Settings specific to this user.

Sample Response

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


Authentication

SecretKey

Possible Error Codes

Name Code
AccountNotFound 1001
InvalidPublisherId 1126
InvalidTitleId 1004
RequestViewConstraintParamsNotAllowed 1303
XboxInaccessible 1339
XboxRejectedXSTSExchangeRequest 1343
XboxXASSExchangeFailure 1306