Skip to main content
Skip table of contents

Обновление домофона «Спутник»

Спутник

JSON
{
    "title": "title",
    "department": 2,
    "camera_id": 6180,
    "collecting_keys": true,
    "group_id": 217498,
    "switch": "metakom",
    "door_open_time_general": 500,
    "department_type": "main",
    "department_name": "department_name",
    "address": "г. Город, ул. Улица 1",
    "is_crossbar_switchers_enabled": true,
    "sip_credentials": {
        "server": "televoip-core.is74.ru",
        "port": 7777,
        "login": "0813c0000082",
        "password": "5eh2270j4fb0d"
    },
    "sip_options": {
        "dtmf": [
            {
                "id": 1,
                "value": "/"
            }
        ]
    },
    "flat_from": 10,
    "flat_to": 15,
    "flat_offset": "1",
    "connection_type": "matrix_switching",
    "commutators_count": 1,
    "matrix": [
        {
            "id": 1,
            "auto": false,
            "capacity": 20,
            "flat_from": 1,
            "items": [
                [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10
                ],
                [
                    11,
                    12,
                    13,
                    14,
                    15,
                    16,
                    17,
                    18,
                    19,
                    20
                ]
            ]
        }
    ],
    "is_restricted_live": false,
    "is_restricted_archive": true
}

PATCH /api/admin/v1/intercoms/{intercom}

Параметры метода

int intercom, Уникальный идентификатор домофона


string title, Название домофона


integer department, Подъезд


integer camera_id, Id камеры, которая относится к домофону


boolean collecting_keys, Сбор ключей


integer group_id, Id группы, в которой находится домофон


string switch, Тип коммутатора. Все типы находятся в


integer door_open_time_general, Время, которое дверь будет открыта после её открытия пользователем (указывается в секундах)


string department_type, Тип входа


string department_name, Название входа


string address, Адрес


bool is_crossbar_switchers_enabled, Включена ли координатно-матричная линия (при её включении достуна настройки матрицы квартир)


integer flat_from, Квартиры с


integer flat_to, Квартиры по


integer flat_offset, Смещение квартир


integer sip_options, Дополнительные настройки SIP сервера.

object integer

string

 

sip_options.

 

REQUIRED

, .dtmf.*.value DTMF код открытия двери


string

 

sip_options.

 

REQUIRED

, .dtmf.*.value DTMF код открытия двери


string

 

sip_options.

 

REQUIRED

, .dtmf.*.value DTMF код открытия двери


string connection_type, Схема подключения домофона, в под ключом intercom_connection_types


integer commutators_count, Количество коммутаторов на домофоне.


bool is_open_door_key, Включение/Выключение открытия домофона ключем.


bool is_open_door_code, Включение/Выключение открытия домофона временным кодом.


bool is_open_door_app, Включение/Выключение открытия домофона приложением.


bool is_open_door_face, Включение/Выключение открытия домофона распознанием лица.


array matrix, Матрица квартир домофона, количество элементов в матрице равно количеству коммутаторов, при изменении одного из полей необходимо присылать целый объект

object array

boolean

 

matrix.

 

REQUIRED

, .is_last_item_first Является ли последний элемент матрицы первым


boolean

 

matrix.

 

REQUIRED

, .is_last_item_first Является ли последний элемент матрицы первым


boolean

 

matrix.

 

REQUIRED

, .is_last_item_first Является ли последний элемент матрицы первым


boolean

 

matrix.

 

REQUIRED

, .is_last_item_first Является ли последний элемент матрицы первым


boolean

 

matrix.

 

REQUIRED

, .is_last_item_first Является ли последний элемент матрицы первым


boolean is_restricted_live, Ограничение просмотра live стрима на камере домофона


boolean is_restricted_archive, Ограничение просмотра archive записи стрима на камере домофона


array timetable, Настройка открытия двери домофона по расписанию

object array

array

 

timetable.days

, Настройка открытия двери домофона по расписанию


string

 

timetable.days.

 

REQUIRED

, .to Время закрытие двери домофона


string

 

timetable.days.

 

REQUIRED

, .to Время закрытие двери домофона


string

 

timetable.days.

 

REQUIRED

, .to Время закрытие двери домофона


array

 

timetable.intervals

, Расписание открытия двери домофона временным интервалам


string

 

timetable.intervals.

 

REQUIRED

, .to Дата и время закрытия двери домофона


string

 

timetable.intervals.

 

REQUIRED

, .to Дата и время закрытия двери домофона


200 OK

Успешный ответ

JSON

{
"id": 14,
"title": "interconnection",
"is_online": true,
"is_registered": null,
"group_id": 4,
"camera_id": 1,
"flat_from": 1,
"flat_to": 100,
"flat_offset": null,
"department": 2,
"department_name": "main enter",
"department_type": "main",
"department_type_pretty": "Основной вход",
"uuid": "5cf7e12b-a91b-4569-bf0c-bbe05718da3c",
"address": "addres",
"group": {
"id": 4,
"name": "тестовые домофоны",
"full_pretty": "домофоны, тестовые домофоны",
"is_house": 1,
"cameras_count": 0,
"parent_id": 3,
"csa_id": null,
"intercoms_count": 1
},
"camera": {
"id": 1,
"group_id": 2,
"status": "inactive",
"type": "media_server_v2",
"start_at": "",
"created_at": "2022-12-06 20:20:50",
"name": "camera name",
"streams": [
{
"id": 2,
"type": "low",
"camera_id": 1,
"status": "active",
"url": "rtsp://admin:password@192.168.204.21:554/Streaming/Channels/102",
"bitrate": 0,
"resolution": "0x0",
"output_rate": 0,
"ip": "192.168.204.13",
"uuid": "a4967207-eb49-4275-b73e-91e771675ac0",
"sound": "tracks-v1",
"streams_count": 0,
"server": {
"id": 1,
"type": "media_server_v2",
"schema": "https",
"internal_domain": "host-name-1.vms.local",
"external_domain": "host-name-1.vms.local",
"domain": "host-name-1.vms.local",
"internal": "8080",
"external": "8443",
"rtsp": "5554",
"traffic_in": 74045,
"traffic_out": 0,
"status": true,
"is_enabled": true,
"has_cache": false,
"proxy": "host-name-1.vms.local",
"created_at": "2022-12-06 20:20:50",
"updated_at": "2022-12-16 10:25:53",
"group_type":"all",
"can_delete": false,
"streams_limit": 100,
"bitrate_limit": 1000000,
"extra": {
"io": {
"read_rate": 0,
"read_bytes": 0,
"write_rate": 0,
"write_bytes": 0
},
"cpu": {
"total": 10,
"usage": 13,
"stime_sec": 15212,
"utime_sec": 15212
},
"mem": {
"rss": 3244748800,
"share": 9314304,
"usage": 5843918848
},
"net": {
"in_bitrate": 75822232,
"out_bitrate": 0
},
"drives": {
"/": {
"fs": "ext4",
"mount": "/",
"inode_free": 1463157,
"inode_total": 1589248,
"capacity_free": 11702407168,
"capacity_total": 25445027840
},
"none": {
"fs": "swap",
"mount": "none",
"inode_free": 0,
"inode_total": 0,
"capacity_free": 0,
"capacity_total": 0
},
"/boot": {
"fs": "ext4",
"mount": "/boot",
"inode_free": 97988,
"inode_total": 98304,
"capacity_free": 1332723712,
"capacity_total": 1547051008
},
"/storage": {
"fs": "ext4",
"mount": "/storage",
"inode_free": 32765326,
"inode_total": 32768000,
"capacity_free": 448026333184,
"capacity_total": 527295578112
}
},
"server": {
"ip4": "192.168.200.15",
"name": "MS-21.03.3-lts-rc-3",
"build": "caeb03b",
"uptime": 247945,
"startat": 1670595943,
"version": "21.03.3",
"hostname": "host-name-1.vms.local",
"revision": "lts-rc-3",
"timestamp": "20221129093237"
},
"cluster": {
"id": "100",
"node": "3",
"enable": "true",
"hostname": "host-name-1.vms.local"
},
"license": {
"type": "enterprise",
"issued": 4102444799
},
"streams": {
"total": 371,
"active": 105,
"clients": 0
},
"storages": {
"/storage": {
"fs": "",
"err": 0,
"name": "default",
"mount": "/storage",
"inode_free": 32765326,
"inode_total": 32768000,
"capacity_free": 448026333184,
"capacity_total": 527295578112
},
"/storage2": {
"fs": "",
"err": -2,
"name": "secondary",
"mount": "/storage2",
"inode_free": 0,
"inode_total": 0,
"capacity_free": 0,
"capacity_total": 0
}
}
},
"is_editable": true
},
"sub_servers": [
{
"id": 2,
"type": "media_server_v2",
"schema": "https",
"internal_domain": "host-name-2.vms.local",
"external_domain": "host-name-2.vms.local",
"domain": "host-name-2.vms.local",
"internal": "8080",
"external": "8443",
"rtsp": "5554",
"traffic_in": 11568,
"traffic_out": 22496,
"status": true,
"is_enabled": true,
"has_cache": false,
"proxy": "host-name-2.vms.local",
"created_at": "2022-12-06 20:20:50",
"updated_at": "2022-12-16 10:25:53",
"group_type":"all",
"can_delete": false,
"streams_limit": 100,
"bitrate_limit": 1000000,
"extra": {
"io": {
"read_rate": 0,
"read_bytes": 0,
"write_rate": 0,
"write_bytes": 0
},
"cpu": {
"total": 5,
"usage": 4,
"stime_sec": 5985,
"utime_sec": 5985
},
"mem": {
"rss": 7734063104,
"share": 5169152,
"usage": 11912642560
},
"net": {
"in_bitrate": 11845448,
"out_bitrate": 23035504
},
"drives": {
"/": {
"fs": "ext4",
"mount": "/",
"inode_free": 1462977,
"inode_total": 1589248,
"capacity_free": 10998165504,
"capacity_total": 25445027840
},
"none": {
"fs": "swap",
"mount": "none",
"inode_free": 0,
"inode_total": 0,
"capacity_free": 0,
"capacity_total": 0
},
"/boot": {
"fs": "ext4",
"mount": "/boot",
"inode_free": 97988,
"inode_total": 98304,
"capacity_free": 1332719616,
"capacity_total": 1547051008
},
"/storage": {
"fs": "ext4",
"mount": "/storage",
"inode_free": 32735783,
"inode_total": 32768000,
"capacity_free": 16777216,
"capacity_total": 527295578112
}
},
"server": {
"ip4": "192.168.200.16",
"name": "MS-21.03.3-lts-rc-3",
"build": "caeb03b",
"uptime": 247945,
"startat": 1670595943,
"version": "21.03.3",
"hostname": "host-name-2.vms.local",
"revision": "lts-rc-3",
"timestamp": "20221129093237"
},
"cluster": {
"id": "100",
"node": "4",
"enable": "true",
"hostname": "host-name-2.vms.local"
},
"license": {
"type": "enterprise",
"issued": 4102444799
},
"streams": {
"total": 374,
"active": 5,
"clients": 75
},
"storages": {
"/storage": {
"fs": "",
"err": 0,
"name": "default",
"mount": "/storage",
"inode_free": 32735783,
"inode_total": 32768000,
"capacity_free": 16777216,
"capacity_total": 527295578112
},
"/storage2": {
"fs": "",
"err": -2,
"name": "secondary",
"mount": "/storage2",
"inode_free": 0,
"inode_total": 0,
"capacity_free": 0,
"capacity_total": 0
}
}
},
"is_editable": true
}
],
"transfer_servers": [],
"transfer_sub_servers": [],
"created_at": "2022-12-06 20:20:50",
"updated_at": "2022-12-12 15:42:13",
"is_preview_from_server": true,
"is_archive_from_server": null,
"is_enabled": true,
"is_can_transfer": true,
"source": "manual",
"is_sound_enabled": false,
"reconnect_attempt": 234,
"reconnect_total": 234,
"reconnect_time": "2022-12-12 14:53:55",
"disconnections_count": 0,
"is_actual": true,
"condition": "incorrect",
"stopped_at": "2022-12-06 20:20:51"
}
],
"can_edit": true,
"origin": null,
"group_type": "public",
"shared_from": null,
"ip": "192.168.204.13",
"lat": null,
"lng": null,
"azimuth": null,
"is_sensitive": false,
"is_buffer_enabled": false,
"is_public": 0,
"archive_ranges": [],
"archive_recording_timetable": null,
"motion_detaction_timetable": [],
"onvif_configuration": null,
"streams_rtsp": null,
"is_ip_reserved": false,
"count_issues": 0,
"source": "manual",
"archive_storage_days": null,
"is_archive_recording": false,
"archive_recording_type": "fulltime",
"is_increased_reconnect": 0,
"is_sound_enabled": true,
"is_bridge": false,
"can_change_archive_timetable": true,
"is_auto_create_streams": false,
"is_provisioning_enable": false,
"is_can_manage_streams": true,
"streams_source": "manual",
"is_can_manage_archive_storage_days": true,
"is_editable": true,
"status_changed_at": "",
"is_intercom": true,
"deleted_at": ""
},
"collecting_keys": true,
"door_open_time_general": 10,
"sip_credentials": {
"server": "webrtc-gw1.vms.local",
"port": 5080,
"login": "xxxxxxxxxxx",
"is_sip_password_installed": true
},
"sip_options": {
"talk_duration": 180,
"ring_duration": 61,
"dtmf": [
{
"id": 1,
"value": "*"
},
{
"id": 2,
"value": "#"
}
]
},
"is_crossbar_switchers_enabled": true,
"is_can_manage_matrix": true,
"matrix": [
{
"id": 1,
"capacity": 20,
"items": [
[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
[
11,
12,
13,
14,
15,
16,
17,
18,
19,
20
]
],
"auto": false,
"is_last_item_first": false,
"flat_from": 1
}
],
"created_at": "2023-01-05 10:42:12",
"updated_at": "2023-01-05 16:35:02",
"mac": "08:13:c0:00:00:82",
"vendor": "interconnection",
"vendor_pretty": "Интерсвязь",
"status": "installed",
"status_pretty": "Установлен",
"switch": "metakom",
"switch_pretty": "Метаком",
"schema": "http",
"ip": "192.168.18.207",
"port": 8080,
"login": "root",
"password": "123456",
"commutators_count": 1,
"connection_type": "matrix_switching",
"connection_type_pretty": "Матрично-коммутационный",
"key_count": null,
"timetable": {
        "days": [
            {
                "to": "23:59:00+05:00",
                "from": "00:00:00+05:00",
                "type": "Monday"
            },
            {
                "to": "23:59:00+05:00",
                "from": "00:00:00+05:00",
                "type": "Friday"
            }
        ],
        "intervals": []
    },
}

401 Unauthorized

Токен авторизации не передан или не валидный

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/intercoms/{intercom}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "intercom": 0,
    "title": "string",
    "department": "integer",
    "camera_id": "integer",
    "collecting_keys": "boolean",
    "group_id": "integer",
    "switch": "string",
    "door_open_time_general": "integer",
    "department_type": "string",
    "department_name": "string",
    "address": "string",
    "is_crossbar_switchers_enabled": true,
    "sip_credentials.": "void",
    "sip_credentials": {
        "": "string"
    },
    "flat_from": "integer",
    "flat_to": "integer",
    "flat_offset": "integer",
    "sip_options": {
        "": "string"
    },
    "sip_options.": "void",
    "connection_type": "string",
    "commutators_count": "integer",
    "is_open_door_key": true,
    "is_open_door_code": true,
    "is_open_door_app": true,
    "is_open_door_face": true,
    "matrix": {
        "": "boolean"
    },
    "matrix.": "void",
    "is_restricted_live": "boolean",
    "is_restricted_archive": "boolean",
    "timetable": {
        "days": {
            "": "string"
        },
        "intervals": {
            "": "string"
        }
    },
    "timetable.days": "void",
    "timetable.days.": "void",
    "timetable.intervals": "void",
    "timetable.intervals.": "void"
}'
PHP
PHP
$data = array (
  'intercom' => 0,
  'title' => 'string',
  'department' => 'integer',
  'camera_id' => 'integer',
  'collecting_keys' => 'boolean',
  'group_id' => 'integer',
  'switch' => 'string',
  'door_open_time_general' => 'integer',
  'department_type' => 'string',
  'department_name' => 'string',
  'address' => 'string',
  'is_crossbar_switchers_enabled' => true,
  'sip_credentials.' => 'void',
  'sip_credentials' => 
  array (
    '' => 'string',
  ),
  'flat_from' => 'integer',
  'flat_to' => 'integer',
  'flat_offset' => 'integer',
  'sip_options' => 
  array (
    '' => 'string',
  ),
  'sip_options.' => 'void',
  'connection_type' => 'string',
  'commutators_count' => 'integer',
  'is_open_door_key' => true,
  'is_open_door_code' => true,
  'is_open_door_app' => true,
  'is_open_door_face' => true,
  'matrix' => 
  array (
    '' => 'boolean',
  ),
  'matrix.' => 'void',
  'is_restricted_live' => 'boolean',
  'is_restricted_archive' => 'boolean',
  'timetable' => 
  array (
    'days' => 
    array (
      '' => 'string',
    ),
    'intervals' => 
    array (
      '' => 'string',
    ),
  ),
  'timetable.days' => 'void',
  'timetable.days.' => 'void',
  'timetable.intervals' => 'void',
  'timetable.intervals.' => 'void',
);
$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/admin/v1/intercoms/{intercom}', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.