Skip to main content

Mini Game API

The host backend has unified the capabilities of the platform API, so game-side developers only need to focus on accessing the mini game API.

The mini game APIs currently supported by the host backend are as follows:

jscode2session​

tip

This interface should be called on the mini game server side.

Login credential verification. After obtaining the temporary login credential code through the tj.login interface, transfer it to the developer server to call this interface to complete the login process. The usage of this interface is consistent with WeChat Mini Game - Login / jscode2session.

Request Example:

GET /game-api/v2/sns/jscode2session?appid={appid}&secret={secret}&js_code={code}&grant_type=authorization_code HTTP/1.1
Host: minihost.tuanjie.cn

Request Parameter Description:

ParameterDescription
appidGame ID of Mini Game
secretSecret of Mini Game
js_codeCode obtained during login
grant_typeAuthorization type, here only fill in authorization_code

appid and secret can be obtained from "Host Backend > Mini Game > Game Details".

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json

{
"openid": "67b*********************",
"session_key": "",
"unionid": "67b*********************",
"errcode": 0,
"errmsg": "ok"
}