# 进入游戏

## Entergame

> 该API接口由**OMG平台**提供,由**接入方**进行调用

<mark style="color:green;">`POST`</mark>  `{OMG_API_URL}/api/game/v1/entergame?trace_id=your_trace_id`

{% hint style="info" %}
`{OMG_API_URL}`为OMG接口域名,可通过后台获得
{% endhint %}

### **Headers**

<table><thead><tr><th width="263">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>Content-Type</code></td><td>"application/json; charset=utf-8"</td></tr><tr><td><code>sign</code></td><td>"your_sign_string"</td></tr></tbody></table>

{% hint style="info" %}
签名算法请查阅 [签名算法及示例](https://docs.omgapi.cc/kuai-su-kai-shi/quickstart#qian-ming-suan-fa-ji-shi-li) 页面描述
{% endhint %}

### **Body**

<table><thead><tr><th width="192">Name</th><th width="201">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>app_id</code></td><td>string</td><td><p>商户的唯一标识</p><p>可通过商户后台获得</p></td></tr><tr><td><code>token</code></td><td>string</td><td>用户在OMG平台的token,可以通过<a href="sheng-cheng-yong-hu-jian-quan-token">获取玩家鉴权token接口</a>获得</td></tr><tr><td><code>gameid</code></td><td>string</td><td>进入的游戏id</td></tr><tr><td><code>timestamp</code></td><td>integer</td><td>时间戳(秒)</td></tr><tr><td><code>lang</code></td><td>string <code>非必填</code></td><td>游戏语言，默认为en</td></tr><tr><td><code>back_url</code></td><td>string <code>非必填</code></td><td>玩家点击退出的回调url,仅/api/game/loadlist接口返回的platform字段的值为2,3,4,8的品牌有效</td></tr><tr><td><code>screen_mode</code></td><td>string</td><td>1=竖向全屏，2=半屏（显示在手机屏幕下半部分），3=横向全屏 目前仅对Casino、Lottery 有效</td></tr></tbody></table>

### **接入方请求参数示例**&#x20;

```json
{
    "app_id":"10013",
    "timestamp": 1711954264,
    "token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjcmVhdGUiOjE3MTk2Mjk2NDQsInVzZXIiOiJ7XCJpZFwiOjM1NzE0MSxcIm9wZXJhdGVyX2lkXCI6MSxcImFnZW50X2lkXCI6MTAwMDIwLFwiYXBwX2lkXCI6MTAzMSxcImFjY291bnRfdHlwZVwiOjAsXCJ2YWx1ZVwiOlwiMVwiLFwibm93X2dhbWVfaWRcIjowfSJ9.tXfaavxZu7PIedpJ5Tp7oL0aBEnb5ujok4cbKWoNj0U",
    "lang": "en",
    "gameid": "1"
    "back_url":""
}
```

### OMG平台响应参数示例

{% tabs %}
{% tab title="成功" %}

```json
{
    "code": 0,
    "msg": "ok",
    "data": {
        "gameurl": "https://m.pgf-aspb7a-test.cc/1/index.html?or=static.pgf-aspb7a-test.cc&btt=1&op=1727060615&ah=api-test&sip=https://api.pgsoft-games-test.cc&gi=1&ot=50f15a92-ee8d-11ee-9a61-00ff3fae08f7&cid=0&ops=luck_single_10013&l=en&oc=0&n=1102601&ct=USD"
    }
}
```

{% endtab %}

{% tab title="失败" %}

```json
{
    "code": 10002,
    "msg": "sign invalid"
}
```

{% endtab %}
{% endtabs %}

### **成功返回示例的参数说明**

| 参数名     | 必选 | 类型      | 说明          |
| ------- | -- | ------- | ----------- |
| code    | 是  | integer | 状态码         |
| msg     | 是  | string  | 提示信息        |
| data    | 是  | object  | 返回的数据       |
| gameurl | 是  | string  | 打开游戏客户端的url |

### 错误码

{% hint style="info" %}
更多返回错误代码请查阅 [通用错误码 ](https://docs.omgapi.cc/kuai-su-kai-shi/tong-yong-cuo-wu-ma)页面描述
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omgapi.cc/you-xi-api-jie-kou/zhuan-zhang-qian-bao/jin-ru-you-xi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
