Skip to main content
Skip table of contents

Camera update by an external system

Update a camera

You can search a camera by its MAC or external_id.

JSON
{
    "external_id": "bd0a951f-40a2-4edf-b213-bcd90ff5273d",
    "mac": "12:12:12:12:12:11",
    "new_mac": "12:12:12:12:12:12",
    "serial_number": "111111111111",
    "service": "8MP",
    "profile": "[1,0]",
    "name": "Camera 1",
    "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,
    "onvif_credentials": {
        "login": "login",
        "password": "password",
        "port": 80
    },
    "is_can_manage_archive_storage_days": false,
    "is_archive_enabled": true,
    "is_enabled": true,
    "log_extra": {
        "some": "information"
    }
}

PATCH /api/v1/billing/cameras

The method parameters

string external_id – a current external_id of a camera.


string mac – a current MAC address of a camera.


string new_mac – a new MAC address of a camera.


string serial_number – a new serial number of a camera.


string service – a camera profile used to apply configuration templates.


array profile – additional camera details.


string name – a camera name.


string group_type – a camera group type.


int group_id – an ID of a tree element where the camera will be created.


string|int group_external_id – a key for a private folder where the camera will be created.


int folder_id –  a private folder ID where the camera will be placed.


string|int folder_key – a key for a private folder where the camera will be placed.


bool is_user_owner – a flag that indicates if the camera is assigned to a user.


double latitude – denotes the latitude of the camera's location.


double longitude – denotes the longitude of the camera's location.


int archive_storage_days – duration, in days, for which the archive is stored on the camera.


array onvif_credentials – credentials to access the camera via ONVIF.


bool is_archive_enabled – a flag to enable or disable the archive.


bool is_enabled – a flag to enable or disable camera stream capture. When capture is disabled, archive recordings remain available.


string|array log_extra – additional information received from an external system.

201 Created

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 Unprocessable Entity

Returns a JSON object with an error. For details, see VMS Billing/General information/External system validation

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 PATCH \
	--url 'https://your-domain/api/v1/billing/cameras' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "external_id": "string",
    "mac": "string",
    "new_mac": "string",
    "serial_number": "string",
    "service": "string",
    "profile": [],
    "name": "string",
    "group_type": "string",
    "group_id": 0,
    "group_external_id": "string|int",
    "folder_id": 0,
    "folder_key": "string|int",
    "is_user_owner": true,
    "latitude": 0,
    "longitude": 0,
    "archive_storage_days": 0,
    "onvif_credentials": [],
    "is_archive_enabled": true,
    "is_enabled": true,
    "log_extra": "string|array"
}'
PHP
PHP
$data = array (
  'external_id' => 'string',
  'mac' => 'string',
  'new_mac' => 'string',
  'serial_number' => 'string',
  'service' => 'string',
  'profile' => 
  array (
  ),
  'name' => 'string',
  'group_type' => 'string',
  'group_id' => 0,
  'group_external_id' => 'string|int',
  'folder_id' => 0,
  'folder_key' => 'string|int',
  'is_user_owner' => true,
  'latitude' => 0.0,
  'longitude' => 0.0,
  'archive_storage_days' => 0,
  'onvif_credentials' => 
  array (
  ),
  'is_archive_enabled' => true,
  'is_enabled' => true,
  'log_extra' => 'string|array',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PATCH',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/v1/billing/cameras', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.