26.09 26.06 26.05 25.12
26.09 26.06 26.05 25.12 Russian English

Update intercom (v2)

Update an intercom (v2)

PATCH  /api/v2/billing/intercoms

With the release of request version v2, version v1 is being moved to legacy.
For new integrations, use the current v2.
Version v1 remains available to support existing integrations.

Unlike v1, instead of group_id/group_external_id the request accepts access_point_id — the UUID of the access point to which the intercom should be moved. When access_point_id is provided, the intercom is detached from its current access point and attached to the specified one.

The intercom is identified by id or mac; id and mac cannot be used together.

JSON
{
    "id": 1,
    "access_point_id": "00000000-0000-0000-0000-000000000002",
    "flat_from": 1,
    "flat_to": 15,
    "new_serial_number": "new_serial_number",
    "new_mac": "22:0D:CE:38:E7:15",
    "model": "3516EV200",
    "name": "intercom name",
    "log_extra": {
        "some": "information"
    }
}

Method parameters

int id, Intercom ID.


string mac, Intercom MAC address.


string access_point_id, UUID of the access point to which the intercom should be moved (replaces the current association).


string name, Intercom name.


integer flat_from, First apartment number connected to the intercom.


integer flat_to, Last apartment number connected to the intercom.


string new_mac, New intercom MAC address.


string new_serial_number, New intercom serial number.


string model, Intercom model (required when updating `new_mac` or `new_serial_number`).


string|array log_extra, Additional information received from an external system.


array onvif_credentials, Credentials for accessing the camera through ONVIF.


boolean is_restricted_live, Restriction on viewing the intercom camera's live stream.


boolean is_restricted_archive, Restriction on viewing the intercom camera's archive recordings.

200  OK

Successful response with updated intercom data

JSON
{
    "id": 123,
    "external_id": "EXT_123",
    "department": "main",
    "title": "New name",
    "mac": "22:22:22:22:22:22",
    "model": "DKS20211",
    "serial_number": "NEW_SERIAL_123",
    "status": "active",
    "flat_from": 1,
    "flat_to": 100,
    "source": "auto-replace"
}

422  Unprocessable Entity

Returns a JSON object containing an error. For a gate, flat_from and flat_to are not sent, and changes to is_restricted_live and is_restricted_archive are rejected; the error is returned under the key error.

For more information, see General information > Validation.

JSON
{
    "message": "No informative message is provided here",
    "errors": {
        "any_key": [
            "The reason for the error is described here"
        ]
    }
}
cURL
Bash
curl -k --request PATCH \
	--url 'https://your-domain/api/v2/billing/intercoms' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "id": 0,
    "mac": "string",
    "access_point_id": "string",
    "name": "string",
    "flat_from": "integer",
    "flat_to": "integer",
    "new_mac": "string",
    "new_serial_number": "string",
    "model": "string",
    "log_extra": "string|array",
    "onvif_credentials": [],
    "is_restricted_live": "boolean",
    "is_restricted_archive": "boolean"
}'
PHP
PHP
$data = array (
  'id' => 0,
  'mac' => 'string',
  'access_point_id' => 'string',
  'name' => 'string',
  'flat_from' => 'integer',
  'flat_to' => 'integer',
  'new_mac' => 'string',
  'new_serial_number' => 'string',
  'model' => 'string',
  'log_extra' => 'string|array',
  'onvif_credentials' => 
  array (
  ),
  'is_restricted_live' => 'boolean',
  'is_restricted_archive' => 'boolean',
);
$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/v2/billing/intercoms', false, $context);