Skip to main content
Skip table of contents

Build the matrix

Build the matrix

Build a matrix. The matrix capacity differs depending on the switch type.

JSON
{
    "switch": "metakom",
    "capacity": 20,
    "is_last_item_first": true,
    "flat_from": 1
}

POST /api/admin/v1/intercoms/{intercom}/common-matrix

Parameters

int intercom, Unique identifier of the intercom


string switch, Switch type.


integer capacity, Number of apartments within 1 switch, under the intercom_flat_capacity key


boolean is_last_item_first, Whether the last element of the matrix is ​​the first


200 OK

Successful response

JSON
{
    "capacity": 20,
    "items": [
        [
            20,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9
        ],
        [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19
        ]
    ]
}

401 Unauthorized

Authorization token not sent or not valid

422 Unprocessable Entity

Returns a JSON object with an error.

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 POST \
	--url 'https://your-domain/api/admin/v1/intercoms/{intercom}/common-matrix' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "intercom": 0,
    "switch": "string",
    "capacity": "integer",
    "is_last_item_first": "boolean",
    "matrix.": "void",
    "matrix": {
        "": "integer"
    }
}'
PHP
PHP
$data = array (
  'intercom' => 0,
  'switch' => 'string',
  'capacity' => 'integer',
  'is_last_item_first' => 'boolean',
  'matrix.' => 'void',
  'matrix' => 
  array (
    '' => 'integer',
  ),
);
$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/admin/v1/intercoms/{intercom}/common-matrix', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.