MG+ K2 Common Wallet API Integration Quick Guide
Breadcrumbs

Sessions

The sessions request allows you to request a game session from MG+.

In response, the API will provide you with a URL that can be used to launch the desired content within the specified game session.

  1. Find your API URL. This can be found in MG+ Backoffice, or given to you by your Account Manager.

    image-20240327-075225.png
  2. Create a request.

    1. Replace the URL with your API URL, DemoAgent with your Agent Code, and testPlayer with your playerId.

      1. In the request example, this is the api-demo.k2net.io, DemoAgent, and testPlayer portions of the endpoint.

    2. Set the Authorization token to be your STS Token.

      1. In the request example, this is the (STS Token) portion of the request header.

    3. For the request body:

      1. Replace the langCode with your language code and region.

      2. Replace the platform with either desktop or mobile.

      3. Replace the contentCode with the game code.

Request Example

POST https://api-demo.k2net.io/api/v1/agents/DemoAgent/players/testPlayer/sessions


Request Headers

Content-Type: application/x-www-form-urlencoded
Authorization: (STS Token)


Request Body

{
  langCode: "en-us"
  platform: "desktop"
  contentCode: "SMG_108Heroes"
}


  1. You should receive a game launch URL as a response in the url and gameURL (they are the same).

Response Example

201 Response Body Example

{
  "url": "https://mnetroul.pauyolima.com/platform/default.aspx?applicationid=163&productId=34117&gameid=108heroesDesktop&brand=Brand&loginType=VanguardSessionToken&languageCode=en-us&externalToken=TOKEN&host=desktop&clienttypeid=70&launchHash=o3jpeLjuDgMfFBpyVxhTI4mMrFjEmv-MBZSbphOWByc",
  "gameURL": "https://mnetroul.pauyolima.com/platform/default.aspx?applicationid=163&productId=34117&gameid=108heroesDesktop&brand=Brand &loginType=VanguardSessionToken&languageCode=en-us&externalToken=TOKEN&host=desktop&clienttypeid=70&launchHash=o3jpeLjuDgMfFBpyVxhTI4mMrFjEmv-MBZSbphOWByc"
}


Checklist

  • Did you use the correct API URL from your Account Manager or MG+ Backoffice?
  • Did you put /api/v1/ after your API URL?
  • Did you use the POST method?
  • Did you put the STS Token in the Authorization request header?
  • Did you put the langCode, platform and contentCode in the request body?
  • Has the STS Token expired?