跳转至

登记和解除使用限制

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 验证错误代码