Operator API Overview
Core APIs for Operator API
Operator API caters to all Operators whose goal is to integrate games into a third-party application through Hub88. For this, the following types of APIs are provided:
Games API - allows Operators to request and receive the list of available games, which are provided and implemented by Hub88.
Wallet API - an API for Seamless wallets, which Hub88 triggers to update the user's balance. For this API, the Operator needs to provide corresponding endpoints based on the given API structures.
TransferWallet API - an optional API for Transfer wallets, which is available by request. The API provides a way for the Operator to deposit money to the player's account, withdraw money from the player's account and get the player's balance. Availability of TransferWallet API is per request.
Freebets API - an API for granting rewards, such as free spins, free bets and prizes to one or multiple users. First-time user's bonuses are supported by most suppliers, however, in some cases a player must interact with the game before a free bet can be granted.
Recommendations API - Games' recommendation to an Operator based on player's interactions (game plays) on Hub88 platform.
Transactions API - an API which provides a list of all user's gameplay transactions.
On-Demand API - Specialized APIs available upon request. For accessing or setting up this functionality, please contact your technical contact on Hub88's side.
Getting started
To get started with setting up your integration with Hub88, you'll need to have the following:
a public API key provided by Hub88;
a private / public key pair that you generate yourself;
an Operator ID provided by Hub88;
a Game ID provided by Hub88.
To receive a public key provided by Hub88, you'll need to contact sales@hub88.io. They'll trigger the process from technical integrations side, the process should be as follows:
Receive a public key sent from Hub88.
To generate a private / public key pair on your side, run the following commands:
openssl genrsa -out private.pem 2048
openssl rsa -pubout -in private.pem -out public.pem
Send the public key to Hub88. Hub88 uses this public key to verify the Games API requests.
Request signing logic for Operator API
The body of all requests will be signed with RSA-SHA256
using the respective private key and encoded to BASE64. The signature will be placed in the X-Hub88-Signature
header.
Games API
All Games API requests have to be signed by Operator.
Hub88 verifies all Games API requests using the public key provided by the Operator.
Wallet API
All Wallet API requests have to be signed by Hub88.
The Operator needs to verify all Wallet API requests using the public key provided by Hub88.
All TransferWallet API requests must be signed by the Operator.
We have code examples in a few programming languages, to get you started.
X-Hub88-Signature error:
Ensure the X-Hub88-Signature has no whitespaces or beautifiers. The signature must match the body exactly—any difference will result in an "invalid signature" error.
Example:
Private key example for signing the example request here.
Request consistency
Wallet API requests have to be idempotent. All transactions contain a transaction_uuid
field. The Operator has to ensure that requests with the same transaction_uuid
are not processed twice, while the response has to be the same for all duplicate requests. The operator may ignore the idempotency requirement for the /user/balance
call.
Gameplay overview
Once you meet the prerequisites, the process is as follows:
Obtain a game URL from Hub88.
Direct the customer to the URL provided by Hub88.
Respond to in-game events sent by Hub88 and update the customer's balance (SEAMLESS WALLET ONLY)
The high level gameplay corresponds to the core communications flow between Supplier and Operator APIs.
Note that the process is different for DEMO and REAL gameplay modes. In DEMO mode, user can open the game, check the rules/graphics/paytable, and play with fun mode money. Not all game providers allow DEMO gameplay (none of Live Dealers allow it)
Demo gameplay
Operator makes a Game API call to
/game/url
to obtain game launch URL. For DEMO mode, Operator has to pass"currency":"XXX"
. Parameterstoken
,user
may be omitted.When the game URL is returned, the Operator uses it to direct the player to the game (for example, launch it in iframe or redirect the player to the URL).
In DEMO mode, no calls to Operator's API are made because providers handle the balance themselves. If player liked the game and wants to switch to REAL mode, Operator should proceed with the next steps.
Real gameplay
The Operator generates and stores a unique game session token.
The Operator makes a Game API call
/game/url
and passes the generated token along with the other request parameters. NB!: In case of SEAMLESS WALLET integration, Operator needs to be ready to respond to balance API calls even before getting the game URL back.When the game URL is returned, the Operator uses it to direct the player to the game (for example, launch it in iframe or redirect the player to the URL).
Following steps are for SEAMLESS WALLET integration only. In case of TransferWallet integration, all game actions and balance updates will be handled on Hub88 side.
When the game URL is loaded in the browser, Hub88 server makes a Wallet API call /user/balance to the Operator's server.
The Operator verifies the token against the stored token and returns the user's balance. The user can then place a bet.
When the user attempts to place a bet, a Wallet API call /transaction/bet is triggered on the Operator's server.
The Operator verifies the token, ensures that the user has enough money for this bet, decreases the user's balance by the bet amount, and returns the updated user's balance.
If the user wins, the Wallet API triggers a call /transaction/win on the Operator's server.
The Operator verifies the token, increases the user's balance by the win amount, and returns the updated user's balance.
Behaviour in case of user's loss depends on game provider's internal logic. Possible options:
Nothing is sent
Sent win with amount 0
Last updated
Was this helpful?