Get Current User Information
2/26/26About 1 min
Get Current User Information
Get personal information of the currently logged-in user. Requires carrying Authorization token in the request header.
Endpoint: GET /user/info/get_user_info
Request Headers
| Parameter | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer token, format: Bearer <token> |
Request Example
GET /user/info/get_user_info HTTP/1.1
Host: 127.0.0.1:8000
Authorization: Bearer <your_token>Response Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| status | int | Yes | HTTP status code |
| code | string | Yes | Get result code |
| result | string | Yes | Get result |
| data | dict | Yes | User information data |
data Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | User ID number (redacted) |
| user_name | string | Yes | User's real name (redacted) |
| user_nickname | string | Yes | User's nickname |
| user_gender | string | Yes | User's gender |
| user_birthday | string | Yes | User's birthday |
| user_phone_number | string | Yes | User's phone number (redacted) |
| user_email | string | Yes | User's email (redacted) |
| user_wx_id | string | Yes | User's WeChat ID (redacted) |
| user_address | string | Yes | User's address |
| user_is_verify_id_name | string | Yes | User's ID verification status |
| user_is_verify_phone_number | string | Yes | User's phone verification status |
Success Response Example
{
"status": 200,
"code": "10000",
"result": "Retrieved successfully",
"data": {
"user_id": "110***********1234",
"user_name": "Example User",
"user_nickname": "Example Nickname",
"user_gender": "None",
"user_birthday": "None",
"user_email": "user***@example.com",
"user_phone_number": "138****8000",
"user_wx_id": "wx_***123",
"user_address": "None",
"user_is_verify_id_name": "Not verified",
"user_is_verify_phone_number": "Not verified"
}
}Error Response Examples
Endpoint Not Open
{
"status": 403,
"code": "10002",
"result": "Server has not opened this endpoint",
"data": {}
}Token Invalid or Expired
{
"status": 401,
"code": "10001",
"result": "Token expired or invalid",
"data": {}
}Failed to Get User Information, Server Internal Error
{
"status": 500,
"code": "10003",
"result": "Failed to get user information, server internal error",
"data": {}
}Error Code Description
| Code | Description |
|---|---|
| 10000 | Retrieved successfully |
| 10001 | Token expired or invalid |
| 10002 | Server has not opened this endpoint |
| 10003 | Failed to get user information, server internal error |
Tip
It is recommended to call this endpoint on pages where user information needs to be retrieved, ensuring the user is logged in. You can check user login status when the application starts.
Warning
If a 401 error is returned, it means the token is invalid or has expired. You need to guide the user to re-login to obtain a new token.
← Back to API Documentation | ← User Login | → General Status Codes