Backend integration
Game API introduction
Partner - side which integrates games.
Provider - side which provides games (Aviatrix).
Current document describes methods implemented by provider. Methods allow the partner to launch the game and to retrieve the game round results.
Game API methods
All POST requests contain the X-Auth-Signature HTTP header required to authenticate the host. That allows to refuse IP whitelisting during integration process. Otherwise, it deprives the provider of the ability to scale quickly (horizontally) without notifying the platform.
Ask your integration manager for the base URL.
/game/url
The method is used to generate a game launch URL with the specified parameters.
Example of the request
Request headers specified in the example are required: Accept, Content-Type, X-Auth-Signature
POST /game/url HTTP/1.1
Content-Type: application/json
Accept: application/json
X-Auth-Signature: <signature>
{
"cid": "someplatform",
"productId": "nft-aviatrix",
"sessionToken": "5fc0cbd8-6328-43a5-a016-c075950d5393",
"lang": "en",
"lobbyUrl": "https://example.com",
"isDemo": false,
"promoCode": "ABCD2025",
"hideExitButton": false
}
| Parameter | Description | Type | Requirements | Explanation |
|---|---|---|---|---|
| cid | unique brand identifier | string | mandatory | identifier can be the same for all environments within the brand |
| productId | brand game identifier | string | mandatory | current identifiers: nft-aviatrix, second-chance, aviatrix-fruits |
| sessionToken | token with user session | string | mandatory when isDemo=false | token must be generated by the brand for further requests from server part of provider. Expected length: 1-255 symbols. Not required for demo mode |
| lang | language code | string | optional | format code ISO 639-1. Default value is en |
| lobbyUrl | lobby url | string | optional | needed for redirects to brand homepage |
| isDemo | demo mode flag | bool | mandatory for demo mode | needed to enable the demo mode of the game. Required parameter for demo mode |
| promoCode | promotional code | string | optional | needed for direct opening of the promo code entry form. If a value is passed (promoCode=promocode1&…), a modal window will open, and the input will be filled. If the parameter is empty (promoCode=&…), the entry form will open with an empty input value. |
| hideExitButton | controls the visibility of the menu exit button | string | optional | controls the visibility of the menu exit button, overriding its display if enabled in the config |
Example of the response from the server
HTTP/1.1 200 OK
{
"url": "https://domain.com?cid=somebrand&productId=nft-aviatrix&sessionToken=qwerty12345&lang=en&lobbyUrl=https://example.com"
}
| Parameter | Description | Type | Explanation |
|---|---|---|---|
| url | game launch URL | string | complete URL for launching the game with parameters |
/game/list
The method is used to display the list of games available for a brand.
Example of the request
Request headers specified in the example are required: Accept, Content-Type, X-Auth-Signature
POST /game/list HTTP/1.1
Content-Type: application/json
Accept: application/json
X-Auth-Signature: <signature>
{
"cid": "someplatform"
}
| Parameter | Description | Type | Requirements | Explanation |
|---|---|---|---|---|
| cid | unique brand identifier | string | mandatory | identifier can be the same for all environments within the brand |