Retrieve the basic information and account details of a specified user, including username, contact information, account status, balance, and other related user data.
Precautions
- This interface uses the GET method
- The target user's ID must be provided to query the user details
- Based on user permissions, it may only be possible to view your own information or information of users with permission
- Return basic user information and account-related details
Request address
{域名地址}/api/user/detail
Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/user/detail
Request syntax
GET {域名地址}/api/user/detail
Request header
This interface also involves common request headers. For more information, please seeCommon Request Headers (Common Request Headers).
Request Parameters
| Field Name | Type | Required | Description |
|---|---|---|---|
| userId | integer | Yes | User ID, specify the user to be queried |
Response Headers
This interface only involves public response headers. More information, please refer toCommon Request Headers (Common Request Headers).
Return parameters
| Field Name | Type | Description |
|---|---|---|
| code | integer | Error code |
| message | string | Error Description |
| data | object | User detail data |
data Parameter
| Field Name | Type | Description |
|---|---|---|
| id | integer | User ID |
| parent_id | integer | Parent user ID |
| user_name | string | Username |
| Real Name | string | True Name |
| introduce | string | Personal Introduction |
| avatar_url | string | Relative Address of User Avatar |
| Full Avatar URL | string | Complete Address of User Avatar |
| string | Email Address | |
| phone | string | Phone Number |
| group_id | integer | User Group ID |
| is_retailer | integer | Is the user a distributor, 0-No, 1-Yes |
| balance | integer | User Balance |
| Total Reward | integer | Distributor Cumulative Earnings |
| Invite Code | string | User invitation code |
| Last login | integer | Timestamp of the last login |
| Expire time | integer | Timestamp of account expiration |
| created_time | integer | registration timestamp |
| updated_time | integer | update timestamp |
| status | integer | User display status |
| extra | object | user extended information |
| group | object | user group information |
| link | string | user personal page link |
Example Usage
Request Example
GET /api/user/detail?userId=1000 HTTP/1.1
Host: www.anqicms.com
Response Example
{
"code": 0,
"msg": "",
"data": {
"id": 1000,
"parent_id": 0,
"user_name": "admin",
"real_name": "",
"introduce": "这是介绍",
"avatar_url": "uploads/202211/21/14f56760596b5328.webp",
"full_avatar_url": "http://127.0.0.1:8001/uploads/202211/21/14f56760596b5328.webp",
"email": "",
"phone": "",
"group_id": 2,
"status": 1,
"is_retailer": 0,
"balance": 0,
"total_reward": 0,
"invite_code": "anqicms",
"last_login": 1702912236,
"expire_time": 1997404800,
"created_time": 1669012062,
"updated_time": 1679536756,
"extra": null,
"group": null,
"link": ""
}
}
Error Code
| Error code | Description |
|---|---|
| 0 | OK |
| -1 | Error, the reason is indicated in msg |
| 1001 | Not logged in |
| 1002 | Unauthorized |
| 200 | API request OK |