Skip to content

5. User Management

What This Chapter Does

It manages user accounts through the API. It covers querying, creating, changing, and deleting.

Groups and permissions are covered in chapter 4. The usual order is to create the user and then put them in a group.

Users

Query

Fetches the list of registered users. Which groups each user belongs to (groups) comes with it.

ItemDescription
URL/monitoring/api/users
Example request URL/monitoring/api/users
HTTP METHODGET
Content-Typeapplication/json; charset=UTF-8
Body
ResponseSee below

Example response

{
"status": 200,
"result": [
{
"userId": "omadm",
"name": "Administrator",
"email": "support@opennaru.com",
"phoneNumber": "010-1234-1234",
"groups": [
"admin",
"users"
],
"timeZone": "GMT+09:00",
"locale": "kr",
"language": "ko",
"registered": 1502182129012,
"updated": 0
}
]
}

Create

Creates a user. Without being put in groups, they can sign in but there is no screen to see.

ItemDescription
URL/monitoring/api/user
Example request URL/monitoring/api/user
HTTP METHODPOST
Content-Typeapplication/json; charset=UTF-8
Body{ "userId": "test", "password": "test", "name": "Test", "email": "", "phoneNumber": "", "timeZone": "GMT+09:00", "language": "ko", "groups": [ "users", “testGroups” ], "locale": "kr" }
Response{"status": 200}

Update

Changes the name, contact details, group membership, and so on. The password is sent as a separate item.

ItemDescription
URL/monitoring/api/user/{user id}
Example request URL/monitoring/api/user/test
HTTP METHODPUT
Content-Typeapplication/json; charset=UTF-8
Body{ "userId": "test", "password": "test", "name": "Test", "email": "", "phoneNumber": "", "timeZone": "GMT+09:00", "language": "ko", "groups": [ "users", “testGroups” ], "locale": "kr" }
Response{"status": 200}

Delete

Deletes a user. The dashboards that user created disappear with them.

ItemDescription
URL/monitoring/api/user/{user id}
Example request URL/monitoring/api/user/test
HTTP METHODDELETE
Content-Typeapplication/json; charset=UTF-8
Body
Response{"status": 200}