Skip to main content
Skip table of contents

Получение текущего пользователя

Возвращает объект текущего пользователя.

GET/api/v1/users/self
Headers
Authorization
Bearer token
Accept
application/json
X-Client
ios-cctv|android-cctv|thick-legal|web
X-UUID
unique device id
Response
200
Возвращает JSON объект пользователя
JSON
{
    "id": 13,
    "login": "user",
    "name": "user",
    "parent_id": null,
    "permissions": [
        {
            "id": 223,
            "name": "any-permission"
        },
        {
            "id": 221,
            "name": "any-permission"
        },
        {
            "id": 222,
            "name": "any-permission"
        },
        {
            "id": 220,
            "name": "any-permission"
        }
    ],
    "created_at": "",
    "updated_at": "2022-04-21 16:37:46",
    "access_token_id": "c862e3c5a5a87d8b2756e4ad44a43f0a71cbf9cf3063cae019802d0b032ee17f32f69364e7aadb23",
    "can_update_password": true,
    "analytic_license": [
        {
            "type": "analytic_l1",
            "type_pretty": "LIC-XXXX-YY-L1",
            "all": 100,
            "free": 98,
            "used": 2
        },
        {
            "type": "analytic_l2",
            "type_pretty": "LIC-XXXX-YY-L2",
            "all": 100,
            "free": 100,
            "used": 0
        },
        {
            "type": "analytic_l3",
            "type_pretty": "LIC-XXXX-YY-L3",
            "all": 100,
            "free": 99,
            "used": 1
        }
    ]
}
401
Токен авторизации не передан или не валидный, см. Получение токена
Пример
JSON
curl -k --location --request GET 'https://vms.local/api/v1/users/self' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id'
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.