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.
| Item | Description |
|---|---|
| URL | /monitoring/api/users |
| Example request URL | /monitoring/api/users |
| HTTP METHOD | GET |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | See 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.
| Item | Description |
|---|---|
| URL | /monitoring/api/user |
| Example request URL | /monitoring/api/user |
| HTTP METHOD | POST |
| Content-Type | application/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.
| Item | Description |
|---|---|
| URL | /monitoring/api/user/{user id} |
| Example request URL | /monitoring/api/user/test |
| HTTP METHOD | PUT |
| Content-Type | application/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.
| Item | Description |
|---|---|
| URL | /monitoring/api/user/{user id} |
| Example request URL | /monitoring/api/user/test |
| HTTP METHOD | DELETE |
| Content-Type | application/json; charset=UTF-8 |
| Body | |
| Response | {"status": 200} |