Skip to main content
Skip table of contents

Просмотр суб-пользователя

В этом запросе отображается объект пользователя с элементами, к которым дал доступ пользователь. Можно дать доступ к меткам, группам и раскладкам.

GET/api/v1/users/subusers/{subuser}

Headers

Authorization

Bearer token

Accept

application/json

X-Client

ios-cctv|android-cctv|thick-legal|web

X-UUID

unique device id

Body

subuseroptional

int

Идентификатор суб-пользователя, которого нужно получить

Response

200

Успешный ответ

JSON
{
    "id": 44,
    "login": "user@mai.com",
    "name": "user@mai.com",
    "parent_id": 13,
    "permissions": [
        {
            "id": 22,
            "name": "camera-events-index",
            "display_name": "Просмотр событий камеры"
        },
        {
            "id": 240,
            "name": "analytic-cases-camera-obstacle",
            "display_name": "Бизнес-кейс - детекция повреждения / перекрытия / вандализма камеры"
        },
        {
            "id": 239,
            "name": "analytic-cases-line-intersection",
            "display_name": "Бизнес-кейс - детекция пересечения линии"
        },
        {
            "id": 49,
            "name": "analytic-cases-index",
            "display_name": "Список бизнес-кейсов"
        }
    ],
    "cameras": [
        {
            "id": 765,
            "group_id": 100,
            "status": "active",
            "type": "media_server_v2",
            "start_at": "2022-04-06 12:13:58",
            "created_at": "2022-01-27 20:16:28",
            "billing_id": null,
            "pretty_name": "Камера 1",
            "lat": null,
            "lng": null,
            "azimuth": null,
            "is_archive_recording": true,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "Камера 1"
        },
        {
            "id": 761,
            "group_id": 100,
            "status": "active",
            "type": "media_server_v2",
            "start_at": "2022-04-06 12:13:58",
            "created_at": "2022-01-27 20:10:24",
            "billing_id": null,
            "pretty_name": "Камера 2",
            "lat": null,
            "lng": null,
            "azimuth": null,
            "is_archive_recording": true,
            "is_bridge": false,
            "is_favorite": false,
            "user_status": "active",
            "name": "Камера 2"
        }
    ],
    "groups": [
        {
            "id": 43,
            "name": "Group"
        }
    ],
    "layouts": [
        {
            "id": 209,
            "name": "01",
            "layout_template_id": 11,
            "layout_template": "Grid91",
            "user_id": 13,
            "grid": [
                null,
                {
                    "id": 753,
                    "group_id": 101,
                    "status": "active",
                    "type": "media_server_v2",
                    "start_at": "2022-04-06 12:13:58",
                    "created_at": "2022-01-27 19:48:31",
                    "billing_id": null,
                    "pretty_name": "Камера 3",
                    "pretty_text": "Камеры",
                    "short_address": "Камеры",
                    "full_address": "Камеры",
                    "lat": null,
                    "lng": null,
                    "azimuth": null,
                    "streams": [
                        {
                            "id": 748,
                            "type": "high",
                            "camera_id": 753,
                            "is_preview_from_server": true,
                            "is_archive_from_server": null,
                            "status": "active",
                            "has_sound": false,
                            "layout_priority": "reserve",
                            "width": 2048,
                            "height": 1536
                        },
                        {
                            "id": 749,
                            "type": "low",
                            "camera_id": 753,
                            "is_preview_from_server": true,
                            "is_archive_from_server": null,
                            "status": "active",
                            "has_sound": false,
                            "layout_priority": "main",
                            "width": 2048,
                            "height": 1536
                        }
                    ],
                    "services": {
                        "ptz": false,
                        "motion_detect": false
                    },
                    "has_sound": false,
                    "is_archive_recording": true,
                    "is_bridge": false,
                    "is_favorite": false,
                    "user_status": "active",
                    "name": "Камера 3"
                },
                null,
                {
                    "id": 765,
                    "group_id": 100,
                    "status": "active",
                    "type": "media_server_v2",
                    "start_at": "2022-04-06 12:13:58",
                    "created_at": "2022-01-27 20:16:28",
                    "billing_id": null,
                    "pretty_name": "Камера 4",
                    "pretty_text": "Камеры",
                    "short_address": "Камеры",
                    "full_address": "Камеры",
                    "lat": null,
                    "lng": null,
                    "azimuth": null,
                    "streams": [
                        {
                            "id": 772,
                            "type": "high",
                            "camera_id": 765,
                            "is_preview_from_server": true,
                            "is_archive_from_server": null,
                            "status": "active",
                            "has_sound": false,
                            "layout_priority": "reserve",
                            "width": 1920,
                            "height": 1080
                        },
                        {
                            "id": 773,
                            "type": "low",
                            "camera_id": 765,
                            "is_preview_from_server": true,
                            "is_archive_from_server": null,
                            "status": "active",
                            "has_sound": false,
                            "layout_priority": "main",
                            "width": 704,
                            "height": 576
                        }
                    ],
                    "services": {
                        "ptz": false,
                        "motion_detect": false
                    },
                    "has_sound": false,
                    "is_archive_recording": true,
                    "is_bridge": false,
                    "is_favorite": false,
                    "user_status": "active",
                    "name": "Камера 4"
                },
                null,
                null,
                null
            ],
            "created_at": "2021-09-15 18:50:19",
            "updated_at": "2022-02-08 09:41:30"
        }
    ],
    "marks": [
        {
            "id": 485887,
            "type": "mark",
            "type_pretty": "Метка",
            "title": "Новая метка",
            "can_delete": true,
            "from": "2022-02-18 07:43:40",
            "to": null,
            "camera_id": 752,
            "created_at": "2022-02-18 16:43:07",
            "updated_at": "2022-02-18 16:43:07"
        }
    ],
    "created_at": "2021-11-24 23:52:20",
    "updated_at": "2021-12-09 18:44:38",
    "access_token_id": null,
    "can_update_password": false,
    "analytic_license": [
        {
            "type": "analytic_l1",
            "type_pretty": "LIC-XXXX-YY-L1",
            "all": 1,
            "free": 1,
            "used": 0
        },
        {
            "type": "analytic_l2",
            "type_pretty": "LIC-XXXX-YY-L2",
            "all": 1,
            "free": 1,
            "used": 0
        },
        {
            "type": "analytic_l3",
            "type_pretty": "LIC-XXXX-YY-L3",
            "all": 1,
            "free": 1,
            "used": 0
        }
    ]
}
404

Если суб-пользователь не принадлежит пользователю или не существует

401

Токен авторизации не передан или не валидный, см. Получение токена

Пример

JSON
curl -k --location --request GET 'https://vms.local/api/v1/users/subusers/{subuser}' \
--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.