Obtaining a game
Overview
| Request type | URL |
|---|---|
| GET | <server-pixmove-games>/game/init |
This method allows you to obtain a link for opening the game in iFrame.
Notice
The request is executed by the partner.
Parameters
Request
Optional fields are excluded from hash calculations.
Optional* fields are included in hash calculations only if they are provided.
Parameters minBet, maxBet and maxWin are considered only if the sessionId parameter is provided.
| Name | Type | Description | |
|---|---|---|---|
| currency | string | The currency in which the game will be played | |
| partnerId | bigint | Unique partner identifier | |
| gameId | bigint | Unique game identifier | |
| playerId | string | Unique player identifier in the partner’s system | |
| sessionId | string | optional* | Unique game session identifier in the partner’s system, which will be passed in all subsequent requests |
| language | string | optional* | Game localization language |
| returnUrl | string | optional* | Link for returning from the game back to the partner’s website |
| hash | string | Signature (sha256 from encryption string) | |
| minBet | string | optional | Minimum available bet amount within a game session |
| maxBet | string | optional | Maximum available bet amount within a game session |
| maxWin | string | optional | Maximum win amount within a game session |
| nickname | string | optional | Player's nickname |
| countryCode | string | optional | Player's country code within a game session |
String to hash
"game" + currency + partnerId + gameId + playerId + sessionId* + language* + returnUrl* + apiKey
Response
| Name | Type | Description |
|---|---|---|
| gameUrl | string | Link for opening the game in iFrame |
Example
Request
js
{
currency: 'USD',
partnerId: 1,
gameId: 1,
playerId: '132',
sessionId: '123',
minBet: '5',
hash: '5ac72c7cec4949fc3d268dee6bff0394c3378a3a0ed21727d5523d272638a430'
}Response
js
{
status: 'success'
data: {
gameUrl: '\<server-pixmove-games\>/pirate\_dice/?token=rzcvPWua8zjMw2'
}
}Errors
Possible error messages:
| Message | Description |
|---|---|
| RequiredParamsNotFound | Incorrect number of parameters in the request |
| InvalidParamType | Incorrect type of parameter |
| CurrencyNotFound | Currency with such code not found |
| PartnerNotFound | Partner with such partnerId not found |
| GameNotFound | Game with such partnerId not found |
| IncorrectHash | Incorrectly calculated hash |
| ServerError | Server error |