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 Name | Data Type | Description | Required/Optional |
|---|---|---|---|
| merchantId | String | Merchant ID | Required |
| timestamp | long | Time representation in UNIX milliseconds format. | Required |
| authToken | String | Game session id | Required |
| hash | String | String 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 Name | Data Type | Description | Required/Optional |
|---|---|---|---|
| errorCode | int | Error code, default 0 | Optional |
| errorText | String | Error message | Optional |
| playerId | String | Merchant’s unique identification for each player. | Required |
| test | Boolean | Set to true for test users | Required |
| username | String | Player’s username | Optional |
| nickname | String | Player nickname for games | Optional |
| firstName | String | Player’s first name | Optional |
| lastName | String | Player’s last name | Optional |
| gender | String | Player’s gender | Optional |
| String | Player’s email address | Optional | |
| phone | String | Player’s phone number | Optional |
| ipAddress | String | Ip address | Optional |
| language | String | Prefered user language. ISO 639-3 language code. Defaults to ENG | Optional |
| devicePlatform | String | Device platform (Desktop,Mobile..) | Optional |
| phone | String | Player’s phone number | Optional |
| address | String | Player’s address | Optional |
| city | String | Player’s city | Optional |
| country | String | Player’s country code (ISO 3166) | Optional |
| balance | Decimal | Available money in the player’s wallet at the time of the request. The value will be presented in the currency of that session | Required |
| currency | String | The 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"
}