This Provider API Endpoint lets an Operator trigger a fun-mode game launch on the Provider by sending player and session details, and receiving back a game launch URL that can be opened in an iframe or new tab. It defines the request/response structure, including expected fields like Game Identifier, along with status codes to ensure reliable integration and handling of success or failure when launching games in fun-mode via the /fun-launch API. Unlike real launch /launch, no webhooks are sent for the resulting Fun Launch Session. Moreover, bets do not affect player's balance in Operator.
/fun-launch
gameId is the only required property here. All other properties are made optional.ip, playerToken, and uniqueId properties are made unavailable here.Request Headers
| Key | Value Type | Required | Description |
|---|---|---|---|
authorization |
string | Yes | API Authorization token |
Content-Type |
string | Yes | Strictly application/json |
Request Body
| Key | Value Type | Required | Description |
|---|---|---|---|
balance |
number | No | Balance of the player. |
brandId |
string | No | Brand ID of the player. Must not contain forward slash |
brandName |
string | No | Brand Name of the player |
country |
string | No | Country of the player. Follows ISO 3166-1 alpha-2 standard. Must be two uppercase characters. |
currency |
string | No | Currency Code of the balance. Follows ISO 4217 standard. Must be uppercase. |
gameId |
string | Yes | Identifier of game to be launched. |
homeAction |
HomeAction | No | Determines Home button behavior (POST_MESSAGE or REDIRECT_TO) |
homeUrl |
string | No | Redirect destination when Home button is clicked |
lang |
string | No | UI language used in the launched game. Language code follows ISO 639-1 standard. Must be two lowercase characters. |
playerId |
string | No | Player identifier. Must not contain forward slash |
Response Body
| Key | Value Type | Required | Description |
|---|---|---|---|
status |
FunLaunchResponseStatus | Yes | See FunLaunchResponseStatus. |
statusCode |
number | Yes | See ProviderResponseStatusCode reference. |
statusMessage |
string | No | Verbose human-friendly description of the status. |
success |
boolean | Yes | Indicates if the request was successfully processed. |
uniqueId |
string | Yes | Operator-generated UUIDv4. Same value from API request. |
url |
string | Yes | Fun Launch URL to use in the iframe or web page to launch the game in Fun Mode. |
| Status Code | Status | Description |
|---|---|---|
| 0 | OK |
Player was successfully launched in Fun Mode. |
| 50 | INTERNAL_ERROR |
Some internal error happened within the Provider when trying to launch the player. |
| 51 | PLAYER_NOT_FOUND |
Player was not found as per the supplied playerId. |
| 55 | RESTRICTED_COUNTRY |
Player is of a restricted country and cannot be launched. |
| 58 | INVALID_GAME_ID |
Operator supplied invalid gameId in launch request. |
| 63 | GAME_IS_IN_MAINTENANCE_MODE |
Provider is in maintenance mode and cannot accept any new player launches. |
| 66 | LAUNCH_IS_IN_PROGRESS |
Player launch is already in-progress. Player with this playerId cannot be launched again. |
| 67 | RESTRICTED_JURISDICTION |
Player is of a restricted jurisdiction and cannot be launched. |
curl -X POST "https://< Provider API Base Path - Contact Technical Support >/fun-launch" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "authorization: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" \
--data '{
"gameId": "1001"
}'
Request Body
{
"gameId": "1001"
}
OK
{
"status": "OK",
"statusCode": 0,
"success": true,
"url": "..."
}
INTERNAL_ERROR
{
"status": "INTERNAL_ERROR",
"statusCode": 50,
"success": false
}
INVALID_GAME_ID
{
"status": "INVALID_GAME_ID",
"statusCode": 58,
"success": false
}
LAUNCH_IS_IN_PROGRESS
{
"status": "LAUNCH_IS_IN_PROGRESS",
"statusCode": 66,
"success": false
}
GAME_IS_IN_MAINTENANCE_MODE
{
"status": "GAME_IS_IN_MAINTENANCE_MODE",
"statusCode": 63,
"success": false
}
PLAYER_NOT_FOUND
{
"status": "PLAYER_NOT_FOUND",
"statusCode": 51,
"success": false
}
RESTRICTED_COUNTRY
{
"status": "RESTRICTED_COUNTRY",
"statusCode": 55,
"success": false
}
RESTRICTED_JURISDICTION
{
"status": "RESTRICTED_JURISDICTION",
"statusCode": 67,
"success": false
}
Operators can implement the "Home" button feature by adding two optional parameters to their launch request:
homeAction: This parameter accepts either POST_MESSAGE or REDIRECT_TO as its value.homeUrl: This is the URL to which the player will be redirected upon clicking the home button.If you open the game in a new window or tab, use the REDIRECT_TO method.
If you open the game within an iFrame, opt for the POST_MESSAGE method. In this scenario, the main website can handle the postMessage as demonstrated in the following example:
function handleiMoonMessages(message) {
if (!message.data) return;
const { action, payload } = message.data;
switch (action) {
case "HOME":
handleHomeAction(payload);
break;
case "INSUFFICIENT_FUNDS":
handleInsufficientFunds(payload);
break;
}
}
// Listen for messages from iFrames
window.addEventListener("message", handleiMoonMessages);
// Define action handlers
function handleHomeAction(payload) {
console.log("handleHomeAction:", payload);
// Implement code to manage the "Home" action here
}
function handleInsufficientFunds(payload) {
console.log("handleInsufficientFunds:", payload);
// Implement code to manage insufficient funds here
}
The webhook authorization token is required by iMoon from the
operator and can be in various forms like JWT, UUID, or string, depending on the
operator's preferences. This token is used by iMoon to make calls to the
operator's webhooks. After the questionnaire is completed, iMoon provides the
operator with an API authentication token, which is a JWT needed for
calling iMoon's APIs.
In this context,
API refers to the endpoint that the operator consumes for launching
the game, such as the Launch and Games APIs provided by iMoon. On the
other hand, webhook refers to the URLs produced by the operator for
multiple functionalities like Player Info, Bet, Result, and Rollback. iMoon calls
these webhooks to enable the operator to update and report back on their internal
state.