Breadcrumbs

Updаte an intercom

The method and parameters

PATCH  /api/v1/billing/intercoms

To identify the intercom, use id or mac, you cannot use id and mac at the same time.

An intercom can be identified by either a unique ID or its MAC address. Providing both simultaneously isn’t supported.

JSON
{
    "group_external_id": "00000000-0000-0000-0000-000000000001",
    "flat_from": 1,
    "flat_to": 15,
    "new_serial_number": "new_serial_number",
    "mac": "AA:BB:CC:DD:EE:FF",
    "new_mac": "22:0D:CE:38:E7:15",
    "model": "3516EV200",
    "name": "intercom name",
    "department": 1,
    "log_extra": {
        "some": "information"
    }
}

int id – the intercom ID.


string mac – the MAC address of the intercom.


string title – the intercom name.


integer flat_from – the number of the first apartment in the range of apartments connected to the intercom panel.


integer flat_to – the number of the last apartment in the range of apartments connected to the intercom panel.


integer group_id  required – the ID of the group (address) the intercom will be assigned to.


string group_external_id – the external ID of the group (address). An alternative to group_id.


string new_mac – a new MAC address of the intercom.


string new_serial_number – a new serial number of the intercom.


string model – an intercom model. It’s required when updating new_mac or new_serial_number.


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


array onvif_credentials – credentials to access the camera via ONVIF.

200  OK

A successful response with updated intercom details.

JSON
{
    "id": 123,
    "external_id": "EXT_123",
    "department": "main",
    "title": "New title",
    "mac": "22:22:22:22:22:22",
    "model": "DKS20211",
    "serial_number": "NEW_SERIAL_123",
    "status": "installed",
    "flat_from": 1,
    "flat_to": 100,
    "source": "auto-replace",
    "group": {
        "id": 6,
        "name": "4",
        "external_id": "0e4bbda6-b7a5-4db4-8178-315bf0006d11",
        "has_items": false
    }
}

422  Unprocessable Entity

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

JSON
{
    "message": "No error message here",
    "errors": {
        "any_key": [
            "Error details"
        ]
    }
}
cURL
Bash
curl -k --request PATCH \
	--url 'https://your-domain/api/v1/billing/intercoms' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "id": 0,
    "mac": "string",
    "title": "string",
    "flat_from": "integer",
    "flat_to": "integer",
    "group_id": "integer",
    "group_external_id": "string",
    "new_mac": "string",
    "new_serial_number": "string",
    "model": "string",
    "log_extra": "string|array",
    "onvif_credentials": []
}'
PHP
PHP
$data = array (
  'id' => 0,
  'mac' => 'string',
  'title' => 'string',
  'flat_from' => 'integer',
  'flat_to' => 'integer',
  'group_id' => 'integer',
  'group_external_id' => 'string',
  'new_mac' => 'string',
  'new_serial_number' => 'string',
  'model' => 'string',
  'log_extra' => 'string|array',
  'onvif_credentials' => 
  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/intercoms', false, $context);