User information

Requests

HTTP verb Endpoint Description

GET

/rest/v1/user/info

Retrieving user information

PATCH

/rest/v1/user/info

Changing user information

For all requests:
Domain Type: any

Retrieving user information

Returns some basic properties of the user, including roles and groups, and associated accounts SIP.

Request

Request example
GET /rest/v1/user/info HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

{
  "id": "e7adf0aa-05b7-8163-948c-3392a9660db9",
  "domain": "pbx.era-platform.ru",
  "login": "peter",
  "name": "Peter Bukashin",
  "email": "tbotc@yandex.ru",
  "avatar": false,
  "groups": [
    {
      "id": "01b0aaeb-0183-d06d-91c9-7cd30a921f58",
      "code": "admins",
      "description": "",
      "opts": {
"title": "Domain administrators"
      }
    }
  ],
  "roles": [
    "admin",
    "builder_admin",
    "callcenter_admin",
    "crud",
    "email_admin",
    "monitor",
    "scripteditor",
    "test",
    "user"
  ],
  "sip_accounts": [
    {
      "id": "c7e163c6-8b5e-cb6e-7bf4-441a912ff0b9",
      "login": "7913",
      "phonenumber": "7913"
    },
    {
      "id": "57278625-5fa4-eb0c-fb53-f6fa26881f25",
      "login": "p.bukashin",
      "phonenumber": "414"
    }
  ]
}
Table 1. Response Fields
Specification Description

Name: id
Type: str

User ID

Name: domain
Type: str

A list of groups that the user is a member of directly or cascaded into.

Name: login
Type: str

User Login.

Name: name
Type: str

User Name.

Name: email
Type: str

Email-address assigned to the user.

Name: avatar_info
Type: any

Metadata of the user’s avatar image. If no avatar is loaded, the field contains 'false'.
.Example of a value

{
  "name": "ya.jpg",
  "size": 45966,
  "mtime": "2022-12-16T11:20:46Z",
  "hasha": "md5;EB2E803AB7B4112A8FAC044B5CB72EBB"
}

Name: groups
Type: array<str>

A list of groups that the user is a member of directly or cascaded into.
Each group is represented by an identifier ('id'), title ('opts.title'), code ('code'), description ('description').

Name: roles
Type: array<str>

A list of roles assigned to the user directly or through inclusion in groups.

Name: sip_accounts
Type: array<object>

List of SIP accounts (accounts assigned to a user) sipuser]).
Each account is represented by an identifier ('id'), a login ('login') - aka SIP-username, an internal phone number (phonenumber).
The identifier is used when generating Endpoint-URLs to manage entities associated with attached SIP accounts.

Changing user information

Allows you to modify the username.

Request

Request example
PATCH /rest/v1/user/info HTTP/1.1

{
  "name": "Peter Bukashin"
}

Response

Response example
HTTP/1.1 200 OK

{
  "name": "Peter Bukashin"
}