Combo Game
Combo Game 接口

获取游戏列表

商户需要从 Combo Game 获取游戏列表及游戏信息时由商户发起调用

不需要通过接口获取游戏列表信息的商户无需使用此接口

请求格式

请求地址: {COMBO_GAME_API_HOST}/v1/game/list

请求方式: POST

编码格式: Content-Type: application/json;charset=UTF-8

接口域名 COMBO_GAME_API_HOST 请联系商务获取

参数类型说明
appIdint商户 App ID
tslong当前时间戳毫秒,允许不超过 60 秒时差
signstringMD5 小写字符串
示例商户请求数据
{
  "appId": 12345678,
  "ts": 1750151429551,
  "sign": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

签名算法

sign = MD5(appId + ts + appKey)

示例代码

public static String sign(int appId, long ts, String appKey) {
    try {
        MessageDigest digest = MessageDigest.getInstance("MD5");
        String sourceString = String.format(Locale.CHINA, "%d%d%s", appId, ts, appKey);
        return bytesToHex(digest.digest(sourceString.getBytes(StandardCharsets.UTF_8)));
    } catch (Exception e) {
        System.out.println("加密失败");
    }
    return null;
}

private static final byte[] HEX_ARRAY = "0123456789abcdef".getBytes(StandardCharsets.US_ASCII);

public static String bytesToHex(byte[] bytes) {
    byte[] hexChars = new byte[bytes.length * 2];
    for (int j = 0; j < bytes.length; j++) {
        int v = bytes[j] & 0xFF;
        hexChars[j * 2] = HEX_ARRAY[v >>> 4];
        hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
    }
    return new String(hexChars, StandardCharsets.UTF_8);
}
h := md5.New()
h.Write([]byte(fmt.Sprintf("%d%d%s", appId, ts, appKey)))
sign := hex.EncodeToString(h.Sum(nil))

返回格式

编码格式: Content-Type: application/json;charset=UTF-8

字段类型含义说明
codeint错误码详见错误码页
msgstring错误信息成功时为 OK
dataobject
data.listarray游戏列表
data.list[i].idint游戏 ID
data.list[i].namestring游戏名称
data.list[i].iconstring游戏图标
data.list[i].typeint游戏类型目前仅有 type=1 一种类型,未来会有更多类型
data.list[i].screenOrientationint游戏支持的屏幕方向0 横竖屏,1 竖屏,2 横屏
data.list[i].safeWidthint游戏支持的最小屏幕宽度单位为像素
data.list[i].safeHeightint游戏支持的最小屏幕高度单位为像素
data.list[i].urlstring游戏 H5 URL未联系商务配置该 App 的该游戏时为 null
data.list[i].zipUrlstring游戏包 Zip URL未联系商务配置该 App 的该游戏时为 null,仅对需要 zip 接入的商户返回该字段
data.list[i].versionstring游戏版本号未联系商务配置该 App 的该游戏时为 null,格式为 x.x.x,例如 1.0.12
data.list[i].enabledboolean游戏是否启用未联系商务配置该 App 的该游戏时为 false,游戏维护时也为 false
示例游戏列表返回数据
{
  "code": 0,
  "msg": "OK",
  "data": {
    "list": [
      {
        "id": 1001,
        "name": "Greedy Box",
        "icon": "https://xxx.com/xxx.png",
        "type": 1,
        "screenOrientation": 0,
        "safeWidth": 750,
        "safeHeight": 750,
        "url": "https://xxx.com/xxx/index.html",
        "zipUrl": "https://xxx.com/xxx/xxx.zip",
        "version": "1.0.9",
        "enabled": true
      }
    ]
  }
}