/v1/customers/user/inquiryUserInfoByAccessToken
POST /v1/customers/user/inquiryUserInfoByAccessToken
The inquiryUserInfoByAccessToken
API is used for merchant side to get the user related information after obtain user authorization.
Message structure
Request
Property | Data type | Required | Description |
accessToken | String | Yes | An access token that can be used to access the user resource scope. Max. length: 128 characters. |
extendInfo | String | No | The extend information,wallet and merchant can put extend info here. Max. length: 4096 characters. |
Response
Property | Data type | Required | Description |
result | Result | Yes | The request result, which contains information related to the request result, such as status and error codes. |
userInfo | OpenUserInfo | User open information. |
Result process logic
For different request results, different actions are to be performed. See the following list for details:
- If the value of result.resultStatus is S, that means user information inquiry is successful, merchant can use the accessToken to access the corresponding user resource scope.
- If the value of result.resultStatus is F, that means user information inquiry is failed, the failed reason can refer to result code param.
- If the value of result.resultStatus is U, that means unknown exception occur on wallet side, merchant may try again.
Result
No | resultStatus | resultCode | resultMessage |
1 | S | SUCCESS | Success. |
2 | U | UNKNOWN_EXCEPTION | An API calling is failed, which is caused by unknown reasons. |
3 | U | REQUEST_TRAFFIC_EXCEED_LIMIT | The request traffic exceeds the limit. |
4 | F | PROCESS_FAIL | A general business failure occurred. Don't retry. |
5 | F | PARAM_ILLEGAL | Illegal parameters exist. For example, a non-numeric input, or an invalid date. |
6 | F | ACCESS_DENIED | The access is denied. |
7 | F | INVALID_API | The called API is invalid or not active. |
8 | F | INVALID_ACCESS_TOKEN | The access token is invalid. |
9 | F | INVALID_AUTH_CLIENT | The auth client id is invalid. |
10 | F | EXPIRED_ACCESS_TOKEN | The access token is expired. |
11 | F | EXPIRED_AGENT_TOKEN | The access token of mini program is expired. |
12 | F | INVALID_AGENT_TOKEN | The access token of mini program is invalid. |
Sample
Query user info via access token,the access token is generated via OAuth after authorization is successful.
- Merchant calls /v1/customers/user/inquiryUserInfoByAccessToken interface with access token (Step 1)
- Wallet server returns user information the to merchant based on the access token (Step 2).
Request
{
"accessToken": "20210727hUCT6YdB5bWaJ33BSHrcAU0HL5GNOw6YitvhrdI7zwn0880603106508",
"extendInfo": "{\"customerBelongsTo\":\"TNG\"}"
}
- extendInfo, includes key - customerBelongsTo the e-wallet that the customer uses. Corresponding to the field 'siteName' that obtained from the API 'my.getSiteInfo', in the Mini Program scenario this is mandatory.
Response
{
"result": {
"resultCode": "SUCCESS",
"resultMessage": "Success.",
"resultStatus": "S"
},
"userInfo": {
"userId": "1000000935800000"
}
}