Skip to main content

Validate Token

/validateToken

The Authentication API enables the HPGames system to verify the information received in the launch protocol. Only once the merchant approves this information game will be launched.

Validate Token Request

Parameter NameData TypeDescriptionRequired/Optional
merchantIdStringMerchant IDRequired
timestamplongTime representation in UNIX milliseconds format.Required
authTokenStringGame session idRequired
hashStringString To Encode: merchantId + timestamp
HMAC SHA256 Code Snippet
Required

Request example:

{
"merchantId": "21385394-6dda-4171-a003-02fa4a975643",
"timestamp": 1643727556,
"authToken": "b5e10b6b-4d88-475c-9496-a461052a8448",
"hash": "288db34c0f1eb6e9c11f38ff2feb90d0"
}

Signature calculation example:

(value of secret key used in all examples: secretkey)

SHA256("21385394-6dda-4171-a003-02fa4a9756431643727556", secretkey);

Validate Token Response

Parameter NameData TypeDescriptionRequired/Optional
errorCodeintError code, default 0Optional
errorTextStringError messageOptional
playerIdStringMerchant’s unique identification for each player.Required
testBooleanSet to true for test usersRequired
usernameStringPlayer’s usernameOptional
nicknameStringPlayer nickname for gamesOptional
firstNameStringPlayer’s first nameOptional
lastNameStringPlayer’s last nameOptional
genderStringPlayer’s genderOptional
emailStringPlayer’s email addressOptional
phoneStringPlayer’s phone numberOptional
ipAddressStringIp addressOptional
languageStringPrefered user language. ISO 639-3 language code. Defaults to ENGOptional
devicePlatformStringDevice platform (Desktop,Mobile..)Optional
phoneStringPlayer’s phone numberOptional
addressStringPlayer’s addressOptional
cityStringPlayer’s cityOptional
countryStringPlayer’s country code (ISO 3166)Optional
balanceDecimalAvailable money in the player’s wallet at the time of the request. The value will be presented in the currency of that sessionRequired
currencyStringThe currency of the balance, Currency code (ISO 421)Required

Response example:

{
"errorCode": 0,
"errorText": "",
"playerId": "PL123456789",
"test": false,
"username": "john_doe",
"firstName": "John",
"lastName": "Doe",
"gender": "male",
"email": "john.doe@example.com",
"phone": "+1234567890",
"ipAddress": "192.168.1.1",
"language": "en",
"devicePlatform": "Mobile",
"address": "123 Main St",
"city": "New York",
"country": "US",
"balance": 250.75,
"currency": "USD"
}