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:
- Gather together query parameters into array
- Delete parameter 'clientId' from array with query parameters
- Sort array by parameter name alphabetically. If one of array values is array then it should be sorted by parameter name alphabetically too.
- 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.
- Concatenate the resulting string and your SECRET_KEY
- 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 Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| deviceType | Available options: “desktop”, “mobile” | Optional |
Response parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| id | Game identifier | Mandatory |
| title | Game title | Mandatory |
| providerGameId | Provider's game identifier | Mandatory |
| provider | Game provider code | Mandatory |
| categories | Game categories list. JSON-array | Mandatory |
| devices | List of device types where game is available. JSON-array | Mandatory |
| image | Game icon URL. Icon's size is 306x180 px. | Mandatory |
| table | Additional 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 Code | Message | Description |
|---|---|---|
| 400 | Not valid request | Incorrect request signature |
| 400 | Configuration error | Configuration of your client is wrong. Please, contact support. |
| 422 | Device 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 Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| gameId | Game identifier | Mandatory |
| lang | Client application localization language. Two-letters ISO language code. | Optional. Default value “en”. |
Response parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| gameUrl | URL to open game | Mandatory |
Errors returned
| HTTP Code | Message | Description |
|---|---|---|
| 400 | Not valid request | Incorrect request signature |
| 400 | Configuration error | Configuration of your client is wrong. Please, contact support. |
| 422 | Game not found | Game 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 Name | Description | Optional / Mandatory |
|---|---|---|
| sign | Request signature | Mandatory |
Request parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| clientId | Casino identifier. Sent in the request line | Mandatory |
| gameId | Game identifier | Mandatory |
| userId | User identifier | Mandatory |
| sessionId | Unique game session identifier | Optional |
| nick | User nickname. Will be displayed in the games (not for all providers). | Optional |
| currency | Currency ISO code | Mandatory |
| lang | Client application localization language. Two-letters ISO language code. | Optional. Default value “en”. |
Response parameters
| Parameter Name | Description | Optional / Mandatory |
|---|---|---|
| gameUrl | URL to open game | Mandatory |
| sessionId | Unique game session identifier | Mandatory |
Errors returned
| HTTP Code | Message | Description |
|---|---|---|
| 400 | Not valid request | Incorrect request signature |
| 400 | Configuration error | Configuration of your client is wrong. Please, contact support. |
| 422 | Game not found | Game related to “gameId” is not found |
| 422 | Currency not found | Currency related to “currency” is not found |
| 422 | Currency is not allowed for casino | Currency is not allowed to use for casino |
| 422 | Currency is not active | |
| 500 | Cannot create user | Error 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"
}
}
}