Retrieve user information via Authentication API¶
Request this API when user information must be checked separately after web login is completed.
This API operates by server-to-server communication from the app server directly to the Hive authentication server. It returns user information for the IdP using appid, idp_index, and idp_user_id from the response of the Login verification and user information retrieval API.
Request URL¶
| Production URL | https://auth.qpyou.cn/v2/game/player/get-playerid |
|---|---|
| Distributed environment URL | https://auth.globalwithhive.com/v2/game/player/get-playerid |
| Sandbox URL | https://sandbox-auth.qpyou.cn/v2/game/player/get-playerid |
| HTTP Method | POST |
| Content-Type | application/json |
| Data Format | JSON |
Note
The Hive authentication server is configured as a distributed environment in preparation for failures or network communication issues.
If communication with the authentication server host fails or exceeds the timeout defined on the app server, the app server must directly call the distributed environment URL (Fallback URL).
Request header¶
| Field name | Description | Type | Required |
|---|---|---|---|
| X-Access-Token | OAuth 2.0 Access Token for app server authentication (See OAuth Token issuance) | String | Y |
| ISCRYPT | Whether data is encrypted (0 = not encrypted) (always send 0) | Integer | Y |
Request body¶
| Field name | Description | Type | Required |
|---|---|---|---|
| appid | App ID | String | Y |
| idp_index | IdP index IdP list | Integer | Y |
| idp_user_id | Unique IdP identifier | String | Y |
Request example¶
{"appid":"com.com2us.hivesdk.normal.freefull.apple.global.ios.universal","idp_index":1,"idp_user_id":"68101398"}
Response body¶
| Field name | Description | Type |
|---|---|---|
| result_code | Response code Details | Integer |
| result_msg | Result message | String |
| token_validation | JWT validation result (JWT validation error) | Object |
| token_validation.result_code | JWT validation result code | Integer |
| token_validation.result_msg | JWT validation result message | String |
| data | Result data | Object |
| data.enc_idp | Key that encrypts Request Body information | String |
| data.player_id | Player ID | BigInteger |
| data.list | Linked IdP list | Array |
| data.list[].seq | Linked IdP list - Seq | BigInteger |
| data.list[].player_id | Linked IdP list - Player ID | BigInteger |
| data.list[].idp_user_id | Linked IdP list - unique IdP identifier | String |
| data.list[].idp_index | Linked IdP list - IdP index IdP list | Integer |
| data.list[].idp_id | Linked IdP list - IdP ID | String |
| data.is_blocked | Whether use is suspended | Boolean |
| data.is_refund | Whether the refunded user is subject to repayment | Boolean |
Response code¶
| Code value | Description |
|---|---|
| 0 | Success |
| 2002 | No user data |
| 2499 | JWT validation failed (see token_validation) |
| 4000 | Invalid request parameter |
Response example¶
Success (user information exists)¶
{"result_code":0,"result_msg":"SUCCESS","token_validation":{"result_code":0,"result_msg":"success"},"data":{"enc_idp":"K+A4xduO7kf5OrJ/iDPqL0PtMxwu7wW8JSBO+JJwSDDmJLvIi/6LG7TyWXdEHr9RNHM+/QXwc0+Y9z2eSRg7oeBBHmpOajzF1iiaacbFom4CsNy2fItendset7T0i0WYdyLQih3z5mDjcct47+gg2ovbp6kWRY8D+aGq+ZgaKiyr0Hmb1xmbWY/7cl1FjXTm0Nl9CWhO418bJFdwOpi+bw==","player_id":20000016588,"list":[{"seq":25771,"player_id":20000016588,"idp_user_id":"68101398","idp_index":1,"idp_id":"HIVE"},{"seq":25772,"player_id":20000016588,"idp_user_id":"0","idp_index":0,"idp_id":"GUEST"}],"is_blocked":false,"is_refund":false}}
Success (no user information)¶
{"result_code":2002,"result_msg":"No User","token_validation":{"result_code":0,"result_msg":"success"},"data":{"enc_idp":"K+A4xduO7kf5OrJ/iDPqLyCHfP+L3wz0WTNVw5KHLCqYjqQ+shQ2P3mkgwYCMvlnPatzlSE5ZFINr5gEIxK14sg0N8kOPSjSCeQ9UGGt11OMrYsGTuys0KmPJ2ZU/UWVVxpP1Lxx1eS8VbYwLmoTG+HTw2vkocghs/ZOZ9rqisdBRprhp6Q6+lIjpaUzDa2yy2guM1WheuVzKGL5331HHgo557RqoyUzTc6Lkf8ArWZ/XSwi3ZmStmhz/U4thcIwiowqgV+Ecdb2+WmMZ1MgGT4Xvbxa4lqzToBC3nxDvi1d8TjgMaszVYoNct94WPBGvV6emg3GqiJG+0ZTGg53+mZad9ttkUpTnQXetz5UDTxe5NnFAYfffzBq3jkqfAB042eH21rE3uTVJq3HuO8i9t1LJwKFfkC7sjjuaKNWsjs="}}
JWT validation failure¶
{
"result_code": 2499,
"result_msg": "JWT validation failed. See token_validation for details.",
"token_validation": {
"result_code": 2408,
"result_msg": "The access token is expired. Please refresh your token."
}
}
Failure¶
{"result_code":4000,"result_msg":"Request has invalid format.","data":"appid, idp_user_id, idp_index"}
Note
When JWT validation fails, you can check detailed error information in the token_validation field. For details, see JWT validation error codes.