Skip to main content
Skip table of contents

Creating a camera. VMS Billing API

To specify where in the tree to create a camera, you can send both the id from our database and the key that is specified when creating the tree element, see Creating a tree element.

If the camera needs to be placed in a private folder, you can send both the id from our database and the key that was specified when the folder was created.

This folder must be created in the same tree element where the camera is created, see Creating a Private Folder

POST/api/v1/billing/cameras

Headers

Accept

application/json

Body

json

JSON
{
    "name": "Camera 1",
    "mac": "11:11:11:11:11:11",
    "serial_number": "12345678",
    "group_type": "private",
    "group_id": 16,
    "group_external_id": 16,
    "folder_key": 123,
    "folder_id": 3,
    "is_user_owner": false,
    "latitude": -28.776933731993793,
    "longitude": 76.65771489519997,
    "archive_storage_days": 5,
    "service": "8MP",
    "external_id": "unique_id",
    "onvif_credentials": {
        "login": "login",
        "password": "password"
    }
}

namerequired

string

Camera name

macrequired

string

Camera MAC address

serial_numberrequired

string

Camera serial number

group_typerequired

string

Camera group type

group_idrequired

int

The id of the tree element in which to create the camera

group_external_idrequired

string|int

The key of the tree element in which to create the camera

folder_idrequired

int

The Id of the private folder where the camera should be placed

folder_keyrequired

string|int

The key of the private folder in which to place the camera

is_user_ownerrequired

bool

The flag that is responsible for the ownership of the camera by the user

latituderequired

double

Latitude at which the camera is located

longituderequired

double

Longitude where the camera is located

archive_storage_daysrequired

int

Number of days of archive storage on the camera

servicerequired

string

Camera profile, used to apply templates

external_idrequired

string

The unique identifier of the camera, which can be used to further refer to this camera

onvif_credentialsrequired

array

Credentials for camera access via onvif

Response

201

Successful response

JSON
{
                "id": 26,
                "status": "empty",
                "name": "Camera 1",
                "is_archive_recording": true,
                "archive_storage_days": 5,
                "group_type": "private",
                "is_user_owner": false,
                "is_need_replace": false,
                "latitude": -28.776933731993793,
                "longitude": 76.65771489519997,
                "network_device": {
                    "mac": "11:11:11:11:11:11",
                    "serial_number": "12345678"
                },
                "folder": {
                    "id": 3,
                    "key": "123"
                }
            }
422

Returns a JSON object with an error. Validation

JSON
{
    "message": "There will be no informative message here",
    "errors": {
        "any_key": [
            "The reason for the error will be described here"
        ]
    }
}

Example

JSON
curl -k --location --request POST 'https://vms.local/api/v1/billing/cameras' \
--header 'Accept:application/json' \
--header 'Content-Type: application/json \
--data-raw '{
    "name": "Camera 1",
    "mac": "11:11:11:11:11:11",
    "serial_number": "12345678",
    "group_type": "private",
    "group_id": 16,
    "group_external_id": 16,
    "folder_key": 123,
    "folder_id": 3,
    "is_user_owner": false,
    "latitude": -28.776933731993793,
    "longitude": 76.65771489519997,
    "archive_storage_days": 5,
    "service": "8MP",
    "external_id": "unique_id",
    "onvif_credentials": {
        "login": "login",
        "password": "password"
    }
}'
JavaScript errors detected

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

If this problem persists, please contact our support.