/v2/users/inquiryUserInfo

POST /v2/users/inquiryUserInfo

The inquiryUserInfo API is used for the merchant to get the user related information after obtaining user authorization.

Sample

Query user information via an access token. The access token is generated via OAuth after authorization is successful.

/v2/users/inquiryUserInfo
  1. Merchant calls this interface with access token (Step 1)
  2. Wallet server returns user information the to merchant based on the access token (Step 2).

Request sample

copy
{
  "accessToken": "281010033AB2F588D14B43238637264FCA5AAF35xxxx",
  "authClientId": "202016726873874774774xxxx"
  
}

Response sample

copy
{
 "result": {
    "resultCode":"SUCCESS",
    "resultStatus":"S",
    "resultMessage":"success"
  },
  "userInfo": {
    "userId": "1000001119398804xxxx",
    "status": "ACTIVE",
    "nickName": "Jack",
    "userName": {
      "fullName": "Jack Sparrow",
      "firstName": "Jack",
      "lastName": "Sparrow"
    },
    "avatar": "http://example.com/avatar.htm?avatarId=FBF16F91-28FB-47EC-B9BE-27B285C23CD3xxxx",
    "gender": "MALE",
    "birthDate": "2020-07-25",
    "nationality": "US", 
    "loginIdInfos": [
      {
        "loginId": "1116874199xxx",
        "loginIdType": "MOBILE_PHONE"
      }
     ],
    "contactInfos": [
      {
        "contactNo": "1116874199xxx",
        "contactType": "MOBILE_PHONE"
      }
    ],
    "extendInfo": "{}"
  }
}

Structure

Request

Property

Data type

Required

Description

Example

accessTokenString (128)

Yes

An access token that can be used to access the user resource scope."281010033AB2F588D14B43238637264FCA5AAF35xxxx"

authClientId 

String (128)

No

The unqiue auth client ID.

"202016726873874774774xxxx"

extendInfo

String (4096)

No

the extend information. Wallets and merchants can put extending information in this property.

"This is additional information"

Response

Property

Data type

Required

Description

Example

resultResult

Yes

The request result, which contains information related to the request result, such as status and error codes.

{

   "resultCode":"SUCCESS",

   "resultStatus":"S",

   "resultMessage":"success"

 }

userInfo

User

No

User open information.

{

   "userId": "1000001119398804xxxx",

   "status": "ACTIVE",

   "nickName": "Jack",

   "userName": {

     "fullName": "Jack Sparrow",

     "firstName": "Jack",

     "lastName": "Sparrow"

   },

   "avatar": "http://example.com/avatar.htm?avatarId=FBF16F91-28FB-47EC-B9BE-27B285C23CD3xxxx",

   "gender": "MALE",

   "birthDate": "2020-07-25",

   "nationality": "US", 

   "loginIdInfos": [

     {

       "loginId": "1116874199xxx",

       "loginIdType": "MOBILE_PHONE"

     }

    ],

   "contactInfos": [

     {

       "contactNo": "1116874199xxx",

       "contactType": "MOBILE_PHONE"

     }

   ],

   "extendInfo": "{}"

 }

Result process logic

In the response, the result.resultStatus field indicates the result of processing a request as follows.

resultStatus

Decription 

S

It means user information inquiry is successful, merchant can use the accessToken to access the corresponding user resource scope.

The corresponding result.resultCode is "SUCCESS" and the  result.resultMessage  is "Success".

U

The API status is unknown.  AuthClient may guide user to try again.

The corresponding result.resultCode is "UNKNOWN_EXCEPTION" and result.resultMessage  is "An API calling is failed, which is caused by unknown reasons.".

For details, see the Common error codes section.

F

It means that user information inquiry is failed. 

The corresponding result.resultCode  and result.resultMessage vary based on different situations. For details, see the following Error codes section.

Error codes

Error codes are usually classified into the following categories:

  • Common error codes: are common for all Mini Program OpenAPIs.  
  • API-specific error codes: are listed in the following table.
resultStatusresultCoderesultMessage
FINVALID_ACCESS_TOKENThe access token is invalid.
FINVALID_AUTH_CLIENTThe auth client id is invalid. 
FEXPIRED_ACCESS_TOKENThe access token is expired.

F

EXPIRED_AGENT_TOKEN

The agent token of mini program is expired.

F

INVALID_AGENT_TOKEN

The agent token of mini program is invalid.