認証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.
リクエストURL¶
| 本番URL | https://auth.qpyou.cn/v2/game/player/get-playerid |
|---|---|
| 分散環境URL | https://auth.globalwithhive.com/v2/game/player/get-playerid |
| サンドボックスURL | https://sandbox-auth.qpyou.cn/v2/game/player/get-playerid |
| HTTPメソッド | POST |
| Content-Type | application/json |
| データ形式 | 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).
リクエストヘッダー¶
| フィールド名 | 説明 | タイプ | 必須 |
|---|---|---|---|
| X-Access-Token | アプリサーバー認証用のOAuth 2.0 Access Token (OAuth Tokenを発行するを参照) | String | Y |
| ISCRYPT | データ暗号化の有無(0 = 暗号化しない)(必ず0を送信) | Integer | Y |
リクエスト本文¶
| フィールド名 | 説明 | タイプ | 必須 |
|---|---|---|---|
| appid | App ID | String | Y |
| idp_index | IdP index IdP list | Integer | Y |
| idp_user_id | Unique IdP identifier | String | Y |
リクエスト例¶
{"appid":"com.com2us.hivesdk.normal.freefull.apple.global.ios.universal","idp_index":1,"idp_user_id":"68101398"}
レスポンス本文¶
| フィールド名 | 説明 | タイプ |
|---|---|---|
| result_code | レスポンスコード 詳細 | Integer |
| result_msg | 結果メッセージ | String |
| token_validation | JWT検証結果(JWT検証エラー) | Object |
| token_validation.result_code | JWT検証結果コード | Integer |
| token_validation.result_msg | JWT検証結果メッセージ | String |
| 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 |
レスポンスコード¶
| Code value | 説明 |
|---|---|
| 0 | 成功 |
| 2002 | No user data |
| 2499 | JWT検証失敗(token_validationを参照) |
| 4000 | Invalid request parameter |
レスポンス例¶
成功 (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}}
成功 (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."
}
}
失敗¶
{"result_code":4000,"result_msg":"Request has invalid format.","data":"appid, idp_user_id, idp_index"}
Note
JWT検証に失敗した場合、token_validationフィールドで詳細なエラー情報を確認できます。詳細はJWT検証エラーコードを参照してください。