###### tags: `Api文件範本` # BetContruct API 使用手冊 V0.1 [toc] ## 玩家登入狀態 ### 系統登入 :::info - 傳送指令建立登入狀態 - 注意:BC會拿我們傳遞給它的auth_token反向詢問我方的GetClientDetail是否為合法的token ::: - 指令 - restore_login - 請求 | Field | Description | DataType | Required | Memo | | -------- | -------- | -------- | -------- | -------- | | user_id | 此玩家在我方系統的id | int | yes | | | auth_token | 我方系統產生給該玩家的token。BC將會記下此token,之後和我方系統溝通時用以做合法判別依據。 | string | yes | | - 範例 ```json { "command": "restore_login", "params": { "user_id": 11111, "auth_token": "some-random-authToken-12345678" } } ``` - 回應 | Field | Description | DataType | Memo | | -------- | -------- | -------- | -------- | | code | 結果代碼 | int | 詳見 附錄 - 結果代碼 | | auth_token | 返回我方傳去的token | string | | | user_id | 返回我方傳去的user id | string | | - 範例 ```json { "code": 0, "data": { "auth_token": "test_token_228", "user_id": 228 } } ``` - 重點: - auth_token 是我方產生的token,應至少需要10分鐘的有效期限。BC每次和我方後端溝通時都會以此作為憑證。登入後,BC會每分鐘呼叫一次我方的get_balance,我方的get_balance在作業時應再沿長此token的有效期限。 ### 系統登出 :::info - 傳送指令告知玩家要登出 ::: - 指令 - command_example - 請求 | Field | Description | DataType | Required | Memo | | -------- | -------- | -------- | -------- | -------- | | 範例欄位1 | 範例介紹1 | int | yes | 範例備註1 | | 範例欄位2 | 範例介紹2 | string | yes | 範例備註2 | - 範例 ```json { "command": "command_example", "params": { "範例欄位1": "data123", "範例欄位2": "data456" } } ``` - 回應 | Field | Description | DataType | Memo | | -------- | -------- | -------- | -------- | | code | 結果代碼 | int | 詳見 附錄 - 結果代碼 | | 範例欄位1 | 範例介紹1 | string | | | 範例欄位2 | 範例介紹2 | string | | - 範例 ```json { "code": 0, "data": { "範例欄位1": "範例資料", "範例欄位2": 範例數字 } } ``` - 重點: - 小標題 內容介紹
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up