Breadcrumbs

Create an intercom

The method and parameters

POST  /api/v1/billing/intercoms

JSON
{
    "group_external_id": "00000000-0000-0000-0000-000000000001",
    "flat_from": 1,
    "flat_to": 15,
    "serial_number": "serial_number",
    "mac": "AA:BB:CC:DD:EE:FF",
    "vendor": "interconnection",
    "model": "3516EV200",
    "name": "intercom name",
    "department": 1,
    "log_extra": {
        "some": "information"
    }
}


integer group_id  required – the ID of the group (address) the intercom belongs to.


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


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. 


string serial_number  required – the serial number of the intercom panel.


string mac  required – the intercom panel MAC address, use the AA:BB:CC:DD:EE:FF format.


string vendor  required – the vendor of the intercom panel.


string model  required – the panel model. Must be supported by the specified vendor.


string name  required – the name of the intercom (entrance) that will be visible to users.


integer department  required – the entrance number: from 1 to 10 000.


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

200  OK

Successful response

JSON
{
    "id": 1,
    "external_id": null,
    "department": 1,
    "title": "intercom name",
    "mac": "A:BB:CC:DD:EE:FF",
    "model": "3516EV200",
    "serial_number": "serial_number",
    "status": "empty",
    "flat_from": 1,
    "flat_to": 15,
    "source": "auto"
}

401  Unauthorized

The authorization token isn’t sent or invalid

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 POST \
	--url 'https://your-domain/api/v1/billing/intercoms' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "group_id": "integer",
    "group_external_id": "string",
    "flat_from": "integer",
    "flat_to": "integer",
    "serial_number": "string",
    "mac": "string",
    "vendor": "string",
    "model": "string",
    "name": "string",
    "department": "integer",
    "log_extra": "string|array"
}'
PHP
PHP
$data = array (
  'group_id' => 'integer',
  'group_external_id' => 'string',
  'flat_from' => 'integer',
  'flat_to' => 'integer',
  'serial_number' => 'string',
  'mac' => 'string',
  'vendor' => 'string',
  'model' => 'string',
  'name' => 'string',
  'department' => 'integer',
  'log_extra' => 'string|array',
);
$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/billing/intercoms', false, $context);