2n Ip HTTP API Manual en 2.23
2n Ip HTTP API Manual en 2.23
IP intercoms
Configuration Manual
2N TELEKOMUNIKACE a.s. administers the FAQ database to help you quickly find
information and to answer your questions about 2N products and services. On www.
faq.2n.cz you can find information regarding products adjustment and instructions for
optimum use and procedures „What to do if...".
2N TELEKOMUNIKACE a.s. hereby declares that the 2N ® product complies with all
basic requirements and other relevant provisions of the 1999/5/EC directive. For the
full wording of the Declaration of Conformity see the CD-ROM (if enclosed) or our
website at www.2n.cz.
This device complies with part 15 of the FCC Rules. Operation is subject to the
following two conditions: (1) This device may not cause harmful interference, and (2)
this device must accept any interference received, including interference that may
cause undesired operation.
The 2N TELEKOMUNIKACE a.s. is the holder of the ISO 9001:2009 certificate. All
development, production and distribution processes of the company are managed by
this standard and guarantee a high quality, technical level and professional aspect of
all our products.
Content:
1. Introduction
2. HTTP API Description
3. HTTP API Services Security
4. User Accounts
5. Overview of HTTP API Functions
System API – provides intercom configuration changes, status info and upgrade.
Switch API – provides switch status control and monitoring, e.g. door lock
opening, etc.
I/O API – provides intercom logic input/output control and monitoring.
Audio API – provides audio playback control and microphone monitoring.
Camera API – provides camera image control and monitoring.
Display API – provides display control and user information display.
E-mail API – provides sending of user e-mails.
Phone/Call API – provides incoming/outgoing call control and monitoring.
Logging API – provides reading of event records.
Set the transport protocol (HTTP or HTTPS) and way of authentication (None, Basic or
Digest) for each function. Create up to five user accounts (with own username and
password) in the HTTP API configuration for detailed access control of services and
functions.
Use the configuration web interface on the Services / HTTP API tab to configure your
HTTP API. Enable and configure all the available services and set the user account
parameters.
2.23
Addition of the switchDisabled parametr to UserRejected event.
2.22
New events: CardHeld, PairingStateChanged, SwitchesBlocked, FingerEntered,
MobKeyEntered, DoorStateChanged, UserRejected, DisplayTouched.
2.21
The api/display/image (display, blob-image, blob-video, duration, repeat
2.15
New events: TamperSwitchActivated, UnauthorizedDoorOpen,
DoorOpenTooLong and LoginBlocked
Addition of the tzShift event that gives the difference between the local time
and Coordinated Universal Time (UTC)
The email/send function extended with a resolution setting option for the
images to be sent
2.14
Addition of the api/pcap, api/pcap/restart and api/pcap/stop functions for
network traffic download and control
The /call/hangup function extended with a reason parameter specifying the call
end reason
2.13
First document version
All HTTP API commands are sent via HTTP/HTTPS to the intercom address with
absolute path completed with the /api prefix. Which protocol you choose depends on
the current intercom settings in the Services / HTTP API section. The HTTP API
functions are assigned to services with defined security levels including the TLS
connection request (i.e. HTTPS).
The absolute path includes the function group name (system, firmware, config, switch,
etc.) and the function name (caps, status, ctrl, etc.).
To be accepted by the intercom, a request has to include the method and absolute
path specification followed by the Host header.
Example:
The GET and POST methods are equivalent from the viewpoint of HTTP API but use
different parameter transfers (refer to the next subsection). The PUT and DELETE
methods are used for handling of such extensive objects as configuration, firmware,
images and sound files.
1. in the request path (uri query, GET, POST, PUT and DELETE methods);
If the transfer methods are combined, a parameter may occur more times in the
request. In that case, the last incidence is preferred.
1. Simple value parameters (switch, action, etc.) can be transferred using any of the
above listed methods and do not contain the blob- prefix.
2. Large data parameters (configuration, firmware, images, etc.) always start with
blob- and can only be transferred via the last-named method (multipart/form-
data).
{
"success" : true,
}
{
"success" : true,
"result" : {
...
}
}
Code Description
2 invalid The absolute path specified in the HTTP request does not match any of
request path the HTTP API functions.
3 invalid The HTTP method used is invalid for the selected function.
request
method
4 function is The function (service) is disabled. Enable the function on the Services /
disabled HTTP API configuration interface page.
5 function is The function (service) is subject to licence and available with a licence
licensed key only.
8 invalid The authentication method used is invalid for the selected service. This
authentication error happens when the Digest method is only enabled for the service
method but the client tries to authenticate via the Basic method.
9 authorisation User authorisation is required for the service access. This error is sent
required together with the HTTP status code Authorisation Required.
10 insufficient The user to be authenticated has insufficient privileges for the function.
user
privileges
11 missing The request lacks a mandatory parameter. Refer to param for the
mandatory parameter name.
parameter
12 invalid A parameter value is invalid. Refer to param for the parameter name.
parameter
value
13 parameter The parameter data exceed the acceptable limit. Refer to param for the
data too big parameter name.
Set the security level for each HTTP API service via the 2N IP intercom configuration
web interface on the Services / HTTP API tab: disable/enable a service and select the
required communication protocol and user authentication method.
HTTP – send requests via HTTP or HTTPS. Both the protocols are enabled and
the security level is defined by the protocol used.
HTTPS – send requests via HTTPS. Any requests sent via the unsecured HTTP
are rejected by the intercom. HTTPS secures that no unauthorised person may
read the contents of sent/received messages.
We recommend you to use the HTTPS + Digest combination for all the services to
achieve the highest security and avoid misuse. If the other party does not support this
combination, the selected service can be granted a dispensation and assigned a lower
security level.
With 2N IP intercom you can administer up to five user accounts for access to the
HTTP API services. The user account contains the user's name, password and HTTP API
access privileges.
Use the table above to control the user account privileges to the HTTP API services.
The table below provides a list of all available HTTP API functions including:
The reply is in the application/json format and includes the following information on
the device:
Parameter Description
buildType Firmware build type (alpha, beta, or empty value for official versions)
deviceName Device name set in the configuration interface on the Services / Web Server tab
Example:
GET /api/system/info
{
"success" : true,
"result" : {
"variant" : "2N Helios IP Vario",
"serialNumber" : "08-1860-0035",
"hwVersion" : "535v1",
"swVersion" : "2.10.0.19.2",
"buildType" : "beta",
"deviceName" : "2N Helios IP Vario"
}
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
The reply is in the application/json format and includes the current device status.
Parameter Description
systemTime Device real time in seconds since 00:00 1.1.1970 (unix time)
Example:
GET /api/system/status
{
"success" : true,
"result" : {
"systemTime" : 1418225091,
"upTime" : 190524
}
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Example:
GET /api/system/restart
{
"success" : true
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
Parameter Description
downgrade Flag set if the FW to be uploaded is older than the current one
Example:
PUT /api/firmware
{
"success" : true,
"result" : {
"version" : "2.10.0.19.2",
"downgrade" : false
}
}
If the FW file to be uploaded is corrupted or not intended for your device, the
intercom returns error code 12 – invalid parameter value.
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Example:
GET /api/firmware/apply
{
"success" : true
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Use the GET or POST method for configuration download and PUT method for
configuration upload.
Parameter Description
For configuration download, the reply is in the application/xml format and contains a
complete device configuration file.
The /api/config function using the PUT method uploads configuration with a delay of
approx. 15 s; do not reset or switch off the intercom during this interval.
Example:
GET /api/config
<?xml version="1.0" encoding="UTF-8"?>
<!--
Product name: 2N Helios IP Vario
Serial number: 08-1860-0035
Software version: 2.10.0.19.2
Hardware version: 535v1
Bootloader version: 2.10.0.19.1
Display: No
Card reader: No
-->
<DeviceDatabase Version="4">
<Network>
<DhcpEnabled>1</DhcpEnabled>
...
...
Example:
PUT /api/config
{
"success" : true
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
The /api/config/factoryreset function resets the intercom factory values with a delay
of approx. 15 s; do not reset or switch off the intercom during this interval.
Example:
GET /api/config/factoryreset
{
"success" : true
}
The function is part of the Switch service and the user must be assigned the Switch
Monitoring privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
The reply is in the application/json format and includes a switch list (switches)
including current settings. If the switch parameter is used, the switches field includes
just one item.
Parameter Description
switch Switch Id (1 to 4)
GET /api/switch/caps
{
"success" : true,
"result" : {
"switches" : [
{
"switch" : 1,
"enabled" : true,
"mode" : "monostable",
"switchOnDuration" : 5,
"type" : "normal"
},
{
"switch" : 2,
"enabled" : true,
"mode" : "monostable",
"switchOnDuration" : 5,
"type" : "normal"
},
{
"switch" : 3,
"enabled" : false
},
{
"switch" : 4,
"enabled" : false
}
]
}
}
The function is part of the Switch service and the user must be assigned the Switch
Monitoring privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
switch Optional switch identifier (typically, 1 to 4). Use also /api/switch/caps to know the
exact count of switches.
The reply is in the application/json format and includes a switch list (switches)
including current statuses (active). If the switch parameter is used, the switches field
includes just one item.
GET /api/switch/status
{
"success" : true,
"result" : {
"switches" : [
{
"switch" : 1,
"active" : false
},
{
"switch" : 2,
"active" : false
},
{
"switch" : 3,
"active" : false
}
]
}
}
The function is part of the Switch service and the user must be assigned the Switch
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
switch Mandatory switch identifier (typically, 1 to 4). Use also /api/switch/caps to know the
exact count of switches.
action Mandatory action defining parameter (on – activate switch, off – deactivate switch,
trigger – change switch state).
response Optional parameter modifying the intercom response to include the text defined
here instead of the JSON message.
Example:
GET /api/switch/ctrl?switch=1&action=trigger
{
"success" : true
}
If the response parameter is used, the reply does not include the json messages; the
server returns a text/plain reply with the specified text (which can be empty).
GET /api/switch/ctrl?switch=1&action=on&response=text
text
GET /api/switch/ctrl?switch=1&action=on&response=
The function is part of the I/O service and the user must be assigned the I/O
Monitoring privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
The reply is in the application/json format and includes a port list (ports) including
current settings. If the port parameter is used, the ports field includes just one item.
Parameter Description
type Type (input – for digital inputs, output – for digital outputs)
GET /api/io/caps
{
"success" : true,
"result" : {
"ports" : [
{
"port" : "relay1",
"type" : "output"
},
{
"port" : "relay2",
"type" : "output"
}
]
}
}
The function is part of the I/O service and the user must be assigned the I/O
Monitoring privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
port Optional input/output identifier. Use also /api/io/caps to get identifiers of the
available inputs and outputs.
The reply is in the application/json format and includes a port list (ports) including
current settings (state). If the port parameter is used, the ports field includes just one
item.
Example:
GET /api/io/status
{
"success" : true,
"result" : {
"ports" : [
{
"port" : "relay1",
"state" : 0
},
{
"port" : "relay2",
"state" : 0
}
]
}
}
The function is part of the I/O service and the user must be assigned the I/O Control
privilege for authentication if required. The function is available with the Enhanced
Integration licence key only.
Request parameters:
Parameter Description
port Mandatory I/O identifier. Use also /api/io/caps to get the identifiers of the available
inputs and outputs.
action Mandatory action defining parameter (on – activate output, log. 1, off – deactivate
output, log. 0)
response Optional parameter modifying the intercom response to include the text defined
here instead of the JSON message.
Example:
GET /api/io/ctrl?port=relay1&action=on
{
"success" : true
}
If the response parameter is used, the reply does not include the json messages; the
server returns a text/plain reply with the specified text (which can be empty).
GET /api/io/ctrl?port=relay1&action=on&response=text
text
GET /api/io/ctrl?port=relay1&action=on&response=
The function is part of the Phone/Call service and the user must be assigned the Phone
/Call Monitoring privilege for authentication if required. The function is available with
the Enhanced Integration licence key only.
Request parameters:
Parameter Description
account Optional SIP account identifier (1 or 2). If the parameter is not included, the function
returns statuses of all the SIP accounts.
The reply is in the application/json format and includes a list of device SIP accounts (
accounts) including current statuses. If the account parameter is used, the accounts
field includes just one item.
Parameter Description
registerTime Last successful registration time in seconds since 00:00 1.1.1970 (unix time)
GET /api/phone/status
{
"success" : true,
"result" : {
"accounts" : [
{
"account" : 1,
"sipNumber" : "5046",
"registered" : true,
"registerTime" : 1418034578
},
{
"account" : 2,
"sipNumber" : "",
"registered" : false
}
]
}
}
The function is part of the Phone/Call service and the user must be assigned the Phone
/Call Monitoring privilege for authentication if required. The function is available with
the Enhanced Integration licence key only.
Request parameters:
Parameter Description
session Optional call identifier. If the parameter is not included, the function returns statuses
of all the active calls.
The reply is in the application/json format and includes a list of active calls (sessions)
including their current states. If the session parameter is used, the sessions field
includes just one item. If there is no active call, the sessions field is empty.
Parameter Description
GET /api/call/status
{
"success" : true,
"result" : {
"sessions" : [
{
"session" : 1,
"direction" : "outgoing",
"state" : "ringing"
}
]
}
The function is part of the Phone/Call service and the user must be assigned the Phone
/Call Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
number Mandatory parameter specifying the destination phone number or sip uri
The reply is in the application/json format and includes information on the outgoing
call created.
Parameter Description
session Call identifier, used, for example, for call monitoring with /api/call/status or call
termination with /api/call/hangup
Example:
GET /api/call/dial?number=sip:[email protected]
{
"success" : true,
"result" : {
"session" : 2
}
}
The function is part of the Phone/Call service and the user must be assigned the Phone
/Call Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
Example:
GET /api/call/answer?session=3
{
"success" : true
}
The function is part of the Phone/Call service and the user must be assigned the Phone
/Call Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
Example:
GET /api/call/hangup?session=4
{
"success" : true
}
The function is part of the Camera service and the user must be assigned the Camera
Monitoring privilege for authentication if required.
The reply is in the application/json format and includes a list of supported resolutions
of JPEG snapshots (jpegResolution) and a list of available video sources (sources),
which can be used in the /api/camera/snapshot parameters.
Parameter Description
GET /api/camera/caps
{
"success" : true,
"result" : {
"jpegResolution" : [
{
"width" : 160,
"height" : 120
},
{
"width" : 176,
"height" : 144
},
{
"width" : 320,
"height" : 240
},
{
"width" : 352,
"height" : 272
},
{
"width" : 352,
"height" : 288
},
{
"width" : 640,
"height" : 480
}
],
"sources" : [
{
"source" : "internal"
},
{
"source" : "external"
}
]
}
}
The function is part of the Camera service and the user must be assigned the Camera
Monitoring privilege for authentication if required.
Request parameters:
Parameter Description
width Mandatory parameter specifying the horizontal resolution of the JPEG image in
pixels
height Mandatory parameter specifying the vertical resolution of the JPEG image in pixels.
The snapshot height and width must comply with one of the supported options (see
api/camera/caps).
source Optional parameter defining the video source (internal – internal camera, external –
external IP camera). If the parameter is not included, the default video source
included in the Hardware / Camera / Common settings section of the configuration
web interface is selected.
fps Optional parameter defining the frame rate. If the parameter is set to >= 1, the
intercom sends images at the set frame rate using the http server push method.
time Optional parameter defining the snapshot time in the intercom memory. The time
values must be within the intercom memory range: <-30, 0> seconds. When this
parameter is used together with the fps parameter, the fps parameter is ignored and
function returns only a single frame.
Example:
The function is part of the Display service and the user must be assigned the Display
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
The reply is in the application/json format and includes a list of available displays (
displays).
Parameter Description
Example:
GET /api/display/caps
{
"success" : true,
"result" : {
"displays" : [
{
"display" : "internal",
"resolution" : {
"width" : 320,
"height" : 240
}
}
]
}
}
2N ® IP Verso
2N ® IP Vario
2N ® IP Verso
The /api/display/image function helps you modify the content to be displayed: upload
a GIF / JPEG / BMP image to or delete an earlier uploaded image from the display.
The function is part of the Display service and the user must be assigned the Display
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
The PUT or DELETE method can be used for this function: PUT helps upload an image
to the display, DELETE helps delete an uploaded image from the display.
PUT method
Request parameters:
Parameter Description
blob- Mandatory parameter containing a JPEG / BMP / PNG image with 214 x 240 display
image resolution (refer to /api/display/caps). The parameter is applied only if the PUT
method is used. The request may contain just one parameter: blob-image or blob-
video.
blob-video Mandatory parameter containing an MPEG4 / H264 video of the maximum duration
of 60 s, maximum of 15 fps and resolution of 214 x 240 pixels. The request may
contain just one parameter: blob-image or blob-video.
duration Optional parameter. Image display / video playing time. The parameter is set in
milliseconds.
repeat Optional parameter. Video playing repetition count. The parameter applies to video
only.
If the HTTP request does not include any of the above mentioned parameters, the
overlay mode is used, i.e. the image is displayed for an indefinite period of time. If
both the parameters are included, the display is ended by the event that happens first.
Image parameters:
Note
Example:
api/display/image?display=ext1&duration=30000
{
"success" : true
}
Video parameters:
api/display/image?display=ext1&repeat=5
{
"success" : true
}
DELETE method
Example:
DELETE /api/display/image?display=ext1
{
"success" : true
}
2N ® IP Vario
The /api/display/image function helps you modify the content to be displayed: upload
a GIF / JPEG / BMP image to or delete an earlier uploaded image from the display.
Note
The function is part of the Display service and the user must be assigned the Display
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
The PUT or DELETE method can be used for this function: PUT helps upload an image
to the display, DELETE helps delete an uploaded image from the display.
Request parameters:
Parameter Description
blob- Mandatory parameter including an image in the supported format with display
image resolution (see /api/display/caps). The parameter is applied only if the PUT method
is used.
Image parameters:
Upozornění
Example:
DELETE /api/display/image?display=internal
{
"success" : true
}
If the HTTP request does not include any of the above-mentioned parameters, the
overlay mode is used, i.e. the image is displayed for an indefinite period of time. If
both the parameters are included, the display is terminated by the event that happens
first.
Note
Server: HIP2.22.0.31.1
Content-Type: application/json
Content-Length: 24
Host: 10.27.24.15
User-Agent: Mozilla/5.0 (Windows NT 6.1; W…) Gecko/20100101 Firefox/56.0
Accept: */*
Accept-Language: cs,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://10.27.24.15/apitest.html
Content-Length: 1325
Content-Type: multipart/form-data; boundary=…--------------258852674219952
Cookie: _ga=GA1.1.375392382.1496656977…id=GA1.1.638680516.1507547865
Connection: keep-alive
Query string
Request payload
-----------------------------258852674219952
Content-Type: image/png
‰PNG
IHDR Ö ót
R sRGB ®Îé gAMA ±üa pHYs Ço¨d üIDATx^íq8@Ô•‚\Oq3)»Ž4Y‚$'Ô
¬ÎÔ\ƒ}@J‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$H: }ííýáIžy/@‚IP
‚±×L‘ ±Ó\–^b; ŽkëÓ©í-f)ËýBÎLç÷m.jb¶v?˜m|;éJBÎK0‹›a÷/›dY¸Z$Á9+Áá[CC/´)
é68[\quŽN%Á©oÂöu6—×mcš%x!§Žl¶°¦I¸Ë5céw¬“`© •}š%¸Íi7še`»Î"Á9;ÁáÚ˜%
¸ÍbwúHI_^“—q|7Ëí—‹:+Á Áög±; ?8)Áâ‹ ÝfK_'Á÷x9FÇYL¦Ó«ÝÇ÷⩞â|Z?ž—lââ
(\M†KJBÎú-848µ|x~-Á=r«ƒ%•·÷d±ÇY<>Ý‘x|5ž?-¸öWR‰fâ#ß”`ÜJ‚’ î4^1Áá]Y‚µ—
JpšO
R‚;ú!{WokxÉ×®D‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL
‚Ä$HL‚¤>>+uKé<:– IEND®B`‚
-----------------------------258852674219952--
Poznámka
Server: HIP2.22.0.31.1
Content-Type: application/json
Content-Length: 24
Host: 10.27.24.15
User-Agent: Mozilla/5.0 (Windows NT 6.1; W…) Gecko/20100101 Firefox/56.0
Accept: */*
Accept-Language: cs,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://10.27.24.15/apitest.html
Content-Length: 943815
Content-Type: multipart/form-data; boundary=---------------------------
14948718218673
Cookie: _ga=GA1.1.375392382.1496656977…id=GA1.1.638680516.1507547865
Connection: keep-alive
Query string
display – ext1
duration – 20
repeat – 3
Request payload
-----------------------------14948718218673
Content-Type: video/mp4
-----------------------------14948718218673--
Query string
· display · ext1
· duration · 20
· repeat ·3
CodeEntered Signals entering of a user code via the for numeric keypad
numeric keypad. equipped models only
CardEntered Signals tapping of an RFID card on the for RFID card reader
card reader. equipped models only
DoorOpenTooLong Signals excessively long door opening, for digital input equipped
or door closing failure within the models only
timeout.
The function is part of the Logging service and requires no special user privileges.
GET /api/log/caps
{
"success" : true,
"result" : {
"events" : [
"KeyPressed",
"KeyReleased",
"InputChanged",
"OutputChanged",
"CardEntered",
"CallStateChanged",
"AudioLoopTest",
"CodeEntered",
"DeviceState",
"RegistrationStateChanged"
]
}
}
Each subscription channel contains an event queue of its own. All the new events that
match the channel filter (filter parameter) are added to the channel queue and read
using the /api/log/pull function.
At the same time, the device keeps the event history queue (last 10000 events) in its
internal memory. The event history queue is empty by default.
Use the include parameter to specify whether the channel queue shall be empty after
restart (storing of events occurring after the channel is opened), or be filled with all or
some events from the event history records.
Use the duration parameter to define the channel duration if it is not accessed via /api
/log/pull. The channel will be closed automatically when the defined timeout passes as
if the /api/log/unsubscribe function were used.
The function is part of the Logging service and requires some user privileges for
authentication. Unprivileged user events shall not be included in the channel queue.
DeviceState None
AudioLoopTest None
MotionDetected None
NoiseDetected None
TamperSwitchActivated None
UnauthorizedDoorOpen None
DoorOpenTooLong None
LoginBlocked None
UserAuthenticated None
CardHeld None
SilentAlarm None
ApLockStateChange None
RexActivated None
AccessLimited None
PairingStateChange None
SwitchesBlocked None
FingerEntered None
MobKeyEntered None
DoorStateChanged None
UserRejected None
DisplayTouched None
Request parameters:
include string No new Define the events to be added to the channel event
queue:
GET /api/log/subscribe?filter=KeyPressed,InputChanged
{
"success" : true,
"result" : {
"id" : 2121013117
}
}
The function is part of the Logging service and requires no special user privileges.
Request parameters:
Example:
GET /api/log/unsubscribe?id=21458715
{
"success" : true,
}
Use the timeout parameter to define the maximum time for the intercom to generate
the reply. If there is one item at least in the queue, the reply is generated immediately.
In case the channel queue is empty, the intercom puts off the reply until a new event
arises or the defined timeout elapses.
The function is part of the Logging service and requires no special user privileges.
Request parameters:
timeout uint32 No 0 Define the reply delay (in seconds) if the channel
queue is empty. The default value 0 means that the
intercom shall reply without delay.
events array Event object array. If no event occurs during the timeout, the array is empty.
GET /api/log/pull
{
"success" : true,
"result" : {
"events" : [
{
"id" : 1,
"tzShift" : 0,
"utcTime" : 1437987102,
"upTime" : 8,
"event" : "DeviceState",
"params" : {
"state" : "startup"
}
},
{
"id" : 3,
"tzShift" : 0,
"utcTime" : 1437987105,
"upTime" : 11,
"event" : "RegistrationStateChanged",
"params" : {
"sipAccount" : 1,
"state" : "registered"
}
}
]
}
}
upTime uint32 Relative event rise time (seconds after intercom restart)
tzShift int32 Difference between the local time and Coordinated Universal Time (UTC) in
minutes.
Add this value to utcTime to obtain the local time of event generation
according to the device time zone:
Event parameters:
startup – generated one-time after device start (always the first event ever)
Example:
{
"id" : 1,
"tzShift" : 0,
"utcTime" : 1437987102,
"upTime" : 8,
"event" : "DeviceState",
"params" : {
"state" : "startup"
}
}
passed – the test was carried out successfully, no problem has been
detected.
Example:
{
"id" : 26,
"tzShift" : 0,
"utcTime" : 1438073190,
"upTime" : 9724,
"event" : "AudioLoopTest",
"params" : {
"result" : "passed"
}
}
Event parameters:
out – signals the end of the interval in which motion was detected.
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1441357589,
"upTime" : 1,
"event" : "MotionDetected",
"params" : {
"state" : "in"
}
}
Event parameters:
out – signals the end of the interval in which noise was detected.
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1441357589,
"upTime" : 1,
"event" : "NoiseDetected",
"params" : {
"state" : "in"
}
}
Event parameters:
Example:
{
"id" : 4,
"tzShift" : 0,
"utcTime" : 1437987888,
"upTime" : 794,
"event" : "KeyPressed",
"params" : {
"key" : "5"
}
}
Event parameters:
code string User code, 1234, e.g. The code includes 2 digits at least and 00 cannot be
used.
valid boolean Code validity (i.e. if the code is defined as a valid user code or universal
switch code in the intercom configuration):
Example:
{
"id" : 23,
"tzShift" : 0,
"utcTime" : 1438072978,
"upTime" : 9512,
"event" : "CodeEntered",
"params" : {
"code" : "5864",
"valid" : false
}
}
Event parameters:
in – arrival
out – departure
any – passage
Note: Set the card reader direction using the intercom configuration
interface.
reader string RFID card reader/Wiegand module name, or one of the following non-
modular intercom model values:
Note: Set the card reader name using the intercom configuration interface
.
valid boolean Validity of the applied RFID card (if the card uid is assigned to one of the
intercom users listed in the phonebook)
{
"id" : 26,
"tzShift" : 0,
"utcTime" : 1438072979,
"upTime" : 9513,
"event" : "CardEntered",
"params" : {
"direction" : "any",
"reader" : "ext7",
"uid" : "01045E31BB",
"valid" : false
}
}
Event parameters:
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1437987103,
"upTime" : 9,
"event" : "OutputChanged",
"params" : {
"port" : "led_secured",
"state" : false
}
}
Event parameters:
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1437987103,
"upTime" : 9,
"event" : "SwitchStateChanged",
"params" : {
"switch" : 1,
"state" : true
}
}
Event parameters:
ringing – ringing
peer string SIP URI of the calling (incoming calls) or called (outgoing calls) subscriber
reason string Call end reason. The parameter is available only if the call end state is
signalled.
session uint32 Unique call identifier. Can also be used in the /api/call/answer, /api/call
/hangup and /api/call/status functions.
{
"id" : 5,
"tzShift" : 0,
"utcTime" : 1438064126,
"upTime" : 660,
"event" : "CallStateChanged",
"params" : {
"direction" : "incoming",
"state" : "ringing",
"peer" : "sip:[email protected]:5062;user=phone",
"session" : 1,
"call" : 1
}
}
RegistrationStateChanged
Signals a change of the SIP account registration state.
Event parameters:
1 – SIP account 1
2 – SIP account 2
{
"id" : 3,
"tzShift" : 0,
"utcTime" : 1437987105,
"upTime" : 11,
"event" : "RegistrationStateChanged",
"params" : {
"sipAccount" : 1,
"state" : "registered"
}
}
TamperSwitchActivated
Signals tamper switch activation - device cover opening. Make sure that the tamper
switch function is configured in the Digital Inputs | Tamper Switch menu.
Event parameters:
Example:
{
"id" : 54,
"tzShift" : 0,
"utcTime" : 1441357589,
"upTime" : 158,
"event" : "TamperSwitchActivated",
"params" : {
"state" : "in"
}
}
Event parameters:
Example:
{
"id" : 80,
"tzShift" : 0,
"utcTime" : 1441367842,
"upTime" : 231,
"event" : "UnauthorizedDoorOpen",
"params" : {
"state" : "in"
}
}
Event parameters:
Example:
{
"id" : 96,
"tzShift" : 0,
"utcTime" : 1441369745,
"upTime" : 275,
"event" : "DoorOpenTooLong",
"params" : {
"state" : "out"
}
}
Event parameters:
address string IP address from which invalid data were entered repeatedly.
Example:
{
"id" : 5,
"tzShift" : 0,
"utcTime" : 1441369745,
"upTime" : 275,
"event" : "LoginBlocked",
"params" : {
"address" : "10.0.23.32"
}
}
UserAuthenticated
Signals user authentication and subsequent door opening.
Event parameters:
index string Specifies the index of the phone book user; the range is <0 - 1998>.
uuid string
®
User uuid, used for devices connected to 2N Access Commander only. Any
®
device disconnected from 2N Access Commander does not send this
parameter.
{
"id" : 25125,
"tzShift" : 60,
"utcTime" : 1478096164,
"upTime" : 696118,
"event" : "UserAuthenticated",
"params" : {
"name" : "Pils Jiri",
"index" : 51,
"uuid" : "3ffe32a1-7e8b-9697-67db-5637566ec279"
}
}
CardHeld
Signals that an RFID card has been tapped on the reader for more than 4 s.
Event parameters:
ap string
session string Informs how many times the card has been applied.
reader string
uid string User uid for devices connected to the Access Commander only. Devices
disconnected from the Access Commander do not send this parameter.
{
"id" : 9,
"tzShift" : 0,
"utcTime" : 1516893493,
"upTime" : 354,
"event" : "CardHeld",
"params" : {
"ap" : 1,
"session" : 4,
"direction" : "out",
"reader" : "ext2",
"uid" : "3F00F318E7",
"valid" : true
}
}
SilentAlarm
Signals silent alarm activation.
Event parameters:
ap string
session string Informs how many silent alarms have been activated.
{
"id" : 165,
"tzShift" : 0,
"utcTime" : 1516894039,
"upTime" : 900,
"event" : "SilentAlarm",
"params" : {
"ap" : 0,
"session" : 11,
"name" : "Thomas"
}
}
AccessLimited
Signals rejection of the set user.
Event parameters:
ap string
state string
Example:
{
"id" : 408,
"tzShift" : 0,
"utcTime" : 1517302112,
"upTime" : 408951,
"event" : "AccessLimited",
"params" : {
"ap" : 0,
"type" : "card",
"state" : "in"
}
}
Event parameters:
authId string
Example:
{
"id" : 197,
"tzShift" : 0,
"utcTime" : 1516894499,
"upTime" : 1360,
"event" : "PairingStateChanged",
"params" : {
"state" : "pending",
"authId" : "F2CAE955C9B4E81CD00E3A096E52543B"
}
}
UserAuthenticated
Signals successful user authentication.
Event parameters:
ap string
session string Informs how many user authentications have been made.
name string
index string
{
"id" : 370,
"tzShift" : 0,
"utcTime" : 1517301699,
"upTime" : 408538,
"event" : "UserAuthenticated",
"params" : {
"ap" : 0,
"session" : 23,
"name" : "Thomas",
"index" : 0
}
}
SwitchesBlocked
Signals lock blocking by the tamper switch.
Event parameters:
Example:
{
"id" : 205,
"tzShift" : 0, "utcTime" : 1516894667,
"upTime" : 1528,
"event" : "SwitchesBlocked",
"params" : {
"state" : "in"
}
}
FingerEntered
Signals that a finger has been tapped on the biometric reader.
Event parameters:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1511794372,
"upTime" : 748,
"event" : "FingerEntered",
"params" : {
"session" : 1,
"valid" : true
}
}
{
"id" : 14,
"tzShift" : 0,
"utcTime" : 1511859513,
"upTime" : 65887,
"event" : "FingerEntered",
"params" : {
"session" : 3,
"valid" : false
}
}
MobKeyEntered
Signals Bluetooth reader authentication.
Event parameters:
ap string
session string
authid string
Example:
{
"id" : 208,
"tzShift" : 0,
"utcTime" : 1516894808,
"upTime" : 1669,
"event" : "MobKeyEntered",
"params" : {
"ap" : 1,
"session" : 7,
"direction" : "out",
"authid" : "E64C143F419199D47BCE0B689F298EEB",
"valid" : true
}
}
DoorStateChanged
Signals a door state change.
Event parameters:
{
"id" : 240,
"tzShift" : 0,
"utcTime" : 1516895295,
"upTime" : 2156,
"event" : "DoorStateChanged",
"params" : {
"state" : "opened"
}
}
UserRejected
Signals user authentication rejection.
Event parameters:
ap string
session string
name string
uuid string
{
"id" : 201,
"tzShift" : 0,
"utcTime" : 1516894605,
"upTime" : 1466,
"event" : "UserRejected",
"params" : {
"ap" : 1,
"session" : 6,
"name" : "Thomas",
"reason" : "timeout"
}
}
DisplayTouched
Signals display touch.
Event parameters:
x string Display touch point coordinate. The maximum value depends of the display
resolution.
dx string Coordinate change due to movement on the display; negative values are
possible. The maximum value depends of the display resolution.
{
"id" : 337,
"tzShift" : 0,
"utcTime" : 1517301424,
"upTime" : 408263,
"event" : "DisplayTouched",
"params" : {
"x" : 89,
"y" : 100,
"dx" : 0,
"dy" : 0
}
}
The function is part of the Audio service and the user must be assigned the Audio
Control privilege for authetication if required. The function is only available with the
Enhanced Integration and Enhanced Audio licence key.
Example:
GET /api/audio/test
{
"success" : true
}
The function is part of the Email service and the user must be assigned the Email
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only.
Request parameters:
Parameter Description
body Optional parameter specifying the contents of the message (including html marks
if necessary). If not completed, the message will be delivered without any
contents.
pictureCount Optional parameter specifying the count of camera images to be enclosed. If not
completed, no images are enclosed. Parameter values: [0, 5].
timeSpan Optional parameter specifying the timespan in seconds of the snapshots enclosed
to the email. Default value: 0.
Example:
GET /api/email/[email protected]&subject=Hello&body=Hello
{
"success" : true
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only
The reply is in the application/json format and the downloaded file can be opened
directly in Wireshark, for example.
Example:
GET /api/pcap
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only
Example:
GET /api/pcap/restart
{
"success" : true
}
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required. The function is available with the
Enhanced Integration licence key only
Example:
GET /api/pcap/restart
{
"success" : true
}
Phone: +420 261 301 500, Fax: +420 261 301 599
E-mail: [email protected]
Web: www.2n.cz
v2.23