Skip to main content
Skip table of contents

Получение плоского дерева камер. VMS Client API

Возвращает сжатое дерево камер с камерами c максимальной вложенностью один. Используется на мобильных устройствах

GET/api/v1/users/flat-tree
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": 5,
                    "cameras": [
                        {
                            "id": 3,
                            "group_id": 5,
                            "status": "inactive",
                            "type": "media_server_v2",
                            "start_at": "",
                            "created_at": "2022-12-06 20:20:50",
                            "billing_id": null,
                            "pretty_name": "Камера 1",
                            "pretty_text": "Камеры",
                            "short_address": "Камеры",
                            "full_address": "Камеры",
                            "lat": null,
                            "lng": null,
                            "azimuth": null,
                            "streams": [
                                {
                                    "id": 5,
                                    "type": "high",
                                    "camera_id": 3,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                },
                                {
                                    "id": 6,
                                    "type": "low",
                                    "camera_id": 3,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                }
                            ],
                            "services": {
                                "ptz": false,
                                "motion_detect": false
                            },
                            "has_sound": false,
                            "is_archive_recording": false,
                            "archive_recording_type": "fulltime",
                            "can_change_archive_timetable": false,
                            "is_bridge": false,
                            "is_favorite": false,
                            "user_status": "active",
                            "name": "Камера 1"
                        },
                        {
                            "id": 5,
                            "group_id": 5,
                            "status": "inactive",
                            "type": "media_server_v2",
                            "start_at": "",
                            "created_at": "2022-12-06 20:20:51",
                            "billing_id": null,
                            "pretty_name": "Камера 2",
                            "pretty_text": "Камеры",
                            "short_address": "Камеры",
                            "full_address": "Камеры",
                            "lat": null,
                            "lng": null,
                            "azimuth": null,
                            "streams": [
                                {
                                    "id": 9,
                                    "type": "high",
                                    "camera_id": 5,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                },
                                {
                                    "id": 10,
                                    "type": "low",
                                    "camera_id": 5,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                }
                            ],
                            "services": {
                                "ptz": false,
                                "motion_detect": false
                            },
                            "has_sound": false,
                            "is_archive_recording": false,
                            "archive_recording_type": "fulltime",
                            "can_change_archive_timetable": false,
                            "is_bridge": false,
                            "is_favorite": false,
                            "user_status": "active",
                            "name": "Камера 2"
                        },
                        {
                            "id": 4,
                            "group_id": 5,
                            "status": "inactive",
                            "type": "media_server_v2",
                            "start_at": "",
                            "created_at": "2022-12-06 20:20:51",
                            "billing_id": null,
                            "pretty_name": "Камера 3",
                            "pretty_text": "Камеры",
                            "short_address": "Камеры",
                            "full_address": "Камеры",
                            "lat": null,
                            "lng": null,
                            "azimuth": null,
                            "streams": [
                                {
                                    "id": 7,
                                    "type": "high",
                                    "camera_id": 4,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                },
                                {
                                    "id": 8,
                                    "type": "low",
                                    "camera_id": 4,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                }
                            ],
                            "services": {
                                "ptz": false,
                                "motion_detect": false
                            },
                            "has_sound": false,
                            "is_archive_recording": false,
                            "archive_recording_type": "fulltime",
                            "can_change_archive_timetable": false,
                            "is_bridge": false,
                            "is_favorite": false,
                            "user_status": "active",
                            "name": "Камера 3"
                        }
                    ],
                    "main_name": "Камеры",
                    "sub_main": "Камеры",
                    "has_cameras": true,
                    "children": [],
                    "previews": [
                        {
                            "preview": "https://host-name-3.vms.local:8443/live/0338126d-3d9b-4fff-8755-4f083623eb25/preview.mp4?token=token",
                            "status": "active",
                            "camera_id": 3
                        },
                        {
                            "preview": "https://host-name-3.vms.local:8443/live/aaf41834-afc7-4d42-ba42-9255b5643b7a/preview.mp4?token=token",
                            "status": "active",
                            "camera_id": 5
                        },
                        {
                            "preview": "https://host-name-3.vms.local:8443/live/c8eaf31e-ea30-4fd1-9b4e-4208da76e7dc/preview.mp4?token=token",
                            "status": "active",
                            "camera_id": 4
                        }
                    ]
                },
                {
                    "id": 2,
                    "cameras": [
                        {
                            "id": 2,
                            "group_id": 2,
                            "status": "inactive",
                            "type": "media_server_v2",
                            "start_at": "",
                            "created_at": "2022-12-06 20:20:50",
                            "billing_id": null,
                            "pretty_name": "Камера 4",
                            "pretty_text": "Камеры",
                            "short_address": "Камеры",
                            "full_address": "Камеры",
                            "lat": null,
                            "lng": null,
                            "azimuth": null,
                            "streams": [
                                {
                                    "id": 3,
                                    "type": "high",
                                    "camera_id": 2,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                },
                                {
                                    "id": 4,
                                    "type": "low",
                                    "camera_id": 2,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                }
                            ],
                            "services": {
                                "ptz": false,
                                "motion_detect": false
                            },
                            "has_sound": false,
                            "is_archive_recording": false,
                            "archive_recording_type": "fulltime",
                            "can_change_archive_timetable": false,
                            "is_bridge": false,
                            "is_favorite": false,
                            "user_status": "active",
                            "name": "Камера 4"
                        },
                        {
                            "id": 1,
                            "group_id": 2,
                            "status": "inactive",
                            "type": "media_server_v2",
                            "start_at": "",
                            "created_at": "2022-12-06 20:20:50",
                            "billing_id": null,
                            "pretty_name": "Камера 5",
                            "pretty_text": "Камеры",
                            "short_address": "Камеры",
                            "full_address": "Камеры",
                            "lat": null,
                            "lng": null,
                            "azimuth": null,
                            "streams": [
                                {
                                    "id": 1,
                                    "type": "high",
                                    "camera_id": 1,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                },
                                {
                                    "id": 2,
                                    "type": "low",
                                    "camera_id": 1,
                                    "is_preview_from_server": true,
                                    "is_archive_from_server": null,
                                    "status": "inactive",
                                    "has_sound": false,
                                    "width": null,
                                    "height": null
                                }
                            ],
                            "services": {
                                "ptz": false,
                                "motion_detect": false
                            },
                            "has_sound": false,
                            "is_archive_recording": false,
                            "archive_recording_type": "fulltime",
                            "can_change_archive_timetable": false,
                            "is_bridge": false,
                            "is_favorite": false,
                            "user_status": "active",
                            "name": "Камера 5"
                        }
                    ],
                    "main_name": "Камеры",
                    "sub_main": "Камеры",
                    "has_cameras": true,
                    "children": [],
                    "previews": [
                        {
                            "preview": "https://host-name-3.vms.local:8443/live/3810e0d7-c289-444f-b2e5-b0ceb76b6fc4/preview.mp4?token=token",
                            "status": "active",
                            "camera_id": 2
                        },
                        {
                            "preview": "https://host-name-3.vms.local:8443/live/cef317ed-6155-4db7-b2d2-9728322b8a65/preview.mp4?token=token",
                            "status": "active",
                            "camera_id": 1
                        }
                    ]
                }
            ]
401
Токен авторизации не передан или не валидный, см. Получение токена
Пример
JSON
curl -k --location --request GET 'https://vms.local/api/v1/users/flat-tree' \
--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.