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 | Mandatory |
Request parameters
Parameter Name | Description | Optional / Mandatory |
---|---|---|
clientId | Casino identifier that is sent in the request line. | Mandatory |
userId | User identifier. | Mandatory |
userIp | User IP. This parameter is only relevant if you want to open a specific casino game or sport. | Optional |
sessionId | External session identifier. If specified, can be used in seamless wallet callbacks. | Optional |
nick | nickName or displayName (variable) may be sent. | Optional |
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'. |
lang | Client application localization language. It is a two-letters ISO language code. | Optional. Default value “en”. |
launchOptions | Additional launch options for html5-application. It is a JSON associative array. | Optional |
currency | ISO currency code. Specified currency will be used as default user currency. It must be configured before use. | Optional |
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 |
tableID | This parameter specifies the cash table that must be opened. | Optional |
gameID | This parameter specifies the game that must be opened. It could be the ID of a casino or sports game. | Optional |
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 |
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
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": "",
"type": "session",
"attributes": {
"redirect-url": "",
"session-id": "",
}
}
}