跳轉至

登錄和解除使用限制

This API registers a user account as suspended on the Hive server or releases it according to the app operation policy.

API Endpoint 說明
POST /v2/game/block/set Register access restriction
POST /v2/game/block/delete Release access restriction


Register access restriction

If restriction types are registered in advance through Hive Console or the Register restriction type API, you can distinguish permanent restrictions from time-limited restrictions and change restriction information for an existing user identified by PlayerID.

請求 URL

正式 URL https://auth.qpyou.cn/v2/game/block/set
沙盒 URL https://sandbox-auth.qpyou.cn/v2/game/block/set
HTTP 方法 POST
Content-Type application/json
資料格式 JSON

請求標頭

欄位名稱 說明 類型 必填
X-Access-Token 用於應用程式伺服器認證的 OAuth 2.0 Access Token
(請參閱 發行 OAuth Token
String Y
ISCRYPT 資料是否加密(0 = 不加密)(必須傳遞 0) Integer Y

請求本文

欄位名稱 說明 類型 必填
appid App ID String Y
player_id Player ID Integer Y
status Suspension status
  • P: Permanent suspension
  • B: User with a suspension period
String Y
block_type Restriction type number
Must be registered first in [Hive Console > Authentication > Restriction > Type registration] or through the Register restriction type API.
Integer Y
start_date Suspension start date (format: YYYY-MM-DD HH:mm:ss) String Y
end_date Suspension end date (format: YYYY-MM-DD HH:mm:ss) String Y
skip_blocked If requested as true and blocking data already exists, returns result_code=0 without changing the blocking data. Boolean N
did App identifier created when the app is installed. It identifies the same type of app. Passing a newly issued or existing value returned during SDK initialization verifies the login history on that device. Integer N

請求範例

To register a time-limited restricted user, set status to B and send start_date and end_date together.

{"appid":"com.com2us.hivesdk.normal.freefull.apple.global.ios.universal","player_id":24000000000,"status":"B","block_type":18,"start_date":"2024-06-03 00:00:00","end_date":"2024-06-30 23:59:59","skip_blocked":true,"did":2000000}

回應本文

欄位名稱 說明 類型
result_code 回應代碼 詳情 Integer
result_msg 結果訊息 String
token_validation JWT 驗證結果(JWT 驗證錯誤 Object
token_validation.result_code JWT 驗證結果代碼 Integer
token_validation.result_msg JWT 驗證結果訊息 String

回應代碼

Code value 說明
0 成功
2499 JWT 驗證失敗(請參閱 token_validation)
4000 無效參數
  • The format of the suspension start or end date is invalid
  • The start date is later than the end date
  • The current time is later than the end date
4011 Unregistered type
4013 did login history verification failed (cannot verify while logged out)
6000 無效 appid

回應範例

成功

{"result_code":0,"result_msg":"SUCCESS","token_validation":{"result_code":0,"result_msg":"success"}}


Release access restriction

Directly releases a specific account from its suspended state on the Hive server.

請求 URL

正式 URL https://auth.qpyou.cn/v2/game/block/delete
沙盒 URL https://sandbox-auth.qpyou.cn/v2/game/block/delete
HTTP 方法 POST
Content-Type application/json
資料格式 JSON

請求標頭

欄位名稱 說明 類型 必填
X-Access-Token 用於應用程式伺服器認證的 OAuth 2.0 Access Token
(請參閱 發行 OAuth Token
String Y
ISCRYPT 資料是否加密(0 = 不加密)(必須傳遞 0) Integer Y

請求本文

欄位名稱 說明 類型 必填
appid App ID String Y
player_id Player ID Integer Y

請求範例

{"appid":"com.com2us.hivesdk.normal.freefull.apple.global.ios.universal","player_id":24000000000}

回應本文

欄位名稱 說明 類型
result_code 回應代碼 詳情 Integer
result_msg 結果訊息 String
token_validation JWT 驗證結果(JWT 驗證錯誤 Object
token_validation.result_code JWT 驗證結果代碼 Integer
token_validation.result_msg JWT 驗證結果訊息 String

回應代碼

Code value 說明
0 成功
2002 User not registered for suspension
2499 JWT 驗證失敗(請參閱 token_validation)
4000 無效參數
6000 無效 appid

回應範例

成功

{"result_code":0,"result_msg":"SUCCESS","token_validation":{"result_code":0,"result_msg":"success"}}
Note

JWT 驗證失敗時,可在 token_validation 欄位中查看詳細錯誤資訊。詳情請參閱 JWT 驗證錯誤代碼