Skip to main content
Skip table of contents

Получение дерева камер

Возвращает дерево камер с объектами камер. Для каждого запроса добавляет папку «Все камеры», в которой будут лежать все собранные камеры пользователя в одной папке

GET/api/v1/cameras/tree

Headers

Authorization

Bearer token

Accept

application/json

X-Client

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

X-UUID

unique device id

Body

searchrequired

string

Поиск по адресу и имени камеры

excluderequired

array

Массив id камер, которые нужно исключить из ответа

hide_allrequired

bool

Если нет search и exclude и прислать true, то в респонсе не будет папки «Все камеры»

Response

200

Возвращает JSON объект дерева

JSON
[
                {
                    "id": 1,
                    "name": "Камеры",
                    "children": [
                        {
                            "id": 2,
                            "name": "Камеры 2",
                            "children": [
                                {
                                    "id": 1,
                                    "name": "Камера 1",
                                    "status": "empty",
                                    "type": "without_server",
                                    "start_at": null,
                                    "group_id": 2,
                                    "top_group_id": 1,
                                    "order": 0,
                                    "created_at": "2023-01-24T10:36:08.000000Z",
                                    "updated_at": "2023-01-24T10:36:08.000000Z",
                                    "origin": null,
                                    "group_type": "public",
                                    "folder_id": null,
                                    "is_sensitive": 0,
                                    "is_public": 0,
                                    "count_issues": 0,
                                    "azimuth": null,
                                    "location": null,
                                    "is_user_owner": false,
                                    "pack_id": null,
                                    "source": "manual",
                                    "archive_storage_days": null,
                                    "is_archive_recording": false,
                                    "is_increased_reconnect": 0,
                                    "model_id": null,
                                    "is_sound_enabled": true,
                                    "is_need_replace": false,
                                    "ip": null,
                                    "path": [
                                        1,
                                        2
                                    ],
                                    "bridge_id": null,
                                    "uuid": null,
                                    "deleted_at": null,
                                    "archive_recording_type": "fulltime",
                                    "is_auto_create_streams": false,
                                    "host_id": null,
                                    "is_enabled": 1,
                                    "is_editable": true,
                                    "is_intercom": false,
                                    "status_changed_at": null,
                                    "services_list": {
                                    "ptz": false,
                                    "motion_detect": false
                                },
                                "services": []
                            },
                            {
                                    "id": 2,
                                    "name": "Камера 2",
                                    "status": "initial",
                                    "type": "media_server_v2",
                                    "start_at": null,
                                    "group_id": 2,
                                    "top_group_id": 1,
                                    "order": 0,
                                    "created_at": "2023-01-24T10:36:28.000000Z",
                                    "updated_at": "2023-01-24T10:36:40.000000Z",
                                    "origin": null,
                                    "group_type": "public",
                                    "folder_id": null,
                                    "is_sensitive": 0,
                                    "is_public": 0,
                                    "count_issues": 0,
                                    "azimuth": null,
                                    "location": null,
                                    "is_user_owner": false,
                                    "pack_id": null,
                                    "source": "manual",
                                    "archive_storage_days": null,
                                    "is_archive_recording": false,
                                    "is_increased_reconnect": 0,
                                    "model_id": null,
                                    "is_sound_enabled": true,
                                    "is_need_replace": false,
                                    "ip": "192.168.204.30",
                                    "path": [
                                        1,
                                        2
                                    ],
                                    "bridge_id": null,
                                    "uuid": null,
                                    "deleted_at": null,
                                    "archive_recording_type": "fulltime",
                                    "is_auto_create_streams": false,
                                    "host_id": null,
                                    "is_enabled": 1,
                                    "is_editable": true,
                                    "is_intercom": false,
                                    "status_changed_at": null,
                                    "services_list": {
                                    "ptz": false,
                                    "motion_detect": false
                                },
                                "services": []
                            },
                            {
                                    "id": 3,
                                    "name": "Камера 3",
                                    "status": "initial",
                                    "type": "media_server_v2",
                                    "start_at": null,
                                    "group_id": 2,
                                    "top_group_id": 1,
                                    "order": 0,
                                    "created_at": "2023-01-24T10:36:40.000000Z",
                                    "updated_at": "2023-01-24T10:36:45.000000Z",
                                    "origin": null,
                                    "group_type": "public",
                                    "folder_id": null,
                                    "is_sensitive": 0,
                                    "is_public": 0,
                                    "count_issues": 0,
                                    "azimuth": null,
                                    "location": null,
                                    "is_user_owner": false,
                                    "pack_id": null,
                                    "source": "manual",
                                    "archive_storage_days": null,
                                    "is_archive_recording": false,
                                    "is_increased_reconnect": 0,
                                    "model_id": null,
                                    "is_sound_enabled": true,
                                    "is_need_replace": false,
                                    "ip": "192.168.204.30",
                                    "path": [
                                        1,
                                        2
                                    ],
                                    "bridge_id": null,
                                    "uuid": null,
                                    "deleted_at": null,
                                    "archive_recording_type": "fulltime",
                                    "is_auto_create_streams": false,
                                    "host_id": null,
                                    "is_enabled": 1,
                                    "is_editable": true,
                                    "is_intercom": false,
                                    "status_changed_at": null,
                                    "services_list": {
                                    "ptz": false,
                                    "motion_detect": false
                                    },
                                "services": []
                            },
                            {
                                "id": 4,
                                "name": "Камера 4",
                                "status": "empty",
                                "type": "without_server",
                                "start_at": null,
                                "group_id": 2,
                                "top_group_id": 1,
                                "order": 0,
                                "created_at": "2023-01-24T10:36:55.000000Z",
                                "updated_at": "2023-01-24T10:36:55.000000Z",
                                "origin": null,
                                "group_type": "public",
                                "folder_id": null,
                                "is_sensitive": 0,
                                "is_public": 0,
                                "count_issues": 0,
                                "azimuth": null,
                                "location": null,
                                "is_user_owner": false,
                                "pack_id": null,
                                "source": "manual",
                                "archive_storage_days": null,
                                "is_archive_recording": false,
                                "is_increased_reconnect": 0,
                                "model_id": null,
                                "is_sound_enabled": true,
                                "is_need_replace": false,
                                "ip": null,
                                "path": [
                                    1,
                                    2
                                ],
                                "bridge_id": null,
                                "uuid": null,
                                "deleted_at": null,
                                "archive_recording_type": "fulltime",
                                "is_auto_create_streams": false,
                                "host_id": null,
                                "is_enabled": 1,
                                "is_editable": true,
                                "is_intercom": false,
                                "status_changed_at": null,
                                "services_list": {
                                "ptz": false,
                                "motion_detect": false
                                },
                            "services": []
                            },
                            {
                                "id": 5,
                                "name": "Камера 5",
                                "status": "empty",
                                "type": "without_server",
                                "start_at": null,
                                "group_id": 2,
                                "top_group_id": 1,
                                "order": 0,
                                "created_at": "2023-01-24T10:37:16.000000Z",
                                "updated_at": "2023-01-24T10:37:16.000000Z",
                                "origin": null,
                                "group_type": "public",
                                "folder_id": null,
                                "is_sensitive": 0,
                                "is_public": 0,
                                "count_issues": 0,
                                "azimuth": null,
                                "location": null,
                                "is_user_owner": false,
                                "pack_id": null,
                                "source": "manual",
                                "archive_storage_days": null,
                                "is_archive_recording": false,
                                "is_increased_reconnect": 0,
                                "model_id": null,
                                "is_sound_enabled": true,
                                "is_need_replace": false,
                                "ip": null,
                                "path": [
                                    1,
                                    2
                                ],
                                "bridge_id": null,
                                "uuid": null,
                                "deleted_at": null,
                                "archive_recording_type": "fulltime",
                                "is_auto_create_streams": false,
                                "host_id": null,
                                "is_enabled": 1,
                                "is_editable": true,
                                "is_intercom": false,
                                "status_changed_at": null,
                                "services_list": {
                                "ptz": false,
                                "motion_detect": false
                                },
                            "services": []
                            }
                        ]
                    }
                ]
                }
            ]
401

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

422

Возвращает JSON объект с ошибкой, см. Валидация

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}

Пример

JSON
curl -k --location --request GET 'https://vms.local/api/v1/cameras/tree?search=string&exclude=array&hide_all=bool' \
--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.