Breadcrumbs

Upate settings of an intercom flat

The method and parameters

PATCH  /api/v1/billing/intercom-flats

The intercom can be specified by intercom_id. The flat can be specified by flat or flat_id.

An example of the request body:

JSON
{
    "intercom_id": 1,
    "flat": 10,
    "is_smartphone_sip_line_available": true,
    "is_landline_sip_line_available": true,
    "is_analog_line_available": false
}

int intercom_id – the intercom ID.


int flat – the flat number (mutually exclusive with flat_id)


int flat_id – intercom flat record ID (mutually exclusive with flat)


bool is_smartphone_sip_line_available –availability of smartphone SIP line


bool is_landline_sip_line_available –availability of the landline SIP line.


bool is_analog_line_available – availability of analog line.

200  OK

A successful response with the updated flat parameters

JSON
{
    "id": 10,
    "flat": 12,
    "key_count": 0,
    "users_count": 0,
    "intercom_id": 1,
    "properties": {
        "is_smartphone_sip_line_available": true,
        "is_landline_sip_line_available": false,
        "is_analog_line_available": true
    }
}

422  Unprocessable Entity

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

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
Bash
curl -k --request PATCH \
	--url 'https://your-domain/api/v1/billing/intercom-flats' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "intercom_id": 0,
    "flat": 0,
    "flat_id": 0,
    "is_smartphone_sip_line_available": true,
    "is_landline_sip_line_available": true,
    "is_analog_line_available": true
}'
PHP
PHP
$data = array (
  'intercom_id' => 0,
  'flat' => 0,
  'flat_id' => 0,
  'is_smartphone_sip_line_available' => true,
  'is_landline_sip_line_available' => true,
  'is_analog_line_available' => true,
);
$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/intercom-flats', false, $context);