User — Python SDK
User profile reference.
Overview
The User resource exposes a single endpoint returning the currently logged-in user's full profile, including tenant context, BUC IDs, and permission metadata.
Accessed via client.user.
Available Operations
| Method | Description |
|---|---|
info() | Get the current logged-in user's information |
info
Get the current logged-in user's full profile.
Example Usage
from wlt import WltClient
with WltClient(api_key="your-api-key", base_url="https://console.example.com") as client:
user = client.user.info()
print(f"User ID: {user.data.userId}")
print(f"Username: {user.data.userName}")
print(f"Tenant: {user.data.partnerName} (id={user.data.partnerId})")
Parameters
None.
Response
Returns BaseResponse[LoginUser]. Key fields on data:
| Field | Type | Description |
|---|---|---|
userId | int | User ID |
userName | str | Username |
userType | str | User type (e.g. PartnerUser, PartnerUserSub) |
accountStructure | int | Account type: 1=Partner, 2=Customer main account, 3=SubUser, 4=TokenLogin |
tenantCode | str | Tenant code |
partnerId | int | Tenant ID |
partnerName | str | Tenant name |
partnerLogoUrl | str | Tenant logo URL |
bucId | int | BUC ID |
bid | str | BID |
parentUserId | int | Parent account database ID |
parentPk | str | Parent account PK info |
aliyunPk | str | Aliyun PK info |
cmUserId | str | CM user ID |
accessKeyId | str | AccessKey ID |
securityToken | str | Security token |
timezone | str | Timezone info |
region | str | Region info |
needAuth | bool | Whether SLR authorization is needed |
userPermission | UserPermissionResponse | User permission info |
sourceExternalTicket | str | SSO external ticket |
thirdChannel | str | Third-party channel source |
Errors
| Code | Exception | When |
|---|---|---|
2000 / 2002 | AuthenticationError | API Key invalid |
2007 | PermissionError | Permission denied |
3001 | AuthenticationError | Token expired and refresh failed |