Users (users)
Overview
Performs user account management.
It is acceptable to specify an alias in endpoint requests for a specific user "current". In this case, the authorized user ID is automatically applied instead.
The account password (the 'pwd' field) is masked when issued to administrators, and is not issued to other users with roles that grant the right to read the collection.
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new user
Request
Field Description: user entity
POST /rest/v1/iam/users HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"name": "Ann Smith",
"login": "mari",
"pwd": "hjpjdstckjys"
}
Response
Field Description: user entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6a941fb6-016c-bdc2-95ce-50e54938780c",
"name": "Ann Smith",
"login": "mari",
"pwd": "*****",
"timezone": "default",
"opts": {
"title": "",
"roles": [],
"tags": [],
"comment": "",
"allow_script_crud": false
},
"ext": {
"ct": "2019-08-23T09:17:23.46Z",
"lwt": "2019-08-23T09:17:23.46Z"
}
}
Getting the list of users
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, login, name, timezone, opts.roles, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/iam/users?offset=0&limit=2 HTTP/1.1
Response
Field Description: user entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "6a941fb6-016c-bdc2-95ce-50e54938780c",
"name": "Ann Smith",
"login": "mari",
"timezone": "default",
"opts": {
"roles": []
},
"ext": {
"ct": "2019-08-23T09:17:23.46Z",
"lwt": "2019-08-23T09:17:23.46Z"
}
},
{
"id": "e7adf0aa-05b7-8163-948c-3392a9660db9",
"name": "Peter White",
"login": "peter",
"timezone": 3,
"opts": {
"roles": [
"admin"
]
},
"ext": {
"ct": "2019-08-21T07:18:33.29Z",
"lwt": "2019-08-21T07:18:33.29Z"
}
}
]
Retrieving user data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/iam/users/6a941fb6-016c-bdc2-95ce-50e54938780c HTTP/1.1
Response
Field Description: user entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6a941fb6-016c-bdc2-95ce-50e54938780c",
"name": "Ann Smith",
"login": "mari",
"pwd": "*****",
"timezone": "default",
"opts": {
"title": "",
"roles": [
"admin",
"monitor",
"scripteditor"
],
"tags": [],
"comment": "",
"allow_script_crud": false
},
"ext": {
"ct": "2019-08-23T09:17:23.46Z",
"lwt": "2019-08-23T09:17:23.46Z"
}
}
Changing user data
Fields prohibited for modification: id
Features
-
If you save a user with the hiding value "*****" in the password field, the password is not changed.
Request
Field Description: user entity
PATCH /rest/v1/iam/users/6a941fb6-016c-bdc2-95ce-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"opts": {
"roles": ["admin","monitor","scripteditor"]
}
}
Response
Field Description: user entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "6a941fb6-016c-bdc2-95ce-50e54938780c",
"name": "Ann Smith",
"login": "mari",
"pwd": "*****",
"timezone": "default",
"opts": {
"title": "",
"roles": [
"admin",
"monitor",
"scripteditor"
],
"tags": [],
"comment": "",
"allow_script_crud": false
},
"ext": {
"ct": "2019-08-23T09:17:23.46Z",
"lwt": "2019-09-06T12:46:18.62Z"
}
}
Searching for a user ID
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, login
Request
LOOKUP /rest/v1/iam/users HTTP/1.1
Content-Type: application/json; charset=utf-8
"mari"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"6a941fb6-016c-bdc2-95ce-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}