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

POST

/rest/v1/iam/users

Creating a new user

GET

/rest/v1/iam/users

Getting the list of users

GET

/rest/v1/iam/users/<id> /rest/v1/iam/users/current

Retrieving user data

PATCH

/rest/v1/iam/users/<id> /rest/v1/iam/users/current

Changing user data

DELETE

/rest/v1/iam/users/<id>

Deleting a user

LOOKUP

/rest/v1/iam/users

Searching for a user ID


Creating a new user

Request

Field Description: user entity

Request example
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

Response example
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

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, login, name, timezone, opts.roles, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/iam/users?offset=0&limit=2 HTTP/1.1

Response

Field Description: user entity

Response example
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

Features

  • The server does not return the actual password value, hiding it with a value of "*****".

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/iam/users/6a941fb6-016c-bdc2-95ce-50e54938780c HTTP/1.1

Response

Field Description: user entity

Response example
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

Request example
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

Response example
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"
  }
}

Deleting a user

Request

Request example
DELETE /rest/v1/iam/users/6a941fb6-016c-bdc2-95ce-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

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

Request example
LOOKUP /rest/v1/iam/users HTTP/1.1
Content-Type: application/json; charset=utf-8

"mari"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "6a941fb6-016c-bdc2-95ce-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}