Skip to main content
Skip table of contents

Get compressed camera tree

This request returns a compressed camera tree with cameras having a maximum nesting level of one. It is used on mobile devices

GET/api/v1/cameras/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
Returns a JSON tree object
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": "Camera 1",
                            "pretty_text": "Cameras",
                            "short_address": "Cameras",
                            "full_address": "Cameras",
                            "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": "Camera 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": "Camera 2",
                            "pretty_text": "Cameras",
                            "short_address": "Cameras",
                            "full_address": "Cameras",
                            "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": "Camera 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": "Camera 3",
                            "pretty_text": "Cameras",
                            "short_address": "Cameras",
                            "full_address": "Cameras",
                            "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": "Camera 3"
                        }
                    ],
                    "main_name": "Cameras",
                    "sub_main": "Cameras",
                    "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": "Camera 4",
                            "pretty_text": "Cameras",
                            "short_address": "Cameras",
                            "full_address": "Cameras",
                            "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": "Camera 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": "Camera 5",
                            "pretty_text": "Cameras",
                            "short_address": "Cameras",
                            "full_address": "Cameras",
                            "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": "Camera 5"
                        }
                    ],
                    "main_name": "Cameras",
                    "sub_main": "Cameras",
                    "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
Authorization token not provided or invalid, see Obtaining a token

Example

JSON
curl -k --location --request GET 'https://vms.local/api/v1/cameras/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.