Game Launch Url
Overview
For launching game you need to put iframe tag on the page and specify launching url in src tag.
<head>
<title>Page</title>
</head>
<body>
<iframe src="https://example.com/game-launch-url"></iframe>
</body>
You can request launching url using this URL:
POST /open-api-games/v1/game-launch-url
Parameters
Request:
| Name | Type | Description |
|---|---|---|
clientId | string | Client id. Can be optional if client id provided through query params |
platformId | string | Platform id |
sessionId | string | Game session id |
gameId | string | Game id |
accountId | int | Account id |
deviceType | string | Device type of user: dt_desktop, dt_mobile |
currency | string | Currency of user |
language | string | Language of user |
userId | string | User Id from platform side (for games storing history, like bets) |
homeUrl | string | Absolute url of home page (will be used for home button, if present) |
refillUrl | string | Absolute url of refill page (will be used for refill button, if present |
country | string | Country of user requesting game launch. ISO 3166-1 alpha-2 |
Response:
| Name | Type | Description |
|---|---|---|
api | string | Name of operation: “debit”, “credit”, “rollback” |
isSuccess | boolean | Is success? |
error | string | Empty string if isSuccess == true. |
errorMsg | string | Error code, see “Errors” table |
data | object | |
data.src | string | URL to start game |
data.isSetLocation | string | true - needs to be opened in new page, false - in iframe |
Errors:
| Name | Description |
|---|---|
| NO_ERRORS | No errors. Passed if isSuccess == true. |
| INVALID_BODY | Invalid request body. |
| INVALID_CLIENT_ID | Invalid client id. |
| WRONG_PLATFORM_ID | Wrong platform id. |
| UNKNOWN_ACCOUNT | Unknown account id. |
| GAME_NOT_FOUND | Specified game id not found. |
| UNSPECIFIED_LAUNCH_METHOD | Launch method is unavailable. |
| INTERNAL_ERROR | Server error. |
Example
Request:
curl --location --request POST 'https://apiEndpoint/open-api-games/v1/game-launch-url' \
--header 'Content-Type: application/json' \
--data '{
"platformId" : "platform-id",
"clientId" : "client-id",
"sessionId" : "session-id",
"gameId" : "game-id",
"accountId" : 111,
"deviceType" : "dt_desktop",
"currency" : "USD",
"language" : "en_US",
"userId" : "some-user-id",
"homeUrl" : "https://example.com",
"refillUrl" : "https://example.com/refill",
"country": "US"
}'
Response:
{
"isSuccess": true,
"error": "NO_ERRORS",
"errorMsg": "",
"data": {
"src": "https://example.com/game-launch-url",
"isSetLocation": "true"
}
}