2. Game Launcher

2. Game Launcher

To launch any provider’s game in GM-Ag, the brand needs to Get a Player Token and Create a Game Launch URL. The launch URL redirects the Player to the game if correct parameters are passed. 

Game Launching Flow 

Step 1, player clicks a game on brand’s casino website. 

Step 2, brand sends GetPlayerToken request to get a game launch token. 

Step 3, brand gets token and creates a game launch URL with the token and extra parameters.

Step 4, brand redirects to the launch URL.

Step 5, the player gets the game.

URI & Parameters

1. Get Player Token

URl: https://{{gmag_api_url}}/player/getToken?hash={{xxx}}.

Method: POST.

Purpose: used to get a player’s token to launch a game.

Please refer to GetPlayerToken.

2. Create a Game Launch URL(direct enter the game)

URI: https://{{gmag_game_launch_url}}/launcher.

Method: GET.

Purpose: the brand creates a game launching URL with the token and extra parameters below, and redirects the URL to get game content.

Request

Name

Type

Required

Description

Name

Type

Required

Description

gameCode 

String(32)

Yes 

Identifies the game to be launched.

token

String(256)

Yes 

The token retrieved via /player/getToken.

platform 

String(16)

Yes 

Client platform where the game is launched. (web, mobile, download) 

language 

String(8)

Yes 

Language of the game being launched. All language code, please refer to https://globaltllc.atlassian.net/wiki/pages/createpage.action?spaceKey=GAG1&title=Transfer%20Wallet%20Language%20Code&linkCreation=true&fromPageId=1243512915.

tableAlias 

String(32)

No 

Used for opening a specific Live table instead of a Live lobby.

playerId 

String(24)

Yes 

The unique ID identified a Player on the brand’s side.

brandId 

Int

Yes 

The unique ID for an brand.

mode 

Int

No 

Defines whether the game should be opened in a fun or real mode. The default is real (1), in case the real Mode parameter is not passed. (0 = fun, 1 = real) 

backUrl 

String(1024)

No 

URL to the lobby page.

cashierUrl 

String(1024)

No 

URL to the deposit page.

currency

String(4)

Yes 

adding on 12/12/2023
which currency use in the game.

hash

String(34)

No 

adding on 12/03/2025
this field using prevent the player manual change game code. if it is not empty.

generate hash MD5(brandId+playerId+gameCode+SecretKey)

 

if hash is not matched will return error “can not switch game“

Response

1. Success response

If correct parameters are sent to the GM-Ag system, the game content will be shown to the player. 

2. Failed response

When an error occurs, the redirect link defined in the parameter ‘backUrl’ will be sent back. Furthermore, at the end of the link, an error code and error message will be attached to show where the issue is. 

For example, if the ‘backUrl’ in the request is:

https://www.brand-back-url.com

then the response with a failed message is: 

https://www.brand-back-url.com?error={{code}}&message={{error_message}}.

Request example

https://{{gmag_game_launch_url}}/launcher?gameCode=bfb&token=xxxx&platform=web& language=en&playerId=1234&brandId=101&mode=0&backUrl=backUrl&cashierUrl=cashierUrl

 

3. Get Enter Game URL

URI: https://{{gmag_game_launch_url}}/launcher/getUrl

Method: POST.

Purpose: Getting the enter game URL

Request

Request content type using application/json

Name

Type

Required

Description

Name

Type

Required

Description

gameCode 

String(32)

Yes 

Identifies the game to be launched.

token

String(255)

Yes 

The temp token to be used to authenticate the game launch against the Brand Wallet.

platform 

String(16)

Yes 

Client platform where the game is launched. (web, mobile) 

language 

String(8)

Yes 

Language of the game being launched. All language code, please refer to .

tableAlias 

String(32)

No 

Used for opening a specific Live table instead of a Live lobby.

playerId 

String(20)

Yes 

The unique ID identified a Player on the brand’s side.

brandId 

Int

Yes 

The unique ID for a brand.

mode 

Int

No 

Defines whether the game should be opened in a fun or real mode. The default is real (1), in case the real Mode parameter is not passed. 0 = fun, 1 = real, 2 = guest(use for sports providers, eg: IBC, BetBy)

backUrl 

String(1024)

No 

URL to the lobby page.(before sending should encode this url)

cashierUrl 

String(1024)

No 

URL to the deposit page.(before sending should encode this url)

currency

String(4)

Yes 

adding on 12/12/2023
which currency use in the game.

 

Response

Response content type using text/plain;charset=UTF-8

  1. Success response

Return the link text to enter the game

  1. Failed response

If the backUrl parameter is not empty then return to that address, otherwise use the default address and add error and message parameters.

Request example

{ "gameCode":"lobby", "token":"4MDljZWZiNTdhMWM2M3edcSJ90192", "platform":"web", "language":"en", "playerId":"1003233", "brandId":"100", "mode":"1", "backUrl":"http://google.com" }

Response example

//success https://sg-server.ggravityportal.com/GameLauncher/Loader.aspx?GameCategory=Slots&GameName=Samurai&Token=stst173015908254861110274786&PortalName=goldenmatrix&ReturnUrl=https://bof.gmgoldmtn.com&Lang=en //error http%3A%2F%2Fgoogle.com?error=P_19&message=Player info not matched 'PlayerId: qs7kDbeJ != 1003'