Skip to main content
Skip table of contents

Create a plan

Creating plans

Plans are needed to visualize the location of the cameras. You can upload any image, select among the available cameras and plot them on the image, where they actually stand and in which direction they are facing.

JSON
{
    "image": "image binary data",
    "name": "my card",
    "cameras": [
        {
            "camera_id": 12,
            "x": 0.2,
            "y": 0.3,
            "angle": 50,
            "radius": 50.546,
            "segment_angle": 80.332
        }
    ],
    "latitude": 25.645345244619257,
    "longitude": -37.295444497828434
}

POST /api/v1/maps

Parameters

binary image, Plan image. Possible formats - jpeg,bmp,png


string name, Plan name, which must be unique within the current user


int group_id, ID of the Group belongs to the Map.


array cameras, An array of cameras with x and y coordinates on the image with a rotation angle angle, and also radius (radius of view) and segment_angle (angle of rotation), this data is needed to draw cameras on the image.


double latitude, Latitude coordinate of the plan location


double longitude, Longitude coordinate of the plan location

200 OK

Successful response

JSON
{
    "id": 14,
    "name": "test",
    "created_at": "2022-04-22 14:51:54",
    "updated_at": "2022-04-22 14:51:54",
    "group_id": 1,
    "url": "https://vms.local/storage/path.jpg",
    "latitude": 25.645345244619257,
    "longitude": -37.295444497828434,
    "cameras": [
        {
            "x": 29,
            "y": 82,
            "angle": 61,
            "radius": 50.5463836852,
            "segment_angle": 80.3322,
            "camera": {
                "id": 92650,
                "group_id": 52039,
                "status": "active",
                "type": "mediaserver_v2",
                "start_at": "2022-03-23 14:51:54",
                "created_at": "2020-11-27 16:40:23",
                "billing_id": null,
                "pretty_name": "camera 2",
                "pretty_text": "Region region, District district, City, street Street 1",
                "short_address": "City, street Street 1",
                "full_address": "Region region, District district, City, street Street 1",
                "lat": null,
                "lng": null,
                "azimuth": null,
                "streams": [
                    {
                        "id": 204868,
                        "type": "high",
                        "camera_id": 92650,
                        "is_preview_from_server": true,
                        "is_archive_from_server": null,
                        "status": "active",
                        "has_sound": false
                    },
                    {
                        "id": 204871,
                        "type": "low",
                        "camera_id": 92650,
                        "is_preview_from_server": true,
                        "is_archive_from_server": null,
                        "status": "active",
                        "has_sound": false
                    }
                ],
                "services": {
                    "ptz": false,
                    "motion_detect": false
                },
                "has_sound": false,
                "archive_recording_timetable": {
                    "days": [
                        {
                            "to": "13:39:25",
                            "from": "13:38:25",
                            "type": "monday"
                        }
                    ]
                },
                "archive_ranges": [
                    {
                        "end": 1650627922,
                        "from": 1649312173,
                        "duration": 1315749
                    }
                ],
                "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"
            }
        }
    ]
}

401 Unauthorized

Authorization token not sent or not valid

422 Unprocessable Entity

Returns a JSON object with an error.

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The cause of the error will be described here"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/v1/maps' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "image": "binary",
    "name": "string",
    "group_id": 0,
    "cameras": [],
    "latitude": 0,
    "longitude": 0
}'
PHP
PHP
$data = array (
  'image' => 'binary',
  'name' => 'string',
  'group_id' => 0,
  'cameras' => 
  array (
  ),
  'latitude' => 0.0,
  'longitude' => 0.0,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/maps', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.