Skip to main content
Skip table of contents

Create and link keys to an apartment

Create and link keys to an apartment

When creating keys, they are initially entered into the intercom and after that, in case of a successful response from the intercom, they are entered into the platform.

JSON
{
    "flat": null,
    "keys": [
        "0000003045CAAC",
        "0000003046CAAC"
    ]
}

POST /api/admin/v1/intercoms/{intercom}/keys

Parameters

int intercom, Unique identifier of the intercom


array keys, Array of intercom keys.

object array

string

 

keys.

 

REQUIRED

, Key


integer flat, flat apartments to which the keys will be linked [VMS Admin/Intercom/Intercom Apartments/List of Intercom Apartments](../flats/index.md)

200 OK

A successful response will return all generated keys

JSON
[
    {
        "id": 7,
        "key": "0000003045CAAC",
        "flat": null,
        "created_at": "2022-11-14 14:27:14",
        "updated_at": "2022-11-14 14:27:14"
    },
    {
        "id": 8,
        "key": "0000003046CAAC",
        "flat": null,
        "created_at": "2022-11-14 14:27:14",
        "updated_at": "2022-11-14 14:27:14"
    }
]

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}/keys' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "intercom": 0,
    "keys": {
        "": "string"
    },
    "keys.": "void",
    "flat": "integer"
}'
PHP
PHP
$data = array (
  'intercom' => 0,
  'keys' => 
  array (
    '' => 'string',
  ),
  'keys.' => 'void',
  'flat' => '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}/keys', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.