Open Game
Generate game launch URL for 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, default is 0 |
lobbyUrl | string | No | Lobby URL to return to if the game has an error (must use https) |
username | string | No | Player Account (allowed to be empty or omitted when launchType is 1) |
backButton | number | No | Whether the back button is displayed, 0: No, 1: Yes, default is 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 game launch (used by some Games, usually null) |
data.gameLaunchUrl | string | Game launch URL (opens 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 | Game does not exist, or has been delisted, please confirm if gameCode is correct |
| 7 | Internal server error | Internal server error, please try again later or Contact Customer Support Team |
| 8 | The User is not exist | Player does not exist, please Create Player first |
| 11 | Parameters error | Please ensure the request parameters are complete and correctly formatted |
| 19 | Invalid account | Invalid Player Account, please check 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 if the Site ID corresponds to the Player |
| 86 | Game is restricted | Please refer to the Game List document or inquire with 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"
}
Important Notes
Special Notes
-
ipaddress Usage Restrictions:
- Only one IP address can be provided
- If launchType is 1 (demo mode), a virtual IP can be provided
-
Relationship between username and launchType:
- When launchType is 1 (demo mode), username is allowed to be empty or omitted
- When launchType is 0 (both) or 2 (real), username must be provided
-
lobbyUrl Format Requirements:
- If lobbyUrl is provided, the URL must use the https protocol
General Notes
-
URL Validity:
- Game URLs are usually valid for 5 minutes
- Needs to be re-acquired after expiration
- A URL can only be used once
-
Return Handling:
- lobbyUrl will be used when Player closes the game
- It is recommended to set it to the Game lobby page
-
Play Mode:
- When launchType is 2 (real), the official mode can be played
- When launchType is 1 (demo), the demo mode can be played
- When launchType is 0 (both), Player can choose to play official or demo mode on the Game screen
- Playing in demo mode allows omitting Player Account; if provided, Player can switch to official mode within the game
-
Concurrency Restrictions:
- A Player can only open one Game link at a time (dual-opening is not supported)
- Opening a new Game will automatically close the old link
Common QA
Q1: How will an error in the Game affect the display within the Game?
A: Depending on the error, it will be determined whether to jump out or stay in the Game after confirming the prompt message; not all errors will cause the Game to close and jump directly.
Q2: How will the presence or absence of lobbyUrl affect in-Game redirection?
A: Following up on the previous question, if the error requires redirection, it will redirect according to lobbyUrl; if no lobby URL is provided, the window will be closed.
Q3: What error scenarios will lead to redirection?
A: Due to numerous situations, if you need more details, please contact Customer Support for further Description.