Update a Sputnik intercom
Update a Sputnik intercom
{
"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": "City, street Street 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} |
Parameters
int
intercom, Unique identifier of the intercom
string
title, Intercom name
integer
department, Entrance
integer
camera_id, Id of the camera that belongs to the intercom
boolean
collecting_keys, Collecting keys
integer
group_id, Id of the group in which the intercom is located
string
switch, Switch type.
integer
door_open_time_general, Time that the door will be open after the user opens it (indicated in seconds)
string
department_type, The input type
string
department_name, Name of the entrance
string
address, Address
bool
is_crossbar_switchers_enabled, Is the coordinate matrix line enabled (if it is enabled, the apartment matrix settings are available)
integer
flat_from, Apartments with
integer
flat_to, Apartments by
integer
flat_offset, Offset of apartments
integer
sip_options, Additional SIP server settings.
object integer
string
sip_options.
REQUIRED
, .dtmf.*.value DTMF door opening code
string
sip_options.
REQUIRED
, .dtmf.*.value DTMF door opening code
string
sip_options.
REQUIRED
, .dtmf.*.value DTMF door opening code
string
connection_type, Intercom connection diagram, under the intercom_connection_types key
integer
commutators_count, Number of switches on the intercom.
bool
is_open_door_key, Enable/Disable opening the intercom with a key.
bool
is_open_door_code, Enable/Disable opening of the intercom with a time code.
bool
is_open_door_app, Enable/disable opening of the intercom by the application.
bool
is_open_door_face, Enable/Disable opening of the intercom by face recognition.
array
matrix, Matrix of intercom apartments, the number of elements in the matrix is equal to the number of switches, when changing one of the fields, you must send the whole object
object array
boolean
matrix.
REQUIRED
, .is_last_item_first Whether the last element of the matrix is the first
boolean
matrix.
REQUIRED
, .is_last_item_first Whether the last element of the matrix is the first
boolean
matrix.
REQUIRED
, .is_last_item_first Whether the last element of the matrix is the first
boolean
matrix.
REQUIRED
, .is_last_item_first Whether the last element of the matrix is the first
boolean
matrix.
REQUIRED
, .is_last_item_first Whether the last element of the matrix is the first
boolean
is_restricted_live, Restricting viewing of the live stream on the intercom camera
boolean
is_restricted_archive, Restricting viewing archive of stream recording on the intercom camera
array
timetable, Configuring the opening of the intercom door according to a schedule
object array
array
timetable.days
, Setting up the opening of the intercom door according to a schedule
string
timetable.days.
REQUIRED
, .to Intercom door closing time
string
timetable.days.
REQUIRED
, .to Intercom door closing time
string
timetable.days.
REQUIRED
, .to Intercom door closing time
array
timetable.intervals
, Intercom door opening schedule by time intervals
string
timetable.intervals.
REQUIRED
, .to Date and time of closing the intercom door
string
timetable.intervals.
REQUIRED
, .to Date and time of closing the intercom door
200 |
Successful response
JSON
|
401 |
Authorization token not sent or not valid |
cURL
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
$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);