Skip to main content

Integration API

2.1 Setting up the API

Before you start integration, you will need to get the following information from us:

  • API_URL - URL to get access to the API
  • CLIENT_ID - ID of your casino that will be passed in the queries
  • SECRET_KEY - secret key to sign the queries

2.2 Interaction protocol

Communication via HTTP(S)-queries in JSON API format is used for integration. The query parameters can be passed in the query string (GET method) and in the query body (POST method). The response is passed in the JSON API format.

2.3 Security

In order to ensure API security, query signature generated with the help of the secret key is used. Query signature is validated on our server and in case it doesn’t match, the error will be returned.

Please be advised that it is necessary to contact our support team in you’re your secret key is disclosed.

Forming request

Steps to generate query signature:

  1. Gather together query parameters into array
  2. Delete parameter 'clientId' from array with query parameters
  3. Sort array by parameter name alphabetically. If one of array values is array then it should be sorted by parameter name alphabetically too.
  4. Concatenate values of array into one string. If one of array values is array then it's values should be concatenated to one string too.
  5. Concatenate the resulting string and your SECRET_KEY
  6. Get hash of the string using SHA256 algorithm

In the end your got signature to using in the queries.

Pseudocode for signature generation:

    function generateSignature(array params, string secretKey) {
if (exists key 'clientId' in array params) {
delete key 'clientId' from array params;
}

params = sortArray(params);

paramString = implodeArray(params);
paramString = concatString(paramString, secretKey);

signature = SHA256(paramString);

return signature;
}

function sortArray(array params) {
sortByKeys(params);

for each value with index key in params {
if value is array {
params[key] = sortArray(value);
}
}

return params;
}

function implodeArray(array params) {
paramString = '';

for each value in params {
if value is array {
paramString = concatString(paramString, implodeArray(value));
} else {
paramString = concatString(paramString, value);
}
}

return paramString;
}

2.4 API methods documentation


Swagger: http://api-demo.evenbetpoker.com/api/web/api-docs/demo#/casino-provider/


2.4.1 Game list request

Request returns list of casino games.

If parameter is not passed then request returns all casino games.

If passed "mobile" then request returns the games available for mobile devices.

If passed "desktop" then request returns the games available on desktop.

Request URL

GET http(s)://API_URL/casino-provider/games?clientId={CLIENT_ID}&deviceType={deviceType}


Request header (HTTP header)
Parameter NameDescriptionOptional / Mandatory
signRequest signatureMandatory

Request parameters
Parameter NameDescriptionOptional / Mandatory
clientIdCasino identifier. Sent in the request lineMandatory
deviceTypeAvailable options: “desktop”, “mobile”Optional

Response parameters

Parameter NameDescriptionOptional / Mandatory
idGame identifierMandatory
titleGame titleMandatory
providerGameIdProvider's game identifierMandatory
providerGame provider codeMandatory
categoriesGame categories list. JSON-arrayMandatory
devicesList of device types where game is available. JSON-arrayMandatory
imageGame icon URL. Icon's size is 306x180 px.Mandatory
tableAdditional info about Ezugi games. JSON associative array. Contains the following data:
id. Table id.
dealerName. Dealer name.
dealerImage. Link to dealer photo
availableSeats. Total seats on the table.
takenSeats. Amount of busy seats on the table.
languages. JSON array. List of languages (ISO-codes).
limits. JSON associative array. List of table limits. Contains the following data:
minBet. Min bet available on the table.
maxBet. Max bet available on the table.
Errors returned
HTTP CodeMessageDescription
400Not valid requestIncorrect request signature
400Configuration errorConfiguration of your client is wrong. Please, contact support.
422Device type is invalid

Example of response
{
"data": [
{
"id": "224",
"type": "game",
"attributes": {
"title": "Unlimited BJ",
"provider-game-id": 12,
"provider": "ezugi",
"categories": [
"card",
"live_dealer",
"blackjack"
],
"devices": [
"desktop",
"mobile"
],
"image": "http://casinoapp.passion.bet/images/ezugi/table_5051.png",
"table": {
"id": 51,
"dealer-name": "Elizabeth",
"dealer-image": "https://conf.livetables.io/LiveCasinoNew/BO/BizConfigs/Casino/Resources/Dealers/Images/Elizabeth_464.png",
"available-seats": 0,
"taken-seats": 0,
"languages": [
"en"
],
"limits": {
"103": {
"min-bet": "5",
"max-bet": "5000"
},
"107": {
"min-bet": "3",
"max-bet": "2500"
}
}
}
}
}
]
}

2.4.2 Open game in demo mode

Request returns link to game in demo mode.

The link to open the game (game URL) may be opened any way suitable for you: in a new window, in the current window, in a frame. Due to the specifics of realization, for mobile users the link must be opened in a new window.


Request URL

POST http(s)://API_URL/casino-provider/games/:gameId/session-demo?clientId={CLIENT_ID}


Request header (HTTP header)
Parameter NameDescriptionOptional / Mandatory
signRequest signatureMandatory

Request parameters
Parameter NameDescriptionOptional / Mandatory
clientIdCasino identifier. Sent in the request lineMandatory
gameIdGame identifierMandatory
langClient application localization language. Two-letters ISO language code.Optional. Default value “en”.

Response parameters
Parameter NameDescriptionOptional / Mandatory
gameUrlURL to open gameMandatory

Errors returned
HTTP CodeMessageDescription
400Not valid requestIncorrect request signature
400Configuration errorConfiguration of your client is wrong. Please, contact support.
422Game not foundGame related to “gameId” is not found

Example of response
{
"data": {
"id": "",
"type": "demo",
"attributes": {
"game-url": "https://ga1.game-program.com/!v8/views/gameart/game.js?sid=4e5674-61396564&locale=en",
}
}
}

2.4.3 Open game to play real money

Request returns link to game to play real money.

The link to open the game (game URL) may be opened any way suitable for you: in a new window, in the current window, in a frame. Due to the specifics of realization, for mobile users the link must be opened in a new window.


Request URL

POST http(s)://API_URL/casino-provider/games/{gameId}/session?clientId={CLIENT_ID}


Request header (HTTP header)
Parameter NameDescriptionOptional / Mandatory
signRequest signatureMandatory

Request parameters
Parameter NameDescriptionOptional / Mandatory
clientIdCasino identifier. Sent in the request lineMandatory
gameIdGame identifierMandatory
userIdUser identifierMandatory
sessionIdUnique game session identifierOptional
nickUser nickname. Will be displayed in the games (not for all providers).Optional
currencyCurrency ISO codeMandatory
langClient application localization language. Two-letters ISO language code.Optional. Default value “en”.

Response parameters
Parameter NameDescriptionOptional / Mandatory
gameUrlURL to open gameMandatory
sessionIdUnique game session identifierMandatory

Errors returned
HTTP CodeMessageDescription
400Not valid requestIncorrect request signature
400Configuration errorConfiguration of your client is wrong. Please, contact support.
422Game not foundGame related to “gameId” is not found
422Currency not foundCurrency related to “currency” is not found
422Currency is not allowed for casinoCurrency is not allowed to use for casino
422Currency is not active
500Cannot create userError during user creation

Example of response
{
"data": {
"id": "",
"type": "demo",
"attributes": {
"game-url": "https://ga1.game-program.com/!v8/views/gameart/game.js?sid=4e5674-61396564&locale=en",
"session-id": "837ad06f8527945a1ab0a434dffc1402"
}
}
}