Open lobby
In order to open the lobby, use the link sent as a response for the request to create a session. The following diagram describes the interactions between a player, your casino and EBG when a user opens the lobby for the first time after the registration.
The link to open the lobby (lobby URL) may be opened any way that suits you: in a new window, in the current window, in an iframe. On mobile platforms, the URL should be open in a new window for it to be displayed correctly.
NOTE: Please use this tool to check your integration implementation for user authorization: https://tests.evenbetgaming.com/opensession/
Creating a session
Request URL
POST http(s)://API_URL/v2/app/users/:userId/session?clientId={CLIENT_ID}
Request header (HTTP Header)
Parameter Name | Description | Optional / Mandatory |
---|---|---|
sign | Request signature. Can be mandatory if the client has a secret key; otherwise, it is optional. | Mandatory |
Content-Type | Request format. Supported: application/x-www-form-urlencoded | Optional |
accept | Response format. Supported: application/vnd.api+json | Optional |
Request parameters
Parameter Name | Description | Optional / Mandatory | Type |
---|---|---|---|
clientId | Casino identifier that is sent in the request line. | Mandatory | string |
userId | User identifier. | Mandatory | string |
userIp | User IP. This parameter is only relevant if you want to open a specific casino game or sport. | Optional | string |
sessionId | External session identifier. If specified, can be used in seamless wallet callbacks. | Optional | string |
nick | nickName or displayName (variable) may be sent. | Optional | string |
authType | Authorization type. Possible values: internal, external. You need to send the value 'external' in case you open html5 application in browser, and internal in case the session is created in the client application (desktop or mobile). | Optional. Default value is 'external'. | string |
lang | Client application localization language. It is a two-letters ISO language code. | Optional. Default value “en”. | string |
launchOptions | Additional launch options for html5-application. It is a JSON associative array. | Optional | string |
currency | ISO currency code. Specified currency will be used as default user currency. It must be configured before use. | Optional | string |
gameCode | Possible values: poker, casinolobby, casino, sport. 'Poker' opens HTML5 poker app or localhost and sends all parameters there or it opens a specific table; 'casinoLobby' opens the URL that is specified as casino URL and sends the data there; 'casino' opens a specific casino game; 'sport' opens sportsbook or a specific sports game. If you do not set the value for this parameter, poker will be opened. | Optional | string |
tableID | This parameter specifies the cash table that must be opened. | Optional | integer |
gameID | This parameter specifies the game that must be opened. It could be the ID of a casino or sports game. | Optional | string |
longLifeLoginToken | This parameter specifies whether a long-life access token is used for opening a session. Long-life tokens allow for longer uninterrupted user sessions. The lifetime of the of the token can be specified in System configuration - LongAuthorizationTicketLifetime | Optional Possible values: true and false | boolean |
Possible launch options
Option Name | Description |
---|---|
restoreSessionUrl | URL to your server. If user session expired in html5 application, then the user will be redirected to this URL. The user should be logged in again, then a new session should be created and the user should be redirected to the given redirect link. |
Here are the values for optional parameters required to open various parts of client application:
- Poker lobby
- gameCode = poker
- authType = internal, external
- launchOptions = additional launch options (optional)
- Poker table
- gameCode = poker
- authType = internal, external
- tableId = table identifier
- launchOptions = additional launch options (optional)
- Casino lobby
- gameCode = casinoLobby
- launchOptions = additional launch options (optional)
- Casino game
- gameCode = casino
- gameId = game identifier
- currency = currency ISO code
- userIp = user IP
- Sport
- gameCode = sport
- currency = currency ISO code (optional)
- userIp = user ip
- Sport game
- gameCode = sport
- gameId = game identifier
- currency = currency ISO code (optional)
- userIp = user ip
Example of request
curl -X POST
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Accept: application/vnd.api+json'
--header 'sign: 9b1a1b25fc228b0b7dcabfc76355c29f817ccf26f69c27a4821526c35c683932'
-d 'nick=MyUser&password=123123¤cy=USD'
'https://domain.com/api/web/v2/app/users/100/session?clientId=customerClientId'
Response parameters
Parameter Name | Description | Optional / Mandatory |
---|---|---|
redirect-url | URL to open lobby | Mandatory |
session-id | Session identifier | Mandatory |
user-id | User identifier | Mandatory |
auth | Authorization token | Mandatory |
Errors returned
HTTP Code | Message | Description |
---|---|---|
400 | Not valid request | Incorrect request signature |
404 | Player not found | The user with userId sent was not found (in case our own userId was sent) |
422 | Auth type not valid | authType parameter value is given but it does not match any of the possible values |
Currency cannot be blank | Param 'currency' is required but was not sent. An error may occur only if param 'currency' was configured as mandatory. | |
Currency not found | Currency with ISO code sent was not found. An error may occur only if param 'currency' was configured as mandatory. | |
This currency is not active | Currency with ISO code sent is not active. An error may occur only if param 'currency' was configured as mandatory. | |
500 | A Player with this username already exists in the system. | User with this nickname is already registered in the system |
The maximum username length is X | Maximum length of nickName is exceeded |
Example of response
{
"data": {
"id": "4C8CE15B8F70AEB285EC7F1C6D41177E",
"type": "session",
"attributes": {
"user-id": "100",
"redirect-url": "https://domain.com/html5/?auth=4C8CE15B8F70AEB285EC7F1C6D41177E&lang=en",
"auth": "4C8CE15B8F70AEB285EC7F1C6D41177E",
"session-id": "EXT71320A34488F39BCBD5FF66770AD73FB"
}
}
}