Get User
Retrieves information of a specified user.
Required Permissions
Requires the MEMBER role or higher.
HTTP Request
GET /api/sonar/users/:guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
https://HOSTNAME/api/sonar/users/ffaf431b-653a-4329-8f83-913cbb00342d
Request Parameter
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | O | String | User GUID |
Success Response
{
"user": {
"guid": "ffaf431b-653a-4329-8f83-913cbb00342d",
"company_guid": "6fbe27b7-f1ae-4d7a-a1a5-76d8fa9aa311",
"login": "joshua",
"name": "Joshua",
"title": null,
"dept": null,
"phone": null,
"mobile": null,
"email": "joshua@example.com",
"locale": null,
"role_id": 1,
"role_name": "MASTER",
"home_menu_id": 18,
"granted_tables": [
{
"type": "TABLE",
"name": "weblog",
"read_only": true,
"created": "2022-09-11 21:23:45+0900"
}
],
"user_granted_profiles": [
{
"type": "PROFILE",
"guid": "2011297e-6a3f-45de-92a3-8c187edb62d2",
"name": "testdb (Database)",
"read_only": true,
"created": "2022-09-11 21:23:45+0900"
}
],
"group_granted_profiles": [],
"user_group_guids": ["28c1251b-2f7c-4c58-95a1-fc4a1ead877e"],
"trust_hosts": [],
"idle_behavior": "lock",
"idle_timeout": 3600,
"password_expiration": 7,
"last_pw_change": "2022-09-11 21:08:39+0900",
"login_lock_count": 5,
"login_lock_interval": 10,
"login_lock_until": null,
"login_fail_count": 0,
"auth_mode": 0,
"has_api_key": true,
"preferences": {},
"created": "2022-09-01 00:31:13+0900",
"updated": "2022-09-11 21:08:39+0900"
}
}
- user (Map): User account
- guid (String): User GUID
- company_guid (String): Company GUID
- login (String): Login user name
- name (String): User name
- title (String): Title
- dept (String): Department
- phone (String): Phone number
- mobile (String): Mobile number
- email (String): Email
- locale (String): Locale.
enorko - role_id (32-bit integer): Role ID. Guest (0), Cluster administrator (1), Company administrator (2), User (3)
- role_name (String): Role name
- home_menu_id (32-bit integer): Home menu ID to appear after login
- granted_tables (Array)
- type (String): Always
TABLE. - name (String): Table name
- read_only (Boolean): Whether read-only or not
- created (String): Date and time of creation (yyyy-MM-dd HH:mm:ssZ)
- type (String): Always
- user_granted_profiles (Array)
- type (String): Always
PROFILE. - guid (String): Profile GUID
- name (String): Table name
- read_only (Boolean): Whether read-only or not
- created (String): Date and time of creation (yyyy-MM-dd HH:mm:ssZ)
- type (String): Always
- group_granted_profiles (Array)
- type (String): Always
PROFILE. - guid (String): Profile GUID
- name (String): Table name
- read_only (Boolean): Whether read-only or not
- created (String): Date and time of creation (yyyy-MM-dd HH:mm:ssZ)
- type (String): Always
- user_group_guids (Array): GUID list of user groups to which user belongs
- trust_hosts (String): List of trusted ip addresses. If specified, access from IP addresses other than these specified ones is not allowed.
- idle_behavior (String): Idle session timeout behavior. Screen lock (
lock) or auto logout (logout) - idle_timeout (32-bit integer): Idle session timeout time (seconds). Value ranges from 0 to 604,800 (seconds). 0 (unlimited)
- password_expiration (32-bit integer): Password expiration period (in days). Value ranges from
7to3650. System default (-1), Unlimited (0). - last_pw_change (String): Date and time of last password change (
yyyy-MM-dd HH:mm:ssZ) - login_lock_count (32-bit integer): Account lockout threshold. Value ranges from
0to5. If set to0, account will be locked immediately upon the first authentication failure. - login_lock_interval (32-bit integer): Account lockout duration. Min.
1to max.100000000minutes. - login_lock_until (String): Date and time of account unlock (yyyy-MM-dd HH:mm:ssZ )
- login_fail_count (32-bit integer): Number of consecutive failed login attempt
- auth_mode (32-bit integer): Authentication mode;
0: Use both internal/external authentication methods.1: Use only external authentication. - has_api_key (Boolean): Whether to have API key or not
- preferences (Map): Preference list
- created (String): Date and time of creation (
yyyy-MM-dd HH:mm:ssZ) - updated (String): Date and time of last modification (
yyyy-MM-dd HH:mm:ssZ)
Error Responses
User Identifier is not in valid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
User is not found or No read privileges
HTTP status code 200
{
"user": null
}