Skip to main content
Version: 6.1.0

GetUserToken

Returns a store user token (JWT) for the current user, generated on the server. The client can use it to call the store's APIs on the user's behalf. Currently only supported for Xsolla.

ServiceOperation
appStoreGET_USER_TOKEN

Method Parameters​

ParameterDescription
storeIdThe store to get the token for, e.g. "xsolla". Refer to the current available store IDs here.
note
  • Xsolla (xsolla) needs the app's Xsolla integration to have a server client ID, a server client secret and a login ID set. If any of these is missing, or the call to Xsolla fails, userToken is returned as null.
  • Other stores are not supported yet.
  • An unknown storeId fails with HTTP 400 and reason code INVALID_STORE_ID (40700).

Usage​

http://localhost:3000
string storeId = "xsolla";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.AppStoreService.GetUserToken(storeId, successCallback, failureCallback);
JSON Response
{
"data": {
"userToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
},
"status": 200
}