Skip to main content
Skip table of contents

Getting camera tree. VMS Client API

Returns a camera tree with camera objects. For each request, it adds a folder called «All cameras» that contains all the collected user's cameras in one folder

GET/api/v1/users/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

Search by camera address and name

excluderequired

array

Array of camera IDs to exclude from the response

hide_allrequired

bool

If there is no search and exclude, and you send true, the response will not include the «All Cameras» folder

Response

200

Returns a JSON object of the tree

JSON
[
    {
        "id": 0,
        "name": "All cameras",
        "children": [],
        "cameras": [
            {
                "id": 787,
                "group_id": 100,
                "status": "active",
                "type": "media_server_v2",
                "start_at": "2022-02-15 15:14:06",
                "created_at": "2022-02-03 10:30:28",
                "billing_id": null,
                "pretty_name": "Camera 1",
                "pretty_text": "Cameras",
                "short_address": "Cameras",
                "full_address": "Cameras",
                "lat": null,
                "lng": null,
                "azimuth": null,
                "streams": [
                    {
                        "id": 813,
                        "type": "high",
                        "camera_id": 787,
                        "is_preview_from_server": true,
                        "is_archive_from_server": null,
                        "status": "active",
                        "has_sound": false
                    },
                    {
                        "id": 814,
                        "type": "low",
                        "camera_id": 787,
                        "is_preview_from_server": true,
                        "is_archive_from_server": null,
                        "status": "active",
                        "has_sound": false
                    }
                ],
                "services": {
                    "ptz": false,
                    "motion_detect": false
                },
                "has_sound": false,
                "is_archive_recording": true,
                "is_bridge": false,
                "is_favorite": false,
                "is_owner": true,
                "can_change_archive_timetable": true,
                "archive_recording_type": "timetable",
                "user_status": "active",
                "name": "Camera 1"
            },
            {
                "id": 763,
                "group_id": 100,
                "status": "inactive",
                "type": "media_server_v2",
                "start_at": "",
                "created_at": "2022-01-27 20:13:33",
                "billing_id": null,
                "pretty_name": "Camera 2",
                "pretty_text": "Cameras",
                "short_address": "Cameras",
                "full_address": "Cameras",
                "lat": null,
                "lng": null,
                "azimuth": null,
                "streams": [
                    {
                        "id": 768,
                        "type": "high",
                        "camera_id": 763,
                        "is_preview_from_server": true,
                        "is_archive_from_server": null,
                        "status": "inactive",
                        "has_sound": false
                    },
                    {
                        "id": 769,
                        "type": "low",
                        "camera_id": 763,
                        "is_preview_from_server": true,
                        "is_archive_from_server": null,
                        "status": "inactive",
                        "has_sound": false
                    }
                ],
                "services": {
                    "ptz": false,
                    "motion_detect": false
                },
                "has_sound": false,
                "is_archive_recording": true,
                "is_bridge": false,
                "is_favorite": false,
                "is_owner": true,
                "can_change_archive_timetable": true,
                "archive_recording_type": "timetable",
                "user_status": "active",
                "name": "Camera 2"
            }
        ],
        "has_cameras": true
    },
    {
        "id": 97,
        "name": "All cameras 2",
        "children": [
            {
                "id": 98,
                "name": "Camera 2",
                "children": [],
                "cameras": [
                    {
                        "id": 748,
                        "group_id": 98,
                        "status": "partial",
                        "type": "media_server_v2",
                        "start_at": "2022-02-02 11:58:07",
                        "created_at": "2022-01-27 19:13:57",
                        "billing_id": null,
                        "pretty_name": "Camera 3",
                        "pretty_text": "Cameras 2",
                        "short_address": "Cameras 2",
                        "full_address": "Cameras 2",
                        "lat": null,
                        "lng": null,
                        "azimuth": null,
                        "streams": [
                            {
                                "id": 739,
                                "type": "high",
                                "camera_id": 748,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "inactive",
                                "has_sound": false
                            }
                        ],
                        "services": {
                            "ptz": false,
                            "motion_detect": false
                        },
                        "has_sound": false,
                        "is_archive_recording": true,
                        "is_bridge": false,
                        "is_favorite": false,
                        "is_owner": true,
                        "can_change_archive_timetable": true,
                        "archive_recording_type": "timetable",
                        "user_status": "active",
                        "name": "Camera 3"
                    },
                    {
                        "id": 745,
                        "group_id": 98,
                        "status": "active",
                        "type": "media_server_v2",
                        "start_at": "2022-02-02 11:58:07",
                        "created_at": "2022-01-27 18:55:48",
                        "billing_id": null,
                        "pretty_name": "Camera 4",
                        "pretty_text": "Cameras 2",
                        "short_address": "Cameras 2",
                        "full_address": "Cameras 2",
                        "lat": null,
                        "lng": null,
                        "azimuth": null,
                        "streams": [
                            {
                                "id": 733,
                                "type": "high",
                                "camera_id": 745,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            },
                            {
                                "id": 734,
                                "type": "low",
                                "camera_id": 745,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            }
                        ],
                        "services": {
                            "ptz": false,
                            "motion_detect": false
                        },
                        "has_sound": false,
                        "is_archive_recording": true,
                        "is_bridge": false,
                        "is_favorite": false,
                        "is_owner": true,
                        "can_change_archive_timetable": true,
                        "archive_recording_type": "timetable",
                        "user_status": "active",
                        "name": "Camera 4"
                    }
                ],
                "has_cameras": true
            },
            {
                "id": 101,
                "name": "Cameras 3",
                "children": [],
                "cameras": [
                    {
                        "id": 751,
                        "group_id": 101,
                        "status": "active",
                        "type": "media_server_v2",
                        "start_at": "2022-02-02 11:58:07",
                        "created_at": "2022-01-27 19:46:27",
                        "billing_id": null,
                        "pretty_name": "Camera 5",
                        "pretty_text": "Cameras 3",
                        "short_address": "Cameras 3",
                        "full_address": "Cameras 3",
                        "lat": null,
                        "lng": null,
                        "azimuth": null,
                        "streams": [
                            {
                                "id": 744,
                                "type": "high",
                                "camera_id": 751,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            },
                            {
                                "id": 745,
                                "type": "low",
                                "camera_id": 751,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            }
                        ],
                        "services": {
                            "ptz": false,
                            "motion_detect": false
                        },
                        "has_sound": false,
                        "is_archive_recording": true,
                        "is_bridge": false,
                        "is_favorite": false,
                        "is_owner": true,
                        "can_change_archive_timetable": true,
                        "archive_recording_type": "timetable",
                        "user_status": "active",
                        "name": "Camera 5"
                    },
                    {
                        "id": 759,
                        "group_id": 101,
                        "status": "active",
                        "type": "media_server_v2",
                        "start_at": "2022-02-02 11:58:07",
                        "created_at": "2022-01-27 19:55:17",
                        "billing_id": null,
                        "pretty_name": "Camera 6",
                        "pretty_text": "Cameras 3",
                        "short_address": "Cameras 3",
                        "full_address": "Cameras 3",
                        "lat": null,
                        "lng": null,
                        "azimuth": null,
                        "streams": [
                            {
                                "id": 760,
                                "type": "high",
                                "camera_id": 759,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            },
                            {
                                "id": 761,
                                "type": "low",
                                "camera_id": 759,
                                "is_preview_from_server": true,
                                "is_archive_from_server": null,
                                "status": "active",
                                "has_sound": false
                            }
                        ],
                        "services": {
                            "ptz": false,
                            "motion_detect": false
                        },
                        "has_sound": false,
                        "is_archive_recording": true,
                        "is_bridge": false,
                        "is_favorite": false,
                        "is_owner": true,
                        "can_change_archive_timetable": true,
                        "archive_recording_type": "timetable",
                        "user_status": "active",
                        "name": "Camera 6"
                    }
                ],
                "has_cameras": true
            }
        ],
        "cameras": [],
        "has_cameras": false
    }
]
401

Authorization token not provided or invalid, see Obtaining a token

422

Returns a JSON object with an error, see Validation

JSON
{
    "message": "There won't be any informative message here",
    "errors": {
        "any_key": [
            "Here the error cause will be described"
        ]
    }
}

Example

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