Skip to main content

Open Game

Generate a 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==..."
}
FieldTypeRequiredDescription
deviceTypenumberYesDevice Type: 0 = PC, 1 = Mobile Device
ipaddressstringYesPlayer IP address (only one IP address can be provided)
langstringYesGames interface Language
gameCodestringYesGame Code
launchTypenumberYesLaunch Type: 0 = both, 1 = demo, 2 = real, default is 0
lobbyUrlstringNoLobby URL to return to if Games is abnormal (must use https)
usernamestringNoPlayer Account (can be empty or omitted when launchType is 1)
backButtonnumberNoWhether 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

FieldTypeDescription
data.gameLaunchHtmlstring | nullHTML content for Games launch (used by some Games, usually null)
data.gameLaunchUrlstringGames launch URL (open in new window or iframe)
data.modestringGames mode: "real" (real money mode) or "demo" (demo mode)

Error Response

When the request fails, the corresponding error code will be returned.

Error Codes

CodeDescriptionHandling Suggestion
5Game is not foundGames not found, delisted. Please confirm if gameCode is correct
7Internal server errorInternal server error. Please retry later or Contact Customer Support Team
8The User is not existPlayer does not exist. Please Create Player first
11Parameters errorPlease ensure the request parameters are complete and correctly formatted
19Invalid accountInvalid Player Account. Please check Player Account
81Branch config not foundBranch config not found. Please Contact Customer Support Team
82Please check siteId is for this playerPlease confirm if siteId corresponds to this Player
86Game is restrictedPlease refer to the Game List document or inquire 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

  1. ipaddress Usage Restrictions:

    • Only one IP address can be provided
    • If launchType is 1 (demo mode), a virtual IP can be provided
  2. Relationship between username and launchType:

    • username is allowed to be empty or omitted only when launchType is 1 (demo mode)
    • When launchType is 0 (both) or 2 (real), username must be provided
  3. lobbyUrl Format Requirements:

    • If lobbyUrl is provided, the URL must use the https protocol

General Notes

  1. URL Validity Period:

    • Games URL is usually valid for 5 minutes
    • Needs to be reacquired after expiration
    • A URL can only be used once
  2. Return Handling:

    • lobbyUrl will be used when Player closes Games
    • It is recommended to set it as the Games lobby page
  3. Play Mode:

    • When launchType is 2 (real), you can choose to play in real mode
    • When launchType is 1 (demo), you can choose to play in demo mode
    • When launchType is 0 (both), Player can choose to play in real or demo mode on the Games screen
    • Player Account can be omitted when playing in demo mode; if provided, Player can switch to real mode within the Games
  4. Concurrency Restriction:

    • The same Player can only open one Games link at a time (dual-opening is not supported)
    • Opening a new Games will automatically close the old link
  5. Back Button Restriction:

    • When the backButton parameter is set to display (1), lobbyUrl is Required, otherwise it will Trigger code 11 error

Common QA

Q1: How will an anomaly occurring in Games affect the display within Games?

A: Depending on the error, it will be decided whether or not, after confirming the prompt message, to jump out or stay in Games; not all errors will lead to Games ending and jumping out immediately

Q2: How does the presence or absence of lobbyUrl affect jumping within Games?

A: Following the previous question, if the error requires a jump, it will jump according to lobbyUrl. If no lobbyUrl is provided, the window will be closed

Q3: What error scenarios will lead to a jump?

A: As there are many situations, please contact Customer Support for further Description if you need details