2N_IP_HTTP_API_manual_EN_2.46
2N_IP_HTTP_API_manual_EN_2.46
devices
v.2.46 www.2n.com
HTTP API manual for 2N devices
Content:
• 1. Introduction
• 1.1 HTTP API Release Notes
• 2. HTTP API Description
• 2.1 HTTP Methods
• 2.2 Request Parameters
• 2.3 Replies to Requests
• 3. HTTP API Services Security
• 4. User Accounts
• 5. Overview of HTTP API Functions
• 5.1 api system
• 5.1.1 api system info
• 5.1.2 api system status
• 5.1.3 api system restart
• 5.1.4 api system caps
• 5.1.5 api system time
• 5.1.6 api system timezone
• 5.1.7 api system timezone caps
• 5.2 api firmware
• 5.2.1 api firmware
• 5.2.2 api firmware apply
• 5.2.3 api firmware reject
• 5.3 api config
• 5.3.1 api config
• 5.3.2 api config factoryreset
• 5.3.3 api config holidays
• 5.4 api switch
• 5.4.1 api switch caps
• 5.4.2 api switch status
• 5.4.3 api switch ctrl
• 5.5 api io
• 5.5.1 api io caps
• 5.5.2 api io status
• 5.5.3 api io ctrl
• 5.6 api phone
• 5.6.1 api phone status
• 5.6.2 api phone calllog
• 5.6.3 api phone config
• 5.7 api call
• 5.7.1 api call status
• 5.7.2 api call dial
• 5.7.3 api call answer
• 5.7.4 api call hangup
2 / 203
HTTP API manual for 2N devices
3 / 203
HTTP API manual for 2N devices
4 / 203
HTTP API manual for 2N devices
1. Introduction
HTTP API is an application interface designed for control of selected 2N devices functions via
the HTTP. It enables 2N devices to be integrated easily with third party products, such as home
automation, security and monitoring systems, etc.
HTTP API provides the following services:
• System API – provides device configuration changes, status info and upgrade.
• Switch API – provides switch status control and monitoring, e.g. door lock opening, etc.
• I/O API – provides device 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.
Refer to http(s)://ip_device_address/apitest.html for a special tool integrated in the
device HTTP server for HTTP API demonstration and testing.
5 / 203
HTTP API manual for 2N devices
Caution
Warning
In order to ensure the full functionality and guaranteed performance, we strongly
recommend that the topicality of the product / device version in use be verified as early
as in the installation process. The customer hereby acknowledges that the product /
device can achieve the guaranteed performance and full functionality pursuant to the
manufacturer’s instructions only if the latest product / device version is used after
having been tested for full interoperability and not having been determined by the
manufacturer as incompatible with certain versions of other products, and only in
conformity with the manufacturer’s instructions, guidelines or recommendations and in
conjunction with suitable products and devices of other suppliers. The latest versions
are available at https://www.2n.com/cs_CZ/ or can be updated via the configuration
interface if the devices are adequately technically equipped. Should the customer use a
product / device version other than the latest one or a version determined by the
manufacturer as incompatible with certain versions of other products, or should the
customer use the product / device in contradiction to the manufacturer’s instructions,
guidelines or recommendations or in conjunction with unsuitable products / devices of
other suppliers, the customer is aware of and agrees with all functionality limitations of
such a product / device if any as well as with all consequences incurred as a result
thereof. Using a product / device version other than the latest one or a version
determined by the manufacturer as incompatible with certain versions of other
products, or using the product / device in contradiction to the manufacturer’s
instructions, guidelines or recommendations or in conjunction with unsuitable
products / devices of other suppliers, the customer agrees that the 2N
TELEKOMUNIKACE a.s. company shall not be held liable for any functionality limitation
of such a product or any damage, loss or injury related to this potential functionality
limitation.
6 / 203
HTTP API manual for 2N devices
Version Changes
7 / 203
HTTP API manual for 2N devices
Version Changes
2.28 • Unchanged.
2.25 • Unchanged.
8 / 203
HTTP API manual for 2N devices
Version Changes
9 / 203
HTTP API manual for 2N devices
10 / 203
HTTP API manual for 2N devices
11 / 203
HTTP API manual for 2N devices
{
"success" : true,
}
{
"success" : true,
"result" : {
...
}
}
{
"success" : false,
"error" : {
"code" : 12,
"param" : "port",
"description" : "invalid parameter value"
}
}
Code Description
2 invalid The absolute path specified in the HTTP request does not match any
request path of the HTTP API functions.
12 / 203
HTTP API manual for 2N devices
Code Description
3 invalid The HTTP method used is invalid for the selected function.
request
method
8 invalid The authentication method used is invalid for the selected service.
authenticati This error happens when the Digest method is only enabled for the
on method service but the client tries to authenticate via the Basic method.
9 authorisatio User authorisation is required for the service access. This error is sent
n required together with the HTTP status code Authorisation Required.
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
data too big the parameter name.
13 / 203
HTTP API manual for 2N devices
Code Description
18 request is The request cannot be processed now and was rejected by the device.
rejected
14 / 203
HTTP API manual for 2N devices
15 / 203
HTTP API manual for 2N devices
• Digest – Digest authentication is required according to RFC-2617. This is the default and
most secure option of the three above listed methods.
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.
16 / 203
HTTP API manual for 2N devices
4. User Accounts
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.
17 / 203
HTTP API manual for 2N devices
18 / 203
HTTP API manual for 2N devices
19 / 203
HTTP API manual for 2N devices
20 / 203
HTTP API manual for 2N devices
21 / 203
HTTP API manual for 2N devices
22 / 203
HTTP API manual for 2N devices
23 / 203
HTTP API manual for 2N devices
The reply is in the application/json format and includes the following information on the
device:
Parameter Description
Caution
• For versions 2.33.2 and higher, the "buildType" key value range is changed; the
value will include the "release" string for the official version. For versions 2.32.1
and lower, the "buildType" value range is empty for the official version.
24 / 203
HTTP API manual for 2N devices
Example:
GET /api/system/info
{
"success" : true,
"result" : {
"devType" : "2-14-0-0",
"variant" : "2N IP Verso",
"variantId" : 14,
"customerId" : 0,
"serialNumber" : "00-0000-0005",
"macAddr" : "FC-1E-B3-00-00-05",
"hwVersion" : "570v1",
"swVersion" : "2.35.0.45.0",
"buildType" : "dev",
"firmwarePackage" : "verso",
"deviceName" : "2N IP Verso"
}
}
Parameter Description
25 / 203
HTTP API manual for 2N devices
Example:
GET /api/system/status
{
"success" : true,
"result" : {
"systemTime" : 1418225091,
"upTime" : 190524
}
}
GET /api/system/restart
{
"success" : true
}
26 / 203
HTTP API manual for 2N devices
{ "success":true,
"result":{
"options":{
"codecG722":"active,licensed",
"codecG729":"active",
"codecL16":"active",
"audioLoopTest":"active,licensed",
"noiseDetection":"active,licensed",
"userSounds":"active,licensed",
"adaptiveVolume":"active",
"antiHowling":"active",
"keyBeep":"active",
"camera":"active",
"video":"active",
"cameraPtz":"active,licensed",
"motionDetection":"active,licensed",
"encH264":"active",
"encH263":"active",
"encMpeg4":"active",
"encJpeg":"active",
"decH264":"active",
"phone":"active",
"phoneVideo":"active",
"phoneVideoOut":"active",
"sips":"active,licensed",
"srtp":"active,licensed",
"callAnswerMode":"active",
"doorOpenCallback":"active",
"rtspServer":"active,licensed",
"rtspClient":"active,licensed",
"audioMulticast":"active",
"smtpClient":"active,licensed",
"ftpClient":"active,licensed",
"onvif":"active,licensed",
"snmp":"active,licensed",
"tr069":"active,licensed",
"knocker":"active",
"my2n":"active",
"informacast":"active,licensed",
"autoProv":"active,licensed",
"httpApi":"active,licensed",
"eap":"active,licensed",
"eapMd5":"active,licensed",
"eapTls":"active,licensed",
"vpn":"active",
"userVpn":"active",
"rioManager":"active,licensed",
"siteChannel":"active",
"localCalls":"active",
"switches":"active",
"advancedSwitches":"active,licensed",
"switchUserCodes":"active",
27 / 203
HTTP API manual for 2N devices
"securedInput":"active",
"rexInput":"active",
"tamperInput":"active",
"doorSensor":"active",
"keypad":"active",
"buttons":"active",
"liftControl":"active,licensed",
"limitFailedAccess":"active,licensed",
"silentAlarm":"active,licensed",
"scrambleKeypad":"active,licensed",
"tamperBlockSwitch":"active,licensed",
"antiPassback":"active,licensed",
"dir":"active",
"dirDeputy":"active",
"dirPhoto":"active",
"automation":"active,licensed",
"licDownload":"active",
"profiles":"active",
"licensing":"active",
"accessControl":"active",
"doorControl":"active",
"nfc":"active,licensed",
"vbus":"active",
"vbusExtenders":"active",
"cardReader":"active",
"fpReader":"active",
"bleReader":"active",
"wiegand":"active",
"powerManager":"active",
"audioInput":"active",
"lightSensor":"active",
"irLed":"active",
"backlight":"active",
"backlightDayNight":"active",
"display":"active"
}
28 / 203
HTTP API manual for 2N devices
GET method
The function is part of the System service and the user has to be assigned the System
(Monitoring) privilege for authentication if required.
No parameters are defined for the GET method.
The response is in the application/json format and includes the device real time in seconds
from 00:00 1.1.1970 (unix time).
Example:
GET /api/system/time
{
"success" : true,
"result" : {
"utcTime" : 1639472172,
"source" : "My2N",
"automatic" : true,
}
}
PUT method
Caution
• We recommend that this endpoint is used for time setting only in case the Use
time from Internet parameter is disabled. If it is enabled, the time value is
overwritten with a value from the NTP server or the My2N time service.
The function is part of the System service and the user has to be assigned the System
(Control) privilege for authentication if required.
Request parameters for PUT:
Parameter Description
29 / 203
HTTP API manual for 2N devices
GET method
The function is part of the System service and the user has to be assigned the System
(Monitoring) privilege for authentication if required.
No parameters are defined for the GET method.
The response is in the application/json format and includes information on whether the zone
has been set automatically and what time zone has been set. In case the time zone has been set
manually, the custom parameter shows the zone creating rule.
Example:
GET /api/system/timezone
{
"success": true,
"result": {
"automatic": true,
"zone": "America/Los Angeles"
}
}
nebo
{
"success": true,
"result": {
"automatic": false
"zone": "custom",
"custom": "UTC-08:00"
}
}
PUT method
The function is part of the System service and the user has to be assigned the System
(Control) privilege for authentication if required.
Request parameters for PUT:
30 / 203
HTTP API manual for 2N devices
Parametr Popis
automatic 0 or 1
If true (1) is completed, no more parameters are entered.
zone Define the zone: enter either the zone name or "custom" for manual setting.
Refer to the zone name list on the 5.1.7 api system timezone caps endpoint.
Example:
PUT /api/system/timezone?automatic=0&zone=custom&custom=UTC-08:00
{
"success" : true
}
GET /api/system/timezone/caps
{
"success": true,
"result": {
"timezones": [
"Africa/Abidjan",
"Africa/Accra",
"Africa/Bissau",
"Africa/Monrovia",
"Africa/Sao_Tome",
"America/Danmarkshavn",
"Antarctica/Troll",
"Atlantic/Canary",
"Atlantic/Faroe",
"Atlantic/Madeira",
"Atlantic/Reykjavik",
"Etc/GMT",
"Etc/UCT",
31 / 203
HTTP API manual for 2N devices
"Etc/UTC",
"Europe/Lisbon",
"Europe/London",
...
]
}
}
Methods
• PUT
Services and Privileges
• Services: System API
• Privileges: System Control
Request PUT
The request contains a file in multipart/form-data.
32 / 203
HTTP API manual for 2N devices
http://192.168.1.1/api/firmware
Response to PUT
The response is in the application/json format. The response contains
the success and result keys. The result value contains various keys described in the table
below.
downgrade true or false This flag is true if the uploaded firmware has a lower
version than the current firmware in the device.
33 / 203
HTTP API manual for 2N devices
Note
The device does not reply to requests to upload another firmware version when the
previous firmware file is present. Use api/firmware/reject to reject the previous
firmware first and then upload another firmware version. The uploaded firmware file is
automatically rejected in 5 minutes if not applied.
34 / 203
HTTP API manual for 2N devices
http://192.168.1.1/api/firmware/apply?fileid=7d6adf16
{ "success" : true }
35 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Services and Privileges
• Services: System API
• Privileges: System Control
Request PUT
The request contains a file in URL.
http://192.168.1.1/api/firmware/reject?fileId=7d6adf16
36 / 203
HTTP API manual for 2N devices
{ "success" : true }
Note
• The device does not reply to the api/firmware requests to upload another
firmware version when the previous firmware file is present. Use api/firmware/
reject to reject the previous firmware first and then upload another firmware
version. The uploaded firmware file is automatically rejected in 5 minutes if not
applied.
37 / 203
HTTP API manual for 2N devices
Parameter Description
GET /api/config
<?xml version="1.0" encoding="UTF-8"?>
<!--
Product name: 2N 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>
...
...
For configuration upload, the reply is in the application/json format and includes no other
parameters.
Example:
PUT /api/config
{
"success" : true
}
38 / 203
HTTP API manual for 2N devices
Caution
• User positions are cancelled in the directory in version 2.24. Thus, download the
current configuration, make the required changes and then upload the
configuration to update the directory.
• Should you fail to keep the instructions above, data may get lost.
GET /api/config/factoryreset
{
"success" : true
}
39 / 203
HTTP API manual for 2N devices
The function is part of the System service and the user must be assigned the System
Control privilege for authentication if required.
The GET or PUT method can be used for this function.
No parameters are defined for the GET method.
Request parameters for PUT method:
Parameter Description
The PUT method JSON format is the same format as a result of the GET method.
The reply of the PUT method is in the application/json format and contains no other
parameters.
PUT /api/config/holidays
{ "success": true
}
40 / 203
HTTP API manual for 2N devices
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)
41 / 203
HTTP API manual for 2N devices
Example:
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
}
]
}
}
Methods
• GET
• POST
42 / 203
HTTP API manual for 2N devices
Request
The request contains parameters in the URL (or in the application/x-www-form-
urlencoded format when POST is used).
Example of a Request
URL: https://192.168.1.1/api/switch/status?switch=1
Response
The success response is in the application/json format. It contains two JSON keys success and r
esult, which contains the key switches (status information on individual switches are in an
Array of one to four elements).
activ true or Defines the current state of the switch (true – the switch is activated,
e false false – the switch is deactivated).
43 / 203
HTTP API manual for 2N devices
locke true or Defines whether the switch is locked or not (true – the switch is locked
d false in deactivated position and cannot be operated, false – the switch is
unlocked and can be operated normally). Locking has the priority over
holding the switch - i.e. when the switch is simultaneously locked and
held, it is deactivated and cannot be operated.
held true or Defines whether the switch is held or not (true – the switch is held in
false activated position and cannot be operated, false – the switch is
released and can be operated normally). Locking has the priority over
holding the switch – i.e. when the switch is simultaneously locked and
held, it is deactivated and cannot be operated.
Example of a Response
There may occur various errors (e.g. missing mandatory parameter). Errors are returned in .json
with a response code 200.
44 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
The request contains parameters in the URL (or in the application/x-www-form-
urlencoded format when POST is used).
swit Yes Integer defining – Defines which switch will be controlled. api/switch/
ch a switch caps can be used for obtaining the number of
(typically 1 to 4) switches of a particular device.
acti Yes String defining – Defines which command will be applied to the
on the command switch. The available commands are:
• on - activate switch
• off - deactivate switch
• trigger - activate monostable switch,
toggle the state of bistable switch
• lock - lock switch (locked switch is
deactivated and cannot be operated)
• unlock - unlock switch (allow normal
operation)
• hold - hold switch activated (held switch is
activated and cannot be operated), if the
switch is locked and held together it is
deactivated
• release - release the switch from being held
(allow normal operation)
45 / 203
HTTP API manual for 2N devices
resp No String defining a – The device will return the text specified in this
onse text that is to be parameter instead of a standard JSON response.
returned instead
of standard
JSON response
time No Range of 1–86 – Defines the timeout in seconds after which the
out (use 400 seconds switch releases again automatically after receiving
d the hold command.
when
acti
on=h
old)
Example of a Request
URL: https://192.168.1.1/api/switch/ctrl?switch=4&action=trigger&response=TEST
Response
The success response is in the application/json format (unless a custom text response is
defined in the response parameter).
su true When a command was performed successfully, the success value is true, and
cc or it is false when the requested switch state could not be reached (e.g. the
es false switch is locked and the requested state is activated switch).
s
46 / 203
HTTP API manual for 2N devices
Example of a Response
{ "success": true }
Additional error information is contained in the response when the success is false. Error code
14 "action failed" is returned when the requested result could not be achieved (e.g. when the
switch is locked and action=on is requested). A command to change the operation type (i.e.
held, locked) will always succeed since the operation can be changed all the time except when
the switch is disabled (a device will return error 14 to all commands when the switch is
disabled).
5.5 api io
The following subsections detail the HTTP functions available for the api/io service.
• 5.5.1 api io caps
• 5.5.2 api io status
• 5.5.3 api io ctrl
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
47 / 203
HTTP API manual for 2N devices
Example:
GET /api/io/caps
{
"success" : true,
"result" : {
"ports" : [
{
"port" : "relay1",
"type" : "output"
},
{
"port" : "relay2",
"type" : "output"
}
]
}
}
Parameter Description
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.
48 / 203
HTTP API manual for 2N devices
Example:
GET /api/io/status
{
"success" : true,
"result" : {
"ports" : [
{
"port" : "relay1",
"state" : 0
},
{
"port" : "relay2",
"state" : 0
}
]
}
}
Parameter Description
49 / 203
HTTP API manual for 2N devices
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).
Example:
GET /api/io/ctrl?port=relay1&action=on&response=text
text
GET /api/io/ctrl?port=relay1&action=on&response=
Parameter Description
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.
50 / 203
HTTP API manual for 2N devices
Parameter Description
Example:
{
"success" : true,
"result" : {
"accounts" : [
{
"account" : 1,
"accountType" : "general",
"enabled" : false,
"sipNumber" : "",
"registrationEnabled" : false,
"registered" : false
},
{
"account" : 2,
"accountType" : "general",
"enabled" : true,
"sipNumber" : "1784973567",
"registrationEnabled" : true,
"registered" : true,
"registerTime" : 1721138562
},
{
"account" : 3,
"accountType" : "local",
"enabled" : true,
"sipNumber" : "2NIPStyle-5034500194"
},
{
"account" : 4,
"accountType" : "msteams",
"enabled" : true,
"sipNumber" : "+1784973567",
"registrationEnabled" : true,
"registered" : true,
51 / 203
HTTP API manual for 2N devices
"registerTime" : 1721138562
}
]
}
}
Parameter Description
52 / 203
HTTP API manual for 2N devices
Parameter Description
Caution
• The field is empty if no logs are available.
53 / 203
HTTP API manual for 2N devices
Example:
{
"success" : true,
"result" : {
"callLog" : [
{
"id" : ID,
"callType" : "incoming",
"devType" : "2-14-0-0",
"name" : "Franta Vomáčka",
"date" : "2027-11-06T12:23:52Z",
"duration": 1514
},
{
"id" : ID,
"callType" : "incoming",
"devType" : "4-13-1-2",
"name" : "Pepa Vonášek",
"date" : "2027-12-06T12:23:52Z",
"duration": 15
},
...
]
}
}
Door bell
{
"success" : true,
"result" : {
"callLog" : [
{
"id" : ID,
"callType" : "doorbell",
"date" : "2027-11-06T12:23:52Z"
},
...
]
}
}
DELETE Method
The function is part of the Phone/Call API function and the user has to be assigned the Phone/
Call Access Control privilege for authentication if required.
54 / 203
HTTP API manual for 2N devices
Request parameters:
Parameter Description
Example:
{
"success" : false,
"error" : {
"code" : 12,
"param" : "id",
"description" : "record not found"
}
}
GET Method
Request parameters:
Parameter Description
The response is in the application/json format for the GET method and provides a list of the
device SIP accounts (accounts) including their current states. In case the account is specified
using the account parameter, the response only provides information on the given account.
55 / 203
HTTP API manual for 2N devices
Caution
• For security reasons, the device does not return the password if the GET method
is used.
Example:
GET /api/phone/config
{
"success": true,
"result": {
"accounts": [
{
"account": 1,
"enabled": false,
"displayName": "",
"sipNumber": "",
"domain": "",
"domainPort": "",
"authId": "",
"proxyAddress": "",
"proxyPort": "",
"registrationEnabled": false,
"registrarAddress": "",
"registrarPort": "",
"answerMode": "1"
},
{
"account": 2,
"enabled": false,
"displayName": "",
"sipNumber": "",
"domain": "",
"domainPort": "",
"authId": "",
"proxyAddress": "",
"proxyPort": "",
"registrationEnabled": false,
"registrarAddress": "",
"registrarPort": "",
"answerMode": "1"
}
]
}
}
PUT Method
Request parameters:
56 / 203
HTTP API manual for 2N devices
Parameter Description
The blob-json parameter is mandatory for the PUT method and can include all the accounts
parameters from the file obtained using the GET method. In addition to the mandatory
account parameter, one more parameter must be included at least. The other parameters are
optional. It is possible to specify the password parameter and enter the password in the open
form for each account in the JSON file uploaded. This parameter is not part of the response to
the GET method for security reasons. The response is in the application/json format. Should an
error occur during verification, the whole process fails and none of the parameters will be used.
Example:
PUT /api/phone/config
{
"success": true,
}
Phone.Sip.Enabled enabled
Phone.Sip.User.DisplayNa displayName
me
Phone.Sip.User.Id sipNumber
57 / 203
HTTP API manual for 2N devices
Phone.Sip.Client.Domain domain
Phone.Sip.Client.Port domainPort
Phone.Sip.Proxy.Address proxyAddress
Phone.Sip.Proxy.Port proxyPort
Phone.Sip.Registrar.Enabl registrationEnabl
ed ed
Phone.Sip.Registrar.Addre registrarAddress
ss
Phone.Sip.Registrar.Port registrarPort
Phone.Sip.Misc.AnswerMo answerMode
de
58 / 203
HTTP API manual for 2N devices
Parameter Description
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
Example:
59 / 203
HTTP API manual for 2N devices
GET /api/call/status
[
{
"calls": [
{
"id": 6,
"peer": "sip:10.0.29.27",
"state": "ringing"
},
{
"id": 7,
"peer": "sip:10.0.29.31",
"state": "ringing"
}
],
"direction": "outgoing",
"session": 4,
"state": "ringing"
}
]
60 / 203
HTTP API manual for 2N devices
Request parameters:
Parameter Description
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
}
}
Parameter Description
61 / 203
HTTP API manual for 2N devices
Example:
GET /api/call/answer?session=3
{
"success" : true
}
Parameter Description
GET /api/call/hangup?session=4
{
"success" : true
}
62 / 203
HTTP API manual for 2N devices
Parameter Description
63 / 203
HTTP API manual for 2N devices
Example:
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"
}
]
}
}
64 / 203
HTTP API manual for 2N devices
Parameter Description
The reply is in the image/jpeg or multipart/x-mixed-replace (pro fps ≥ 1) format. If the request
parameters are wrong, the function returns information in the application/json format.
Example:
65 / 203
HTTP API manual for 2N devices
GET /api/camera/snapshot?width=640&height=480&source=internal
# following command returns a frame which was captured 5 seconds before the command
was executed
GET /api/camera/snapshot?width=1280&height=960&source=internal&time=-5
66 / 203
HTTP API manual for 2N devices
Parameter Description
67 / 203
HTTP API manual for 2N devices
Example:
GET /api/display/caps
{
"success" : true,
"result" : {
"displays" : [
{
"display" : "internal",
"resolution" : {
"width" : 320,
"height" : 240
}
}
]
}
}
2N® IP Style
The /api/display/image function helps you modify the content to be displayed: upload a GIF /
JPEG image to or delete an earlier uploaded image from the display. Progressive JPEG images
are not supported.
The function is part of the Display service and the user must be assigned the Display
Control privilege for authentication if required.
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:
Para Description
mete
r
blob Mandatory parameter containing a JPEG / BMP / PNG image with 1280 x 800 display
- resolution (refer to /api/display/caps). The parameter is applied only if the PUT
ima method is used. Progressive JPEG images are not supported.
ge
dura Optional parameter. Image display time. The parameter is set in milliseconds.
tion
68 / 203
HTTP API manual for 2N devices
There are two ways how to display an image: as a notification or as an overlay. Notifications are
displayed for a predefined period of time and automatically disappear after the timeout.
Overlays keep displayed until replaced with another image or removed by the user.
If the HTTP request does not include an optional parameter, the image is displayed in the
overlay mode, i.e. uploaded for an indefinite period of time. If an optional parameter is included,
the image is displayed in the notification mode, which ends when a preset timeout expires.
Touch the display to end the notification earlier.
When uploaded for the first time, the image is transferred from the main unit to the display via
an internal bus (which may take some time). Several images may be stored in the display
memory and if the same images are sent to the device in the future, they are no longer
transferred via the internal bus. They are immediately displayed from the memory instead.
The reply is in the application/json format and includes no parameters.
Image parameters:
Note
• The supported JPEG format is JPEG Baseline (non-progressive encoding).
Example:
PUT api/display/image&duration=30000
{
"success" : true
}
69 / 203
HTTP API manual for 2N devices
DELETE method
Parameter Description
Example:
DELETE api/display/image
{
"success" : true
}
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. Progressive JPEG
images are not supported.
The function is part of the Display service and the user must be assigned the Display
Control privilege for authentication if required.
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:
Para Description
mete
r
blob Mandatory parameter containing a JPEG / BMP / PNG image with 320 x 214 display
- resolution (refer to /api/display/caps). The parameter is applied only if the PUT
ima method is used. The request may contain just one parameter: blob-image or blob-
ge video. Progressive JPEG images are not supported.
70 / 203
HTTP API manual for 2N devices
Para Description
mete
r
blob Mandatory parameter containing an MPEG4 / H264 video of the maximum duration of
- 60 s, maximum of 15 fps and resolution of 320 x 214 pixels. The request may contain
vide just one parameter: blob-image or blob-video.
o
dura Optional parameter. Image display / video playing time. The parameter is set in
tion milliseconds.
repe Optional parameter. Video playing repetition count. The parameter applies to video
at only.
There are two ways how to display an image: as a notification or overlay. Notifications are
displayed for a predefined period of time and automatically disappear after the timeout.
Overlays keep displayed until replaced with another image or removed by the user.
If the HTTP request does not include any of the above mentioned optional parameters, the
overlay mode is used, i.e. the image is displayed for an indefinite period of time. If both the
optional parameters are included, the notification is terminated by the event that is generated
earlier. Touch the display to end the notification earlier.
When uploaded for the first time, the image is transferred from the main unit to the display via
an internal bus (which may take some time). Several images may be stored in the display
memory and if the same images are sent to the device in the future, they are no longer
transferred via the internal bus. They are immediately displayed from the memory instead.
The reply is in the application/json format and includes no parameters.
Image parameters:
Note
• The supported JPEG format is JPEG Baseline (non-progressive encoding).
71 / 203
HTTP API manual for 2N devices
Example:
api/display/image?display=ext1&duration=30000
{
"success" : true
}
Video parameters:
2N® IP Verso 214 x 240 pixels MPEG4 / H264: Baseline profile, up to 5.2 level
Example:
api/display/image?display=ext1&repeat=5
{
"success" : true
}
DELETE method
Parameter Description
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.
72 / 203
HTTP API manual for 2N devices
The function is part of the Display service and the user must be assigned the Display
Control privilege for authentication if required.
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
Caution
The supported JPEG format is JPEG Baseline (non-progressive encoding).
Example:
DELETE /api/display/image?display=internal
{
"success" : true
}
73 / 203
HTTP API manual for 2N devices
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.
74 / 203
HTTP API manual for 2N devices
Note
Each model supports a different image resolution.
Model Image size Supported formats
75 / 203
HTTP API manual for 2N devices
Query string
• display: ext1
Request payload
-----------------------------258852674219952
Content-Disposition: form-data; name="blob-image"; filename="picture.png"
Content-Type: image/png
‰PNG
IHDR Ö đ ót
R sRGB ®Îé gAMA ±Źüa pHYs Ă ĂÇo¨d üIDATx^íŘŃqŰ8@ŃÔ•‚\OŞq3)Ć»Ž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Ţł.jĚb¶v?˜m|;éJđBÎKđ0‹›a÷řţ/›dY¸Z$Á9+Áá[śCC/Ăů
´)éż6ĆŃŘĚ8[\quŽNď%ÁŘ©żoŚÂˇŚĺöu6—×mcšŤ%x!§żŽl̶˙°¦I¸Ë5céw¬“`ě© •}
š%¸Íi7še`»Îľ"Á9;ÁáÚ˜%¸ÍbwúHI_^Č“ś—ŕq|7Ëí—ŕ‹:+Áť ďĎÁŮög±;ő ţ?8)ÁĺŻâř‹ ÝćfřKŘ_'Á
Ř÷x9FÇYL¦Ó«ÝĚĆÇ÷⩞�ŕâ|Z?ž—ŰśĹlşşââ(\M†KJđBÎú-848µ|x~-Á=r«ƒ%Śť•༌·÷Ĺd±˙ÇY<>ÝŘů‘x|
5žęĽ?ҸďöWŢR‰fâ#ß”`ěÜŻJ‚ň’ îĂ4^1Áá]Y‚µ—JpőšO
Ě˝R‚;ú!
Ř
{
Ą
Wo
ĚŔ
kxÉ×®D‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$H
L‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$H
L‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$H
L‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$H
L‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚Ä$HL‚¤>>
ţ+uKéż<:– IEND®B`‚
-----------------------------258852674219952--
Info
2N® IP Verso 214 x 240 pixels MPEG4 / H264: Baseline profile, level up to 5.2
76 / 203
HTTP API manual for 2N devices
Request payload
-----------------------------14948718218673
77 / 203
HTTP API manual for 2N devices
-----------------------------14948718218673--
78 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
CardHeld Signals RFID card tapping and holding for "reader, "ap,
more than 4 s. uid, session,
valid" direction,
uuid"
79 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
80 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
DtmfSent DTMF code sent in call or off call locally. "code" "call"
81 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
82 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
83 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
84 / 203
HTTP API manual for 2N devices
Permanent Conditione
d
Example:
GET /api/log/caps
{
"success" : true,
"result" : {
"events" : [
"KeyPressed",
"KeyReleased",
"InputChanged",
"OutputChanged",
"CardEntered",
"CallStateChanged",
"AudioLoopTest",
"CodeEntered",
"DeviceState",
"RegistrationStateChanged"
]
}
}
85 / 203
HTTP API manual for 2N devices
TamperSwitchActivated None
UnauthorizedDoorOpen None
DoorOpenTooLong None
LoginBlocked None
SilentAlarm None
DoorStateChanged None
DeviceState None
AudioLoopTest None
MotionDetected None
NoiseDetected None
HardwareChanged None
86 / 203
HTTP API manual for 2N devices
FingerEnrollState None
LiftStatusChanged None
LiftFloorsEnabled None
LiftConfigChanged None
CapabilitiesChanged None
ConfigurationChanged None
ExtCameraStateChanged None
RescueStateChanged None
ErrorStateChanged None
LiftCheckingCall None
DtmfSent None
RexActivated None
AccessBlocked None
AccessTaken None
AccessLimited None
DisplayTouched None
DtmfPressed None
SwitchesBlocked None
87 / 203
HTTP API manual for 2N devices
UserAuthenticated
UID monitoring (cards/Wiegand)
88 / 203
HTTP API manual for 2N devices
89 / 203
HTTP API manual for 2N devices
90 / 203
HTTP API manual for 2N devices
91 / 203
HTTP API manual for 2N devices
Example:
GET /api/log/subscribe?filter=KeyPressed,InputChanged
{
"success" : true,
"result" : {
"id" : 2121013117
}
}
GET /api/log/unsubscribe?id=21458715
{
"success" : true,
}
92 / 203
HTTP API manual for 2N devices
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. Reading
events is conditioned by the privilege allowing the user to monitor such events, refer to 5.10.2
api log subscribe for the event table.
The GET or POST method can be used for this function.
Request parameters:
93 / 203
HTTP API manual for 2N devices
Example:
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"
}
}
]
}
}
94 / 203
HTTP API manual for 2N devices
Events
Each event in the events field includes the following common information:
95 / 203
HTTP API manual for 2N devices
DeviceState
Signals the device state changes.
Event parameters:
Example:
{
"id" : 1,
"tzShift" : 0,
"utcTime" : 1437987102,
"upTime" : 8,
"event" : "DeviceState",
"params" : {
"state" : "startup"
}
}
96 / 203
HTTP API manual for 2N devices
AudioLoopTest
Signals performance and result of an automatic audio loop test. The event is signalled whenever
the automatic test has been performed (either scheduled or manually started).
Example:
{
"id" : 26,
"tzShift" : 0,
"utcTime" : 1438073190,
"upTime" : 9724,
"event" : "AudioLoopTest",
"params" : {
"result" : "passed"
}
}
97 / 203
HTTP API manual for 2N devices
MotionDetected
Signals motion detection via a camera. The event is available in camera-equipped models only.
The event is generated only if the function is enabled in the intercom camera configuration.
Event parameters:
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1441357589,
"upTime" : 1,
"event" : "MotionDetected",
"params" : {
"state" : "in"
}
}
98 / 203
HTTP API manual for 2N devices
NoiseDetected
Signals an increased noise level detected via an integrated or external microphone. The event is
generated only if this function is enabled in the intercom configuration.
Event parameters:
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1441357589,
"upTime" : 1,
"event" : "NoiseDetected",
"params" : {
"state" : "in"
}
}
99 / 203
HTTP API manual for 2N devices
Example:
{
"id" : 4,
"tzShift" : 0,
"utcTime" : 1437987888,
"upTime" : 794,
"event" : "KeyPressed",
"params" : {
"key" : "5"
}
}
100 / 203
HTTP API manual for 2N devices
CodeEntered
Signals entering of a user code via the numeric keypad. The event is generated in numeric
keypad equipped devices only.
Event parameters:
session string Informs how many times the code has been
entered.
code string User code, 1234, e.g. The code includes 2 digits
at least and 00 cannot be used.
type string
101 / 203
HTTP API manual for 2N devices
Example:
{
"id" : 128,
"tzShift" : 0,
"utcTime" : 1548078453,
"upTime" : 1061,
"event" : "CodeEntered",
"params" : {
"ap" : 0,
"session" : 8,
"direction" : "in",
"code" : "1234",
"type" : "user",
"uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
"valid" : true
}
}
102 / 203
HTTP API manual for 2N devices
CardEntered
Signals tapping an RFID card on the card reader. The event is generated in RFID card reader
equipped devices only.
Event parameters:
103 / 203
HTTP API manual for 2N devices
valid boolean Validity of the applied RFID card (if the card uid is
assigned to one of the intercom users listed in
the phonebook)
false – invalid card
true – valid card
Example:
{
"id" : 60,
"tzShift" : 0,
"utcTime" : 1548078014,
"upTime" : 622,
"event" : "CardEntered",
"params" : {
"ap" : 0,
"session" : 5,
"direction" : "in",
"reader" : "ext2",
"uid" : "4BD9E903",
"uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
"valid" : true
}
}
104 / 203
HTTP API manual for 2N devices
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1437987103,
"upTime" : 9,
"event" : "OutputChanged",
"params" : {
"port" : "led_secured",
"state" : false
}
}
105 / 203
HTTP API manual for 2N devices
SwitchStateChanged
Signals a switch state change (refer to the intercom configuration in Hardware | Switches).
Event parameters:
106 / 203
HTTP API manual for 2N devices
Example:
{
"id" : 2,
"tzShift" : 0,
"utcTime" : 1437987103,
"upTime" : 9,
"event" : "SwitchStateChanged",
"params" : {
"switch" : 1,
"state" : true
}
}
107 / 203
HTTP API manual for 2N devices
CallStateChanged
Signals a setup/end/change of the active call state.
Event parameters:
108 / 203
HTTP API manual for 2N devices
Example:
{
"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
}
}
109 / 203
HTTP API manual for 2N devices
RegistrationStateChanged
Signals a change of the SIP account registration state.
Event parameters:
Example:
{
"id" : 3,
"tzShift" : 0,
"utcTime" : 1437987105,
"upTime" : 11,
"event" : "RegistrationStateChanged",
"params" : {
"sipAccount" : 1,
"state" : "registered"
}
}
110 / 203
HTTP API manual for 2N devices
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"
}
}
111 / 203
HTTP API manual for 2N devices
UnauthorizedDoorOpen
Signals unauthorized door opening. Make sure that a door-open switch is connected to one of
the digital inputs and the function is configured in the Digital Inputs | Door State menu.
Event parameters:
Example:
{
"id" : 80,
"tzShift" : 0,
"utcTime" : 1441367842,
"upTime" : 231,
"event" : "UnauthorizedDoorOpen",
"params" : {
"state" : "in"
}
}
112 / 203
HTTP API manual for 2N devices
DoorOpenTooLong
Signals an excessively long door opening or failure to close the door within a timeout. Make sure
that a door-open switch is connected to one of the digital inputs and the function is configured
in the Digital Inputs | Door State menu.
Event parameters:
Example:
{
"id" : 96,
"tzShift" : 0,
"utcTime" : 1441369745,
"upTime" : 275,
"event" : "DoorOpenTooLong",
"params" : {
"state" : "out"
}
}
113 / 203
HTTP API manual for 2N devices
LoginBlocked
Signals a temporary blocking of the web interface access due to repeated entering of an invalid
login name or password.
Event parameters:
Example:
{
"id" : 5,
"tzShift" : 0,
"utcTime" : 1441369745,
"upTime" : 275,
"event" : "LoginBlocked",
"params" : {
"address" : "10.0.23.32"
}
}
114 / 203
HTTP API manual for 2N devices
UserAuthenticated
Signals user authentication and subsequent door opening.
Event parameters:
session string Informs how many times the user has been
authenticated.
Example:
{
"success" : true,
"result" : {
"events" : [
{
"id" : 65,
"tzShift" : 0,
"utcTime" : 1593606655,
"upTime" : 7951,
"event" : "UserAuthenticated",
"params" : {
"ap" : 0,
"session" : 6,
"name" : "Alice Gruberov\u00E1",
"uuid" : "8fa29ebc-2fe8-4a8c-9a3b-d8b0351fb6f8",
"apbBroken" : true
}
}
]
}
}
115 / 203
HTTP API manual for 2N devices
CardHeld
Signals that an RFID card has been tapped on the reader for more than 4 s.
Event parameters:
session string Informs how many times the card has been
applied.
116 / 203
HTTP API manual for 2N devices
Example:
{
"id" : 9,
"tzShift" : 0,
"utcTime" : 1516893493,
"upTime" : 354,
"event" : "CardHeld",
"params" : {
"ap" : 1,
"session" : 4,
"direction" : "out",
"reader" : "ext2",
"uid" : "3F00F318E7",
"valid" : true
}
}
117 / 203
HTTP API manual for 2N devices
SilentAlarm
Signals silent alarm activation.
Event parameters:
Example:
{
"id" : 200,
"tzShift" : 0,
"utcTime" : 1548079445,
"upTime" : 2053,
"event" : "SilentAlarm",
"params" : {
"ap" : 0,
"session" : 17,
"name" : "Joseph",
"uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c"
}
}
118 / 203
HTTP API manual for 2N devices
AccessLimited
Signals rejection of the set user.
Event parameters:
Example:
{
"id" : 408,
"tzShift" : 0,
"utcTime" : 1517302112,
"upTime" : 408951,
"event" : "AccessLimited",
"params" : {
"ap" : 0,
"type" : "card",
"state" : "in"
}
}
119 / 203
HTTP API manual for 2N devices
PairingStateChanged
Signals pairing with a Bluetooth interface.
Event parameters:
Example:
{
"id" : 197,
"tzShift" : 0,
"utcTime" : 1516894499,
"upTime" : 1360,
"event" : "PairingStateChanged",
"params" : {
"state" : "pending",
"authId" : "F2CAE955C9B4E81CD00E3A096E52543B"
}
}
120 / 203
HTTP API manual for 2N devices
SwitchesBlocked
Signals lock blocking by the tamper switch. If the function is enabled, all the switches get
blocked for 30 minutes whenever the tamper is activated. Blocking is active even after the
device restart
Event parameters:
Example:
{
"id" : 205,
"tzShift" : 0, "utcTime" : 1516894667,
"upTime" : 1528,
"event" : "SwitchesBlocked",
"params" : {
"state" : "in"
}
}
121 / 203
HTTP API manual for 2N devices
FingerEntered
Signals that a finger has been tapped on the biometric reader.
Event parameters:
session string Informs how many times the finger has been
enrolled.
direction string
Fingerprint reader passage direction:
"in" – entry
"out" – exit
"any" – any direction
Note: Set the reader passage direction via the
intercom configuration interface.
122 / 203
HTTP API manual for 2N devices
{
"id" : 1368,
"tzShift" : 0,
"utcTime" : 1548145535,
"upTime" : 62598,
"event" : "FingerEntered",
"params" : {
"ap" : 0,
"session" : 1,
"direction" : "in",
"valid" : false
}
}
{
"id" : 14,
"tzShift" : 0,
"utcTime" : 1511859513,
"upTime" : 65887,
"event" : "FingerEntered",
"params" : {
"session" : 3,
"valid" : false
}
}
123 / 203
HTTP API manual for 2N devices
MobKeyEntered
Signals Bluetooth reader authentication.
Event parameters:
124 / 203
HTTP API manual for 2N devices
Example:
{
"id" : 161,
"tzShift" : 0,
"utcTime" : 1548079174,
"upTime" : 1782,
"event" : "MobKeyEntered",
"params" : {
"ap" : 0,
"session" : 9,
"direction" : "in",
"authid" : "48c48155eed7ea1dbb0b4d534b7459b9",
"uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
"valid" : true
}
}
125 / 203
HTTP API manual for 2N devices
DoorStateChanged
Signals a door state change.
Event parameters:
Example:
{
"id" : 240,
"tzShift" : 0,
"utcTime" : 1516895295,
"upTime" : 2156,
"event" : "DoorStateChanged",
"params" : {
"state" : "opened"
}
}
126 / 203
HTTP API manual for 2N devices
UserRejected
Signals user authentication rejection.
Event parameters:
Example:
{
"id" : 173,
"tzShift" : 0,
"utcTime" : 1548079274,
"upTime" : 1882,
"event" : "UserRejected",
"params" : {
"ap" : 0,
"session" : 10,
"name" : "Joseph",
"uuid" : "54877b0e-4cc3-c645-9530-6c7850f47a9c",
"reason" : "invalidCredential"
}
}
127 / 203
HTTP API manual for 2N devices
DisplayTouched
Signals display touch.
Event parameters:
Example:
{
"id" : 337,
"tzShift" : 0,
"utcTime" : 1517301424,
"upTime" : 408263,
"event" : "DisplayTouched",
"params" : {
"x" : 89,
"y" : 100,
"dx" : 0,
"dy" : 0
}
}
128 / 203
HTTP API manual for 2N devices
DtmfEntered
Signals a DTMF code in the call.
{
"id" : 86,
"tzShift" : 0,
"utcTime" : 1558522871,
"upTime" : 3531,
"event" : "DtmfEntered",
"params" : {
"code" : "00",
"type" : "uni",
"call" : 3,
"valid" : true
}
}
Param Ty Description
eter pe
valid stri Code validity (i.e. the valid universal switch code or valid user code).
ng false – invalid code
true – valid code
129 / 203
HTTP API manual for 2N devices
AccessTaken
Signals that a card has been tapped in the Anti-passback area.
{
"success" : true,
"result" : {
"events" : [
]
}
}
130 / 203
HTTP API manual for 2N devices
ApLockStateChanged
Signals an emergency lockdown state change (on/off).
{
"id" : 35,
"tzShift" : 0,
"utcTime" : 1558522465,
"upTime" : 3125,
"event" : "ApLockStateChanged",
"params" : {
"ap" : 0,
"state" : "in"
}
}
131 / 203
HTTP API manual for 2N devices
RexActivated
Signals the input activation set for the REX button.
{
"id" : 29,
"tzShift" : 0,
"utcTime" : 1558522162,
"upTime" : 2822,
"event" : "RexActivated",
"params" : {
"ap" : 1,
"session" : 1
}
}
session string Display how many times the REX button has been activated.
132 / 203
HTTP API manual for 2N devices
LiftStatusChanged
Signals the Lift Control module connection/disconection.
{
"id" : 2871,
"tzShift" : 0,
"utcTime" : 1561540370,
"upTime" : 73822,
"event" : "LiftStatusChanged",
"params" : {
"module" : 0,
"ready" : true
}
},
ready string
133 / 203
HTTP API manual for 2N devices
LiftFloorsEnabled
Signals permanent access to a floor or permanent user access.
{
"id" : 2850,
"tzShift" : 0,
"utcTime" : 1561540011,
"upTime" : 73463,
"event" : "LiftFloorsEnabled",
"params" : {
"type" : "user"
"floors" : [
0, 1, 2, 3, 4
],
"uuid" : "621a5a49-1f8b-d34c-9a8b-881055864deb",
}
},
{
"id" : 2855,
"tzShift" : 0,
"utcTime" : 1561540016,
"upTime" : 73468,
"event" : "LiftFloorsEnabled",
"params" : {
"type" : "public"
"floors" : [
1, 4
],
}
},
134 / 203
HTTP API manual for 2N devices
LifConfigChanged
Signals a change in the lift control configuration.
{
"id" : 2860,
"tzShift" : 0,
"utcTime" : 1561540163,
"upTime" : 73615,
"event" : "LiftConfigChanged",
"params" : {
"hash" : 11
}
},
135 / 203
HTTP API manual for 2N devices
CapabilitiesChanged
Signals a change in available functions.
{
"success":true,
"result":{
"events":[
{
"id":21,
"tzShift":0,
"utcTime":1585037151,
"upTime":256,
"event":"CapabilitiesChanged",
"params":{
136 / 203
HTTP API manual for 2N devices
tzShift uint3 Difference between the local time and UTC in minutes.
2 Add this value to utcTime to get the local time of event generation
according to the time zone setting in the device:
localTime = utcTime + tzShift * 60
utcTim uint3 Absolute event generation time (Unix Time, UTC – Coordinated
e 2 Universal Time).
upTime uint3 Relative event generation time (seconds after the intercom restart).
2
137 / 203
HTTP API manual for 2N devices
Example:
GET /api/audio/test
{
"success" : true
}
Parameter Description
138 / 203
HTTP API manual for 2N devices
Parameter Description
GET /api/email/[email protected]&subject=Hello&body=Hello
{
"success" : true
}
GET /api/pcap
139 / 203
HTTP API manual for 2N devices
GET /api/pcap/restart
{
"success" : true
}
GET /api/pcap/restart
{
"success" : true
}
140 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
The request contains parameters in the URL (or in the application/x-www-form-
urlencoded format when POST is used).
Example of a Request
URL: https://192.168.1.1/api/pcap/live?duration=10
Response
The device starts streaming chunked data upon a successful request.
141 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
The request does not have any parameters.
Example of a Request
URL: https://192.168.1.1/api/pcap/live/stop
Response
The device stops streaming chunked data upon a successful request. The request can help stop
a capture without a set duration or stop a capture with a duration value prematurely.
The device replies with success : true even if there is no running capture. There are no specific
error codes for this endpoint.
Methods
• GET
• POST
142 / 203
HTTP API manual for 2N devices
Request
The request does not have any parameters.
Example of a Request
URL: https://192.168.1.1/api/pcap/live/stats
Response
The response is in the application/json format. The response contains
the success and result keys. The result value contains detailed information on the packet
capture status.
Example of a Response
143 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
N/A - - - -
Example of a Request
https://192.168.1.1/api/dir/template
Response
The response is in the application/json format. The result object contains the
keys series and users.
Go to the topic api/dir/query to get more information on the use of the key series.
The key users contains an array with one object (entry template) that contains all available keys
of an entry in the directory with their default values for a particular device.
144 / 203
HTTP API manual for 2N devices
Tip
• You can get better acquainted with the structure of the JSON response in the
example at the end of this topic.
Note
• Available keys depend on the model, type and hardware configuration of a device
(e.g. key photo is only applicable for devices that have a display and store images
in their directories).
uuid Empty Unique User Identifier. When a new entry in the directory is
created by api/dir/create, uuid can be either provided as a
parameter of the request or automatically generated by the
device.
The format of uuid is "XXXXXXXX-XXXX-XXXX-XXXX-
XXXXXXXXXXXX", where X can be any hexadecimal digit. All zeroes
are reserved for an empty uuid.
deleted false Indication of whether an entry in the directory has been deleted
or not. Deleted entries remain in the directory until the maximum
number of entries is reached. Stored deleted entries preserve
uuid only for logging reasons. Two valid values: false, true.
name Empty Name of an entry in the directory (a user or device name). A string
of up to 63 characters is expected. The name can be left empty
(the entry is in such a case identified by its uuid in logs, emails,
etc.).
145 / 203
HTTP API manual for 2N devices
photo Empty Image of an entry in the directory (e.g. user’s photo, company
logo). Saved as base64 encoded jpeg with the following syntax:
EXAMPLE: data:image/jpeg;base64,IMAGE_DATA_IN_BASE64
email Empty Email address of an entry in the directory. The expected format
is [email protected]. It is possible to enter
multiple addresses separated with commas (saved as one string).
146 / 203
HTTP API manual for 2N devices
virtNumbe Empty Virtual number of an entry in the directory. Virtual numbers may
r be dialed using a dialpad (if configured). The maximum length is
7 characters. The first and the last character may be chosen from
the range of A to Z or 0 to 9. The rest of the characters may be
between 0 to 9.
deputy Empty Uuid of a deputy entry that is called when the original callee is
unavailable or not answering. When the deputy is not set the
deputy uuid, it remains empty.
147 / 203
HTTP API manual for 2N devices
148 / 203
HTTP API manual for 2N devices
149 / 203
HTTP API manual for 2N devices
150 / 203
HTTP API manual for 2N devices
151 / 203
HTTP API manual for 2N devices
Example of a Response
{
"success": true,
"result": {
"series": "5247939846841727056",
"users": [
{
"uuid": "",
"deleted": false,
"owner": "",
"name": "",
"photo": "",
"email": "",
"treepath": "\/",
"virtNumber": "",
"deputy": "",
"buttons": "",
"callPos": [
{
"peer": "",
"profiles": "",
"grouped": false,
"ipEye": ""
},
{
"peer": "",
"profiles": "",
"grouped": false,
"ipEye": ""
},
{
"peer": "",
"profiles": "",
"grouped": false,
"ipEye": ""
}
],
"access": {
"validFrom": "0",
"validTo": "0",
"accessPoints": [
{
"enabled": true,
"profiles": ""
},
{
"enabled": true,
"profiles": ""
}
],
152 / 203
HTTP API manual for 2N devices
"pairingExpired": false,
"virtCard": "",
"card": [
"",
""
],
"mobkey": "",
"fpt": "",
"pin": "",
"apbException": false,
"code": [
"",
"",
"",
""
],
"licensePlates": "",
"liftFloors": ""
},
"timestamp": 0
}
]
}
}
Methods
• PUT
Request
The request contains the query parameter and parameters in the application/json format.
153 / 203
HTTP API manual for 2N devices
forc qu No 1 (True) 0 This key selects whether the entry in the directory
e ery identified by uuid (see below) is overwritten by the
0 (False)
new set of data.
When the value for this key is set to True, a new
dataset overwrites the existing data and the
remaining fields are reset to their default values.
When it is set to False or omitted and there is an
existing entry in the directory with the specified uuid,
the device replies with error
code EDIR_UUID_ALREADY_EXISTS and changes to
the configuration are not processed.
This key does not affect a creation of a new entry in
the directory in any way.
154 / 203
HTTP API manual for 2N devices
Example of Request
URL: https://192.168.1.1/api/dir/create?force=1
JSON:
{
"users": [
{
"uuid": "01234567-89AB-CDEF-0123-456789ABCDEF",
"name": "Julius Thompson",
"email": "[email protected]",
"access": {
"pin": "1234"
}
},
{
"name": "Carlos Inpiers",
"owner": "My2N",
"email": "[email protected]"
},
{
"uuid": "01234567-89AB-CDEF-0123-456789ABCDEF",
"name": "Fridrich Dairy",
"email": "mycountry",
"access": {
"pin": "5678"
},
"test": "something",
"albert": "einstein"
},
{},
{}
]
}
155 / 203
HTTP API manual for 2N devices
URL: https://192.168.1.1/api/dir/create
JSON:
{
"users":[
{
"name":"user1",
"email":"user1gmail.com",
"callPos":[
{
"peer":"2246",
"profiles":"",
"grouped":false
}
]
},
{
"name":"user2",
"email":"[email protected]",
"callPos":[
{
"peer":"2246",
"profiles":"",
"grouped":false
}
]
},
{
"name":"user3",
"email":"[email protected]",
"callPos":[
{
"peer":"234324234",
"profiles":"",
"grouped":false
}
]
}
]
}
The request tries to create three new entries in the directory and assign them random uuid
identifiers, names, e-mails and call information (CallPos), leaving default values for the
remaining parameters.
Response
The response is in the application/json format. The result object contains the
keys series and users.
156 / 203
HTTP API manual for 2N devices
Go to the topic api/dir/query to get more information on the use of the key series.
The key users contains an array of objects that contain keys and values of the result of the
request (see the table below).
Tip
• You can get better acquainted with the structure of the JSON response in the
example at the end of this topic.
157 / 203
HTTP API manual for 2N devices
tim integer A timestamp of performed changes in the directory. Go to the topic api/
esta dir/query to get more information on the use of the timestamp.
mp Timestamp is present only when a change in the directory was
successful.
158 / 203
HTTP API manual for 2N devices
159 / 203
HTTP API manual for 2N devices
Examples of Response
{
"success": true,
"result": {
"series": "6423407687606431951",
"users": [
{
"uuid": "01234567-89AB-CDEF-0123-456789ABCDEF",
"timestamp": 34
},
{
"uuid": "044197A7-54AD-7577-6EEA-787A6097263E",
"timestamp": 35
},
{
"errors": [
{
"code": "EDIR_FIELD_VALUE_ERROR",
"field": "email"
},
{
"code": "EDIR_FIELD_NAME_UNKNOWN",
"field": "test"
},
{
"code": "EDIR_FIELD_NAME_UNKNOWN",
"field": "albert"
}
]
},
{
"uuid": "41970B83-21C8-45DD-8FFC-787A6097263E",
"timestamp": 36
},
{
"uuid": "0447BBA7-6E7c-420C-A654-466D43D6A067",
"timestamp": 37
}
]
}
}
1.
The first entry is created with the specified uuid and fields (unspecified fields are set to
their default values). The entry gets created regardless whether there is an already existing
entry with the same uuid because the key force in the request is set to true. The
timestamp of the change is returned.
160 / 203
HTTP API manual for 2N devices
2. The second entry is created, assigned a random uuid and its specified fields are filled
(unspecified fields are set to their default values). The timestamp of the change is
returned.
3. The third object in the request contained an invalid email address format. Furthermore,
non-existent fields were referenced by the keys test and albert.
4. The fourth and fifth entries where created successfully with randomly assigned uuids and
all fields set to default values. The timestamp in the device updated twice to reflect that.
The timestamps of the changes are returned.
{
"success":true,
"result":{
"series":"2068093780728692847",
"users":[
{
"uuid":"01234567-89AB-CDEF-0123-456789ABCDCC",
"errors":[
{
"code":"EDIR_FIELD_VALUE_ERROR",
"field":"email"
}
]
},
{
"uuid":"01234567-89AB-CDEF-0123-456789ABCDCB",
"timestamp":15207
},
{
"uuid":"01234567-89AB-CDEF-0123-456789ABCDCA",
"timestamp":15208
}
]
}
}
The e-mail of the user1 entry was invalid, so the entry was not created. The other two users were
created successfully.
Methods
161 / 203
HTTP API manual for 2N devices
• PUT
162 / 203
HTTP API manual for 2N devices
Request
The request contains parameters in the application/json format. Go to the topic api/dir/
template to get more information on various parameters of an entry in the directory and their
representation.
user Yes array of JSON objects - The array has to contain at least one
s defining parameters of object with the key uuid, which defines
an entry in the directory the entry to be updated.
Go to the topic api/dir/template to get
an overview of all available keys in the
JSON definition of an entry in the
directory.
Example of Request
The third entry will not be updated (uuid has a wrong format).
163 / 203
HTTP API manual for 2N devices
The fifth entry will not be updated (wrong format of access pin).
Response
The response is in the application/json format. The result object contains the
keys series and users.
Go to the topic api/dir/query to get more information on the use of the key series.
The key users contains an array of objects that contain keys and values of the result of the
request (see the table below).
Tip
• You can get better acquainted with the structure of the JSON response in the
example at the end of this topic.
tim integer A timestamp of performed changes in the directory. Go to the topic api/
esta dir/query to get more information on the use of the timestamp. The
mp timestamp is present only when a change in the directory was
successful.
164 / 203
HTTP API manual for 2N devices
erro array of An error object containing array of all errors that occured. errors key is
rs error present only when a change in the directory failed.
objects It contains an error code in the key code showing a reason for the
failure of a change in the directory.
It may contain a further specification of the error reason in the
key field for error codes EDIR_FIELD_NAME_UNKNOWN and EDIR_FIEL
D_VALUE_ERROR showing which key or value violates the validation
rules.
The following error codes may be returned in a response:
• EDIR_UUID_DOES_NOT_EXIST - entry with the given uuid does
not exist (i.e. cannot be updated).
• EDIR_UUID_IS_MISSING - the mandatory key uuid is missing.
• EDIR_UUID_INVALID_FORMAT - uuid is not in the valid format
which is "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", where X
can be any hexadecimal digit. All zeroes are reserved as an
empty uuid.
• EDIR_FIELD_NAME_UNKNOWN - unknown key. The list of
available keys for a particular device can be obtained using the /
api/dir/template function.
• EDIR_FIELD_VALUE_ERROR - a specified value does not fit the
validation criteria (the value is not valid).
• EDIRLIM_PHOTO - the limit of the photo storage has been
reached. Photos cannot be added.
• EDIRLIM_FPT - the limit of the fingerprint template storage has
been reached. Fingerprint templates cannot be added.
• EINCONSISTENT - there is an inconsistency in the values of the
keys validFrom and validTo (validFrom has to be lower
than validTo).
165 / 203
HTTP API manual for 2N devices
Example of Response
The first entry in the directory is updated successfully, its uuid and timestamp of the change are
returned.
The second entry does not exist (no entry with such uuid).
166 / 203
HTTP API manual for 2N devices
Methods
• PUT
Request
The request contains parameters in the application/json format.
owne Yes if users a string - All entries in the directory with the
r is omitted specified owner are deleted
users Yes if owner array of JSON - The array has to contain at least one
is omitted objects object with the key uuid, which defines
defining uuids the entry that is to be deleted.
Example of Request
If there is no entry in the directory with the specified owner, an empty array is returned.
167 / 203
HTTP API manual for 2N devices
Response
The response is in the application/json format. The result object contains the
keys series and users.
Go to the topic api/dir/query to get more information on the use of the key series.
The key users contains an array of objects that contain keys uuid and timestamp.
• You can get better acquainted with the structure of the JSON response in the
example at the end of this topic.
tim integer A timestamp of performed changes in the directory. Go to the topic api/
esta dir/query to get more information on the use of the timestamp. The
mp timestamp is present only when a change in the directory was
successful.
168 / 203
HTTP API manual for 2N devices
Example of Response
The first entry in the directory is deleted successfully, its uuid and timestamp of the change are
returned.
The second entry does not exist (no entry with such uuid).
Methods
• POST
169 / 203
HTTP API manual for 2N devices
Request
The request contains parameters in the application/json format. Go to the topic api/dir/
template to get more information on various parameters of an entry in the directory and their
object representation.
fie No array all Specify the names of the required fields in the response, if the
lds of fields key is not specified, all fields with non-default values are
string with returned, if an empty array is submitted, all available fields are
s non- returned. Go to the topic api/dir/template to get an overview
default of all available keys in the JSON definition of an entry in the
values directory. Unknown field names are ignored.
us No array - The array has to contain at least one object with the key uuid,
er of which defines the entry whose fields are to be returned. If the
s JSON key is missing or an empty array is submitted, an empty array
object is returned.
s
defini
ng
uuids
Example of Request
170 / 203
HTTP API manual for 2N devices
calling destination also grouped) will be returned. Similarly for the second uuid
76543210-68FF-18CA-3210-FEDCBA987654.
Response
The response is in the application/json format. The result object contains the
keys series and users.
Go to the topic api/dir/query to get more information on the use of the object series.
The key users contains array of objects that contain keys and values of the result of the request
(see the table below).
Tip
• You can get better acquinted with the structure of the JSON response in the
example at the end of this topic.
Vario various Specified fields of an entry in the directory that are returned. See
us the api/dir/template.
keys
times integer A timestamp of the last performed changes for each returned entry in
tamp the directory. Go to the topic api/dir/query to get more information
on the use of the timestamp. The timestamp is present only when an
entry in the directory is returned.
171 / 203
HTTP API manual for 2N devices
Example of Response
The first entry in the directory is returned successfully, its uuid and timestamp are returned.
The second entry does not exist (no entry with such uuid).
Methods
• POST
172 / 203
HTTP API manual for 2N devices
Request
The request contains parameters in the application/json format. Go to the topic api/dir/
template to get more information on various parameters of an entry in the directory and their
object representation.
fields No array of all fields Specify the names of the required fields in the
strings with non- response, if the key is not specified, all fields
default with non-default values are returned, if an
values empty array is submitted, all available fields
are returned. Go to the topic api/dir/
template to get an overview of all available
keys in the JSON definition of an entry in the
directory. Unknown field names are ignored.
iterat No JSON {"timestam The key defines the iterator for the query
or object p": 0} (timestamp iterator is supported). The
timestamp iterator has an integer value. When
specified, only newer entries are returned. The
last timestamp is always returned by any of
api/dir/create, api/dir/update or api/dir/
delete and can be used as "the last known"
change. If the timestamp iterator value is zero,
all directory entries are returned. If the
timestamp iterator value is higher or equal
than the current timestamp value in the
device, the device will return its series and the
highest timestamp value.
173 / 203
HTTP API manual for 2N devices
Example of Request
If the series is inconsistent with the current series in the device, the device returns its current
series, the maximum value of the timestamp and invalid timestamp.
If the specified timestamp is lower than the current maximum timestamp, all the higher
timestamps are returned.
The device is capable of handling of up to 10000 unique user identifiers. Once the number of
uuids gets higher, the device returns key invalid, which indicates that there is an unknown
history of the directory (there were entries in the directory that were deleted and the device no
longer stores them).
If the specified timestamp is lower than the invalid timestamp, the device returns its current
series, the maximum value of the timestamp and invalid timestamp.
Response
The response is in the application/json format. The result object contains the
keys series and users.
The key users contains array of objects that contain keys and values of the result of the request
(see the table below).
Tip
• You can get better acquainted with the structure of the JSON response in the
example at the end of this topic.
174 / 203
HTTP API manual for 2N devices
Various various Specified fields of an entry in the directory that are returned.
keys See the api/dir/template.
timesta integer A timestamp of the last performed changes for each returned
mp entry in the directory. The timestamp is present only when an
entry in the directory is returned.
Example of Response
Three entries in the directory that have timestamp higher than 6 are returned (in this case the
maximum timestamp in the directory is 10).
175 / 203
HTTP API manual for 2N devices
Methods
• GET – read location IDs and encryption keys
• PUT – write location IDs or encryption keys
Request
There are no parameters used for GET request.
The PUT request contains parameters in the application/json format.
keys No Array of objects – keys contains encryption keys that are used
containing for secure communication between a 2N
encryption keys device and a device used for authentication
via Bluetooth. The objects in the array have
the following keys:
• type – algorithm type, RSA is currently
supported, this key is optional,
• key – encryption key data (DER format
encoded in Base64), use 1024 bit
encryption keys, this key is mandatory,
• ctime – creation time represented as Unix
time 32 bit unsigned integer, this key is
optional.
176 / 203
HTTP API manual for 2N devices
The 2N devices allow up to four encryption keys to be used at one time. The first encryption key
in the array is considered to be the primary encryption key and the other encryption keys are
secondary. If a Bluetooth device authenticates itself with any secondary encryption key the 2N
device will prompt the Bluetooth device to replace its encryption key with the primary
encryption key. Because of this the newest encryption key should always be added to the
beginning of the array.
If an array of a length shorter than 4 is submitted, the missing encryption keys are deleted
(replaced with an empty object).
The key type is not mandatory. If the algorithm type is omitted, the 2N® device will
automatically assume RSA (rsa).
177 / 203
HTTP API manual for 2N devices
The key ctime is not mandatory. If the creation time is omitted or invalid, the 2N device will
display Jan 1st 1970 00:00:00 in the configuration web and will not return ctime for this
encryption key.
Response
The response to a GET request is in the application/json format. The result object contains
keys location and keys.
The response to a PUT request does not contain any details. E.g., if there is an invalid encryption
key value, the key will not be written without any notification.
Table 2. Response to GET Request JSON Keys
keys Array of objects The array length is always 4 (empty objects are returned for the
containing missing keys). The details and structure of objects in the array
encryption keys are described in the Request section.
178 / 203
HTTP API manual for 2N devices
location is by default the serial number of a 2N device. Change it accordingly to add several
devices to one location.
179 / 203
HTTP API manual for 2N devices
Methods
• POST
Request
The request contains parameters in the application/json format.
lprU Yes uui – Uuid of the licence plate recognition event generated by the
uid d License Plate Recognition system.
stri
ng
lprID Yes ID – Internally unique identifier designating one license plate in one
nu recorded car arrival. One and the same license plate can be
mb recognized multiple times within one arrival. In case the camera
er obtains more details from another recognition, the plateText will
be specified while the lprID will remain the same. Each
recognition event generates a lprUuid of its own.
180 / 203
HTTP API manual for 2N devices
acce Yes 0 or - Indicates whether a vehicle with the detected license plate is
ssPoi 1 entering (0) or exiting (1) – this is important for Access Rules that
nt are applied to the event in the 2N device.
plate Yes lice – Text of the recognized license plate that is used to identify a user
Text nse in the 2N device directory.
plat
e
stri
ng
plate No ima No The image in which the license plate was recognized. The size of
Imag ge im the image data is limited to 256 kB.
e enc ag
ode e
d in
bas
e64
Example of Request
URL:
https://192.168.1.1/api/lpr/licenseplate
JSON:
{
"lprUuid": "bc4baad9-d2cd-4706-986f-b942963bfa9f",
"lprID": 143289,
"accessPoint": 0,
"plateText": "ABC123456",
181 / 203
HTTP API manual for 2N devices
"plateImage": "/9j/4AAQSkZJRgABAQEASABIAAD//gATQ3JlYXRlZCB3aXRoIEdJTVD/
4gKwSUNDX1BST0ZJTEUAAQEAAAKgbGNtcwQwAABtbnRyUkdCIFhZWiAH5AAMABIACgAHAA5hY3NwTVNGVAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1kZXNjAAABIAAAAEBjcHJ0AAABYAAAADZ3dHB0AAABmAAAABRja
GFkAAABrAAAACxyWFlaAAAB2AAAABRiWFlaAAAB7AAAABRnWFlaAAACAAAAABRyVFJDAAACFAAAACBnVFJD
AAACFAAAACBiVFJDAAACFAAAACBjaHJtAAACNAAAACRkbW5kAAACWAAAACRkbWRkAAACfAAAACRtbHVjAAA
AAAAAAAEAAAAMZW5VUwAAACQAAAAcAEcASQBNAFAAIABiAHUAaQBsAHQALQBpAG4AIABzAFIARwBCbWx1Yw
AAAAAAAAABAAAADGVuVVMAAAAaAAAAHABQAHUAYgBsAGkAYwAgAEQAbwBtAGEAaQBuAABYWVogAAAAAAAA9
tYAAQAAAADTLXNmMzIAAAAAAAEMQgAABd7///MlAAAHkwAA/ZD///uh///
9ogAAA9wAAMBuWFlaIAAAAAAAAG+gAAA49QAAA5BYWVogAAAAAAAAJJ8AAA+EAAC2xFhZWiAAAAAAAABilw
AAt4cAABjZcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltjaHJtAAAAAAADAAAAAKPXAABUfA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0SmwTqpYMLE4EMW2o/
4k4UYR2aHLyzhYSR5IJ4NEgtSnXdIiACDAyErpZAE8WZKDr/AEqKgE4iMnhFI2W9LL4JIH1fMdw/
lYQIX4dIuVCg674kgSWwA+pyumSPjX0J+UGDBgwYMGDBgwYMiFYNegNP/9k="
}
Response
The response is in the application/json format.
Table 2. Response JSON Keys
Key Typic Description
al
Retur
ned
Value
s
suc true The value is true when the request is processed successfully. When there is an
ces , error, the value is false and additional information is available in the error
s fals key.
e
Example of Response
{
"success": true
}
There may occur various errors (e.g. missing mandatory parameter). When Error code 13
(parameter data are too big) is returned, the request was not processed and it is necessary to
send the request again with a smaller image or without an image.
184 / 203
HTTP API manual for 2N devices
Subsequently received duplicate valid requests are ignored (the last ten successful requests are
held in the memory). It is possible to attempt at resending a request when there is no reply from
a 2N device without the risk of a duplicate barrier opening or duplicate event logging.
185 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
The request contains parameters in the URL.
Example of Request
URL: https://192.168.1.1/api/lpr/image?plateText=ABC123456
Response
The success response is in the image/jpeg format.
There may occur various errors (e.g. missing a mandatory parameter). Errors are returned in json
with a response code 200. If there is no image associated to the submitted plate text, error 15
"no data available" is returned.
186 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
The request contains parameters in the URL.
action Yes String (on, - Specifies whether the blocking for the
off) corresponding access point should be
switched on or switched off.
187 / 203
HTTP API manual for 2N devices
Example of Request
URL:
https://192.168.1.1/api/accesspoint/blocking/ctrl?id=0&action=on
Response
The response is in the application/json format.
Table 2. Response JSON Keys.
success true, false The value is true when the request is processed successfully
(i.e. the access blocking is in the desired state regardless of a
change).
Example of a Response
{
"success": true
}
There may occur various errors (e.g. missing mandatory parameter). When Error code 18 (access
point disabled) is returned, the request was not processed because the specified access point
was disabled at the time.
Methods
• GET
188 / 203
HTTP API manual for 2N devices
• POST
189 / 203
HTTP API manual for 2N devices
Request
The request contains parameters in the URL.
Example of Request
URL: https://192.168.1.1/api/accesspoint/blocking/status?id=0
Response
The response is in the application/json format. The value of the result key contains one
key accessPoints, which contains an array with an object for each access point (the array has
a length of 1 if an access point was specified in the request). The objects in the array contain the
following keys.
Table 2. Response JSON Keys
Key Typical Description
Returned
Values
id Integer (0, Identifies the access point (0 for Entry, 1 for Exit).
1)
blocked Boolean Contains the current status of access point blocking (true when
(true, the access point is blocked, false when the access point is not
false) blocked).
190 / 203
HTTP API manual for 2N devices
Example of Response
user Yes uuid – Identifies the user that initiates door opening
(and whose access settings are to be
considered).
Response
The response is in the application/json format.
191 / 203
HTTP API manual for 2N devices
success true, false The value is true if the request has been processed successfully
(i.e. access blocking is in the requested state regardless of the
change).
Example of Response
{
"success" : true,
"result" : {
"accessGranted" : false,
"reason" : "invalidAp"
}
}
There may occur various errors (e.g. missing mandatory parameter). Error code 18 (access point
disallowed) means that the request has not been processed because the access point was not
allowed at the time of processing.
192 / 203
HTTP API manual for 2N devices
Methods
• GET
• POST
Request
The request contains parameters in the URL (or in the application/x-www-form-
urlencoded format when POST is used).
Example of Request
URL:
https://192.168.1.1/api/lift/grantaccess?user=09ebfd7d-24e4-4d58-
ad02-804ad69938a6&duration=180
Response
The response is in the application/json format.
Table 2. Response JSON Keys
success true, false The value is true when the request is processed
successfully. If there is an error, the value is false and
additional information is available in the error key.
193 / 203
HTTP API manual for 2N devices
Example of Response
{
"success": true
}
There may occur various errors (e.g. missing mandatory parameter). When Error code 12, param:
user (User not found), is returned, the request was not processed because there is no such uuid
in the target device directory. If the submitted uuid is missing or has a wrong format, the device
will reply with error code 11 (missing mandatory parameter) or error code 12 (invalid parameter
value) respectively.
When floors are activated while being active, the longer duration will be applied (remaining time
vs new request duration).
This API endpoint can be used for lift floor control in parallel with the standard Access Control
from another device (e.g. send the lift floor activating request from an intercom to the Access
Unit that is in the lift and interfaces directly with the relay boards).
{
"success" : true
}
194 / 203
HTTP API manual for 2N devices
GET method
Request parameters for GET:
Param Description
eter
id An optional string value identifying a CA certificate. The id value is user defined id,
internal id or certificate fingerprint (hash). If id is not completed, the reply includes a
long list of all user certificates in the device.
The reply is in the application/json format and can include the following parameters:
Para Description
met
er
sub A dictionary which splits information for the Subject or the Issuer: Common Name (CN),
jet, Organization (O), Organization Unit (OU), Location (L), State (S), Country (C).
issu
er
195 / 203
HTTP API manual for 2N devices
Para Description
met
er
pro A boolean value indicating whether the certificate is protected and therefore cannot be
tec deleted from the device. Internal certificates with id starting with "#" are protected
ted and cannot be deleted.
sys A boolean value indicating whether the certificate should be selectable by the user as a
te certificate for any service. If it is true, the certificate is not shown in the selection list.
mU
seO
nly
196 / 203
HTTP API manual for 2N devices
"OU" : "www.digicert.com",
"C" : "US"
},
"issuer" : {
"CN" : "DigiCert Global Root CA",
"O" : "DigiCert Inc",
"OU" : "www.digicert.com",
"C" : "US"
},
"startDate" : "2006-11-10T00:00:00Z",
"endDate" : "2031-11-10T00:00:00Z",
"protected" : false,
"id" : "#my2n-utility",
"systemUseOnly" : true
}
]
}
}
PUT method
If one and the same certificate is already on the device, it is overwritten. It is possible to upload
multiple certificates in one PEM formatted file. It can contain any blocks, only certificates are
processed. If any of the included certificates fails to load, none are saved and the error code is
returned.
Request parameters for PUT:
Parameter Description
197 / 203
HTTP API manual for 2N devices
Parameter Description
Parameter Description
Example
198 / 203
HTTP API manual for 2N devices
DELETE method
Request parameters for DELETE:
Para Description
met
er
id A mandatory string value identifying a CA certificate. The id value is user defined id,
internal id or certificate fingerprint (hash). Internal certificates with id starting with "#"
are protected and cannot be deleted.
DELETE /api/cert/ca?
fingerprint=a163b11215a30f08603fd85c314327e275772b00 //request
{
"success" : true
/response
}
-----
{
//response
"success" : false,
"error" : {
"code" : 12,
"param" : "id",
"description" : "certificate not found",
"data": "cert_not_found"
}
}
GET method
Request parameters for GET:
199 / 203
HTTP API manual for 2N devices
Parame Description
ter
id An optional string value identifying an user certificate. The id value is user defined
id, internal id or certificate fingerprint (hash). If id is not completed, the reply
includes a long list of all user certificates in the device.
The reply is in the application/json format and can include the following parameters:
Paramet Description
er
subjet, A dictionary which splits information for the Subject or the Issuer: Common Name
issuer (CN), Organization (O), Organization Unit (OU), Location (L), State (S), Country (C).
protec A boolean value indicating whether the certificate is protected and therefore
ted cannot be deleted from the device. Internal certificates with id starting with "#" are
protected and cannot be deleted.
system A boolean value indicating whether the certificate should be selectable by the user
UseOnl as a certificate for any service. If it is true, the certificate is not shown in the
y selection list.
200 / 203
HTTP API manual for 2N devices
"CN" : "00-0001-0205",
"O" : "2N TELEKOMUNIKACE a.s.",
"S" : "Czech Republic",
"C" : "CZ"
},
"issuer" : {
"CN" : "My2N Device Utility Certificate Authority",
"O" : "2N TELEKOMUNIKACE a.s.",
"S" : "Czech Republic",
"C" : "CZ"
},
"startDate" : "2021-11-08T07:50:36Z",
"endDate" : "2022-02-06T07:50:36Z",
"protected" : false,
"id" : "#my2n-utility",
"systemUseOnly" : true
}
]
}
}
PUT method
If the same certificate is already on the device, it is overwritten.
Request parameters for PUT:
Parameter Description
blob-pk A mandatory blob-pk contains the private key in DER or PEM format.
password An optional password contains the password for the private key.
Parameter Description
201 / 203
HTTP API manual for 2N devices
Parameter Description
Example
DELETE method
Request parameters for DELETE:
Para Description
mete
r
id A mandatory string value identifying a CA certificate. The id value is user defined id,
internal id or certificate fingerprint (hash). Internal certificates with id starting with "#"
are protected and cannot be deleted.
DELETE /api/cert/user?
fingerprint=4deea7060d80bacf1643b4e0f0104c82995075b7 //request
{ //
response
"success" : true
}
202 / 203
HTTP API manual for 2N IP intercoms
203 / 203