Open Game
Generate a game launch URL for a player.
API Information
- URL:
POST /v2/opengame - Authentication:Bearer Token
- Encryption:Requests are encrypted using AES-256-GCM; responses are returned as plaintext JSON
request
Request Headers
POST /v2/opengame HTTP/1.1
Host: api.example.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
x-agentid: integratorNBTest04
x-timestamp: 1769746894501
x-nonce: 56ffd5ecd8a3a4457863a0bd7c298fb2
x-signature: c25f8d23704373e8776cce6d9b10f1fde091c34db80d60523c7e04ff30e54633
Request Parameters
Parameters Before Encryption
{
"deviceType": 0,
"ipaddress": "35.200.72.205",
"lang": "en",
"lobbyUrl": "https://example.com",
"gameCode": "VP_230001_1",
"launchType": 1,
"username": "testaccount01",
"backButton": 0
}
Encrypted Request Body
{
"cipherText": "G0ZMDELeJwx+7JcIfIFOLJjkSzANPu6krGM2uw==..."
}
| Field | Type | Required | Description |
|---|---|---|---|
deviceType | number | Yes | Device type: 0 = PC, 1 = Mobile device |
ipaddress | string | Yes | Player IP address (only one IP address can be provided) |
lang | string | Yes | Game interface language |
gameCode | string | Yes | Game Code |
launchType | number | Yes | Launch type: 0 = both, 1 = demo, 2 = real; defaults to 0 |
lobbyUrl | string | No | Lobby URL to return to when a game error occurs (must use https) |
username | string | No | Player Account (may be omitted or left empty when launchType is 1) |
backButton | number | No | Whether to show the back button, 0: No, 1: Yes; defaults to 0 |
Response
Success Response
{
"code": 0,
"message": "No error.",
"data": {
"gameLaunchHtml": null,
"gameLaunchUrl": "https://staggp.zzzstkk.com/game/230001/3.55.0?a=integratorNBTest04_VPSysDevTest010&g=230001&p=3UWzoOtmcKcdZbQnEiHwHbBn9i3w4y__R_DuvopsoYemrFfczHqZGciqR5YvDkTn...",
"mode": "real"
},
"logUUID": "23c50208-cd0f-4daa-be3c-f346da188107"
}
Response Field Description
| Field | Type | Description |
|---|---|---|
data.gameLaunchHtml | string | null | HTML content for launching the game (used by some games, usually null) |
data.gameLaunchUrl | string | Game launch URL (open in a new window or iframe) |
data.mode | string | Game mode: "real" (real-money mode) or "demo" (demo mode) |
Error Response
When the request fails, the corresponding error code will be returned.
Error Codes
| Code | Description | Handling Suggestion |
|---|---|---|
| 5 | Game is not found | The game does not exist or has been removed; please confirm whether the gameCode is correct |
| 7 | Internal server error | An internal system error occurred; please try again later or contact Customer Support Team |
| 8 | The User is not exist | The player does not exist; please create the player first |
| 11 | Parameters error | Please ensure the request parameters are complete and correctly formatted |
| 19 | Invalid account | The Player Account is invalid; please check the Player Account |
| 81 | Branch config not found | Branch configuration not found; please contact Customer Support Team |
| 82 | Please check Site ID is for this player | Please confirm whether the Site ID corresponds to this player |
| 86 | Game is restricted | Please refer to the Game List documentation or contact Customer Support |
Error Response Example
{
"code": 5,
"message": "Game is not found",
"logUUID": "24cdc3b9-9fe8-44de-8391-a96863e46954"
}
{
"code": 8,
"message": "The User is not exist",
"logUUID": "24cdc3b9-9fe8-44de-8391-a96863e46954"
}
{
"code": 11,
"message": "Parameters error, Username is required when launchType is not demo",
"logUUID": "24cdc3b9-9fe8-44de-8391-a96863e46954"
}
Important Notes
Special Notes
-
ipaddress usage restrictions:
- Only one IP address can be provided
- If launchType is 1 (demo mode), a virtual IP may be provided
-
Relationship between username and launchType:
- username may be omitted or left empty only when launchType is 1 (demo mode)
- username must be provided when launchType is 0 (both) or 2 (real)
-
lobbyUrl format requirements:
- If lobbyUrl is provided, the URL must use the https protocol
General Notes
-
URL validity period:
- The game URL is typically valid for 5 minutes
- It must be reacquired after it expires
- A URL can only be used once
-
Return handling:
- lobbyUrl is used when the player closes the game
- It is recommended to set this to the game lobby page
-
Play mode:
- When launchType is 2 (real), the player plays in real-money mode
- When launchType is 1 (demo), the player plays in demo mode
- When launchType is 0 (both), the player can choose to play in real-money or demo mode from within the game screen
- In demo mode, the Player Account may be omitted; if it is provided, the player can switch to real-money mode from within the game
-
Concurrency limit:
- The same player can only open one game session at a time (simultaneous sessions are not supported)
- Opening a new game will automatically close the previous session
-
Back button restriction:
- When the backButton parameter is set to show (1), lobbyUrl becomes required; otherwise, error code 11 will be triggered
Frequently Asked Questions
Q1: If an error occurs in the game, how does it affect what is displayed in the game?
A: Depending on the error, after the confirmation message is acknowledged, the player will either be redirected away or remain in the game. Not all errors cause the game to end and redirect immediately.
Q2: How does the presence or absence of lobbyUrl affect redirection within the game?
A: Following on from the previous question, if the error requires a redirect, it will redirect based on lobbyUrl; if lobbyUrl is not provided, the window will simply close.
Q3: What error scenarios cause a redirect?
A: There are many possible scenarios; if you need further details, please contact Customer Support for a more detailed description.