0% found this document useful (0 votes)
19 views

Akuvox HTTP API Manual for Access Control

Uploaded by

ralmeldin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Akuvox HTTP API Manual for Access Control

Uploaded by

ralmeldin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 107

HTTP API Manual for Access Control

Akuvox HTTP API Manual for Access Control


HTTP API Manual for Access Control

Content
Introduction..................................................................................................................................................1
HTTP API Release Notes............................................................................................................................... 1
HTTP API Description....................................................................................................................................2
HTTP API Request................................................................................................................................. 2
HTTP API Method................................................................................................................................. 2
Method: GET........................................................................................................................................ 2
Method: POST...................................................................................................................................... 3
HTTP API Reply..................................................................................................................................... 4
Positive Reply without Parameters...................................................................................................... 4
Positive Reply with Parameters........................................................................................................... 4
Negative Reply......................................................................................................................................5
HTTP API Configuration................................................................................................................................ 6
HTTP API Authentication Method........................................................................................................ 7
None..................................................................................................................................................... 7
Normal..................................................................................................................................................7
WHITE LIST............................................................................................................................................7
Basic......................................................................................................................................................7
Digest....................................................................................................................................................7
Token.................................................................................................................................................... 7
HTTP API Functions.............................................................................................................................. 8
Api system.......................................................................................................................................... 11
Api system info...................................................................................................................................12
Api system status............................................................................................................................... 14
Api system reboot.............................................................................................................................. 14
Api firmware param........................................................................................................................... 15
Api firmware status............................................................................................................................ 15
Api firmware prepare......................................................................................................................... 16
Api firmware upload...........................................................................................................................16
Api firmware upgrade........................................................................................................................ 17
Api config get......................................................................................................................................18
Api config set......................................................................................................................................21
Api config export................................................................................................................................ 22
Api config import................................................................................................................................22
Api config reset_factory..................................................................................................................... 23
Api relay..............................................................................................................................................23
Api relay get....................................................................................................................................... 24
Api relay set........................................................................................................................................25
Api relay status...................................................................................................................................26
Api relay..............................................................................................................................................27
Api relay trig....................................................................................................................................... 27
HTTP API Manual for Access Control

Api input............................................................................................................................................. 28
Api input get....................................................................................................................................... 29
Api input set....................................................................................................................................... 30
Api input status.................................................................................................................................. 31
Api publiccode....................................................................................................................................32
Api publiccode get..............................................................................................................................32
Api publiccode set.............................................................................................................................. 33
Api privatekey.....................................................................................................................................34
Api privatekey get.............................................................................................................................. 34
Api privatekey add..............................................................................................................................36
Api privatekey set...............................................................................................................................38
Api privatekey del...............................................................................................................................40
Api privatekey clear............................................................................................................................42
Api privatekey export......................................................................................................................... 43
Api privatekey import.........................................................................................................................43
Api rfkey............................................................................................................................................. 44
Api rfkey get....................................................................................................................................... 45
Api rfkey add...................................................................................................................................... 47
Api rfkey set........................................................................................................................................49
Api rfkey del....................................................................................................................................... 51
Api rfkey clear.....................................................................................................................................53
Api rfkey export..................................................................................................................................54
Api rfkey import................................................................................................................................. 54
Api contact......................................................................................................................................... 55
Api contact get................................................................................................................................... 55
Api contact add.................................................................................................................................. 56
Api contact set....................................................................................................................................60
Api contact del....................................................................................................................................62
Api contact clear.................................................................................................................................64
Api contact export..............................................................................................................................65
Api contact import............................................................................................................................. 66
Api group............................................................................................................................................ 66
Api group get...................................................................................................................................... 66
Api group add..................................................................................................................................... 67
Api group set...................................................................................................................................... 68
Api group clear................................................................................................................................... 69
Api call status..................................................................................................................................... 70
Api call dial......................................................................................................................................... 70
Api call hangup................................................................................................................................... 71
Api sip................................................................................................................................................. 72
Api sip get...........................................................................................................................................72
Api sip set........................................................................................................................................... 74
Api sip status...................................................................................................................................... 75
Api dialreplace....................................................................................................................................76
HTTP API Manual for Access Control

Api dialreplace get..............................................................................................................................76


Api dialreplace add.............................................................................................................................77
Api dialreplace set.............................................................................................................................. 78
Api dialreplace del..............................................................................................................................79
Api dialreplace clear........................................................................................................................... 80
Api dialreplace export........................................................................................................................ 81
Api dialreplace import........................................................................................................................81
Api log.................................................................................................................................................82
Api log get...........................................................................................................................................82
Api log set...........................................................................................................................................83
Api log export..................................................................................................................................... 83
Api log clear........................................................................................................................................ 84
Api calllog........................................................................................................................................... 85
Api calllog get..................................................................................................................................... 85
Api calllog del..................................................................................................................................... 86
Api calllog clear.................................................................................................................................. 87
Api calllog export................................................................................................................................88
Api doorlog......................................................................................................................................... 89
Api doorlog get...................................................................................................................................89
Api doorlog del................................................................................................................................... 90
Api doorlog clear................................................................................................................................ 90
Api doorlog export............................................................................................................................. 91
Api pcap status................................................................................................................................... 91
Api pcap start..................................................................................................................................... 92
Api pcap stop......................................................................................................................................93
Api pcap export.................................................................................................................................. 94
Api user info....................................................................................................................................... 94
Api user get........................................................................................................................................ 95
Api user add........................................................................................................................................97
Api user set.........................................................................................................................................98
Api user scan...................................................................................................................................... 99
Api user edit..................................................................................................................................... 100
Api user del.......................................................................................................................................100
Api user clear....................................................................................................................................101
Api user export................................................................................................................................. 101
Api user import.................................................................................................................................102
HTTP API Manual for Access Control

Introduction
HTTP API is an application interface which is designed for function control of selected
Akuvox intercom via HTTP. It enables Akuvox intercoms to be integrated easily with third
party products, such as home automation, security and monitoring systems, etc.

Applicable to A01/A02/A03/A05.

HTTP API Release Notes

Time Version Changes


2018.12.13 V1.0 New feature:
1. Add GET interface
2. Add http standard authentication method:
Basic and Digest
3. Add system module: system, firmware,
config, dialreplace, log, calllog, doorlog, pcap
2022.2.28 V2.0 1. Add system module:user

1
HTTP API Manual for Access Control

HTTP API Description

Akuvox HTTP API is a standard protocol based on the HTTP GET/POST method. Any
request can interact with the device via GET or POST. The format of the interactive
message is JSON, and the file transfer mode uses the standard FORM upload mode.

HTTP API Request

All 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 target system module (system, firmware, config, relay, etc.)
and the action name (status, get, add, etc.). To be accepted by the intercom, a request has
to include the method and absolute path specification followed by the Host header.

Example:
http://IP address/api/Target/Action?Param

HTTP API Method

Akuvox intercom applies the following two HTTP methods: GET and POST. The GET and
POST methods are equivalent from the viewpoint of HTTP API but use different parameter
transfers (refer to the next subsection).

Method: GET

To request intercom content download or general command execution via path.


Example Request:

2
HTTP API Manual for Access Control

http://192.168.1.163/api/contact/add?name=Johnson&phone=110

Example Return:

{
"retcode": 0,
"action": 0,
"message": "OK",
"data": {
"id": 0,
"name": "Johnson",
"phone": "110"
}
}

Method: POST

Post mode is the same as Get mode that requests intercom content download or general
command execution, but Post moves the Query String parameters into the json for
processing

Example Request:

http://Device-IP/api/
{
"target": "contact",
"action": "add",
"data" : {
"name": "Johnson",
"phone": "110"
}
}

Example Return:

3
HTTP API Manual for Access Control

{
"retcode": 0,
"action": 0,
"message": "OK",
"data": {
"id": 0,
"name": "Johnson",
"phone": "110"
}
}

HTTP API Reply

Replies to requests are mostly in the JSON format, and Files exported according to
requests are saved in file format without compression (e.g config is saved in .tgz file type ,
rfkey is saved in .xml file type, etc). The Content-Type header specifies the response
format. Three basic reply types are defined for JSON.

Positive Reply without Parameters

This reply is sent in case a request has been executed successfully for functions that do
not return any parameters. This reply is always combined with the HTTP status code
200OK.
{
"retcode": 0,
"action": "xxxx",
"message": "OK"
}

Positive Reply with Parameters

This reply is sent in case a request has been executed successfully for functions that
return supplementary parameters. The result item includes other reply parameters related
to the function. This reply is always combined with the HTTP status code 200OK.

4
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "xxxxx",
"message": "OK",
"data":
{
......
}
}

Negative Reply

This reply is sent in case an error occurs during request processing. The reply specifies
the error code (code), text description (description) and error details if necessary (param).
The reply can be combined with the HTTP status code 200 OK or 401 Unauthorized
Required.

{
"retcode": -1,
"action": "unknow",
"message": "unsupport action"
}

5
HTTP API Manual for Access Control

HTTP API Configuration


HTTP API configurations for Akuvox intercom are defined via web interface PATH:
Intercom->HTTP API to disable/enable a service and select the user authentication
method

Item Description
HTTP API Disabled: system allways return HTTP 403 Forbidden status
Enabled:enable http api
Auth Mode None: no authentication method
Normal: (reserved)
WhiteList: Whitelist model
Basic: http Basic standard authentication method
Digets: http Digets standard authentication method
Token : (reserved)
User Name UserName: admin (default), used in basic and digest auth
mode
Password Password: httpapi (default), used in basic and digest auth
mode
IP01 White List IP
IP02 White List IP
IP03 White List IP
IP04 White List IP
IP05 White List IP

6
HTTP API Manual for Access Control

HTTP API Authentication Method

None

No authentication is required for http api, it is only used by demo testing.

Normal

(Reserved)

WHITE LIST

The whitelist is suitable for operation in the LAN, by judging the IP address of the visitor to
confirm whether to allow access to the HTTP API.

Basic

In Authorization field of Http request header, use Base64 encode method for the
information of username and password.

For more detailed information, please refer to RFC2671

Digest

Password encryption method, only supports MD5. In


Authorization field of Http request header:
WWW-Authenticate: Digest realm="HTTPAPI",qop="auth,auth-int",nonce="xx", opaque="xx"
For more detailed information, please refer to RFC2671

Token

(Reserved)

7
HTTP API Manual for Access Control

HTTP API Functions

The table below provides a list of all available HTTP API functions including:
 the HTTP request absolute path
 the supported HTTP methods

Absolute path API Method


/api/system/info GET/POST
/api/system/status GET/POST
/api/system/reboot GET/POST
/api/firmware/status GET/POST
/api/firmware/prepare GET/POST
/api/firmware/upload POST
/api/firmware/upgrade GET/POST
/api/config/get GET/POST
/api/config/set POST
/api/config/export GET/POST
/api/config/import POST
/api/config/reset_factory GET/POST
/api/relay/get GET/POST
/api/relay/set POST
/api/relay/status GET/POST
/api/relay/trig GET/POST
/api/input/get GET/POST
/api/input/set POST
/api/input/status GET/POST
/api/publiccode/get GET/POST
/api/publiccode/set POST
/api/privatekey/get GET/POST
/api/privatekey/add POST
/api/privatekey/set POST
/api/privatekey/del POST
/api/privatekey/clear GET/POST
/api/privatekey/export GET/POST
/api/privatekey/import POST
/api/rfkey/get GET/POST
/api/rfkey/add POST
/api/rfkey/set POST
/api/rfkey/del POST
/api/rfkey/clear GET/POST
/api/rfkey/export GET/POST
/api/rfkey/import POST

8
HTTP API Manual for Access Control

/api/contact/get GET/POST
/api/contact/add POST
/api/contact/set POST
/api/contact/del POST
/api/contact/clear GET/POST
/api/contact/export GET/POST
/api/contact/import POST
/api/group/get GET/POST
/api/group/add POST
/api/group/set POST
/api/group/clear GET/POST
/api/call/status GET/POST
/api/call/dial GET/POST
/api/call/hangup GET/POST
/api/sip/get GET/POST
/api/sip/set POST
/api/sip/status GET/POST
/api/dialreplace/get GET/POST
/api/dialreplace/add POST
/api/dialreplace/set POST
/api/dialreplace/del POST
/api/dialreplace/clear GET/POST
/api/dialreplace/export GET/POST
/api/dialreplace/import GET/POST
/api/log/get GET/POST
/api/log/set POST
/api/log/export GET/POST
/api/log/clear GET/POST
/api/calllog/get GET/POST
/api/calllog/del POST
/api/calllog/clear GET/POST
/api/calllog/export GET/POST
/api/doorlog/get GET/POST
/api/doorlog/del POST
/api/doorlog/clear GET/POST
/api/doorlog/export GET/POST
/api/pcap/status GET/POST
/api/pcap/start GET/POST
/api/pcap/stop GET/POST
/api/pcap/export GET/POST

9
HTTP API Manual for Access Control

/api/user/info GET/POST
/api/user/get GET/POST
/api/user/add POST
/api/user/set POST
/api/user/scan POST
/api/user/edit GET/POST
/api/user/del POST
/api/user/clear GET/POST
/api/user/export GET/POST
/api/user/import POST

10
HTTP API Manual for Access Control

Api system

Section Param Description


Model ProductModel
R29S
MAC MAC address
Status FirmwareVersion Firmware version:
29.1.1.250
HardwareVersion Hardware version
29.3.0
PortType 0: DHCP
1: Static
LinkStatus 0: Disconnect
1: Connected
2: IP Conflict
Lan
IPAddress 192.168.1.78
SubnetMask 255.255.255.0
Gateway 192.168.1.1
DNS1 192.168.1.1
DNS2 192.168.1.1
UserName 114
SipServer 192.168.1.115
Status -1: unknow
Account1 0: disable
1: registering
2: registed
3: registe failed
UserName 115
SipServer 192.168.1.115
Status -1: unknow
Account2 0: disable
1: registering
2: registed
3: registe failed

11
HTTP API Manual for Access Control

Api system info


The GET or POST method can be used for this function.

The reply is in the application/json format and includes the following information on the
device:

Example Request:

GET: /api/system/info

POST:
{
"target": "system",
"action": "info"
}

Example Return:

12
HTTP API Manual for Access Control

{
"action": "info", "data":
{
"Account1": {
"SipServer": "192.168.1.115",
"Status": "2",
"UserName": "141"
},
"Account2": {
"SipServer": "192.168.1.115",
"Status": "2",
"UserName": "142"
}, "Lan": {
"DNS1": "192.168.1.1", "DNS2": "",
"Gateway": "192.168.1.1",
"IPAddress": "192.168.1.78",
"LinkStatus": "1",
"PortType": "0",
"SubnetMask": "255.255.255.0"
},
"Status": {
"FirmwareVersion": "29.31.101.624",
"HardwareVersion": "29.3.0", "MAC":
"0C:11:05:07:8B:71", "Model": "R29S"
}
},
"message": "OK", "retcode": 0
}

13
HTTP API Manual for Access Control

Api system status

The GET or POST method can be used for this function.

Param Description
SystemTime Unix time
UpTime Device online time

Example Request:
GET: /api/system/status

POST:
{
"target": "system",
"action": "status"
}

Example Return:

{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"SystemTime": 1544336389,
"UpTime": 137
}
}

Api system reboot

Example Request:

GET: /api/system/reboot

POST:
{
"target": "system",
"action": "reboot"
}

14
HTTP API Manual for Access Control

Example Return:
{
"retcode": 0,
"action": "status",
"message": "OK",
}

Api firmware param

Param Description
md5 string, optional
md5sum of the firmware
only use in action “upgraer”
silent silent
0 - ui will display upgrade process
1 - upload in backgroup
only use in action “upload”
default: 0

Api firmware status

The GET or POST method can be used for this function.

Example Request:

GET: /api/firmware/status

POST:
{
"target": "firmware",
"action": "status",
}

Example Return:

15
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"FirmwareVersion": "29.31.101.624",
"HardwareVersion": "29.3.0",
"MAC": "0C:11:05:07:8B:71",
"Model": "R29S"
}
}

Api firmware prepare

Tell device into upgrade mode, this must do before upload and upgrade action The GET or
POST method can be used for this function.

Example Request:
GET: /api/firmware/prepare

POST:
{
"target": "firmware",
"action": "prepare",
}

Example Return:
{
"retcode": 0,
"action": "prepare",
"message": "OK"
}

Api firmware upload

Upload firmware, Only POST method can be used for this function. PATH:
/api/firmware/upload

16
HTTP API Manual for Access Control

PARAM: /api/firmware/upload?silent=0

Api firmware upgrade

The GET or POST method can be used for this function. Example

Request(without MD5 param):


GET: /api/firmware/upgrade

POST:
{
"target": "firmware",
"action": "upgrade",
}

Example Return(with MD5 param):


{
"retcode": 0,
"action": "upgrade",
"message": "OK"
}

Example Request(with MD5 param):

17
HTTP API Manual for Access Control

GET: /api/firmware/upgrade?md5=25e317773f308e446cc84c503a6d1f85

POST:
{
"target": "firmware",
"action": "upgrade",
"data": {
"md5" : "25e317773f308e446cc84c503a6d1f85"
}
}

Example Return(with MD5 param):

{
"retcode": -1,
"action": "upgrade",
"message": "Wrong MD5",
"data": {
"md5": "25e317773f308e446cc84c503a6d1f83",
"md5_calc": "25e317773f308e446cc84c503a6d1f85"
}
}

Api config get


Note: The configuration for CardSetting、PrivateKey、DialReplace、Contact、Group are
not included in this section.

The GET or POST method can be used for this function.

To get all configurations.


Example Request 1:
GET: /api/config/get

POST:
{
"target": "config",
"action": "get"
}

18
HTTP API Manual for Access Control

Example Return 1:

{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"Config.Account1.ADVANCED.ShowMissedCall": "1",
"Config.Account1.ANONYMOUS_CALL.Enable": "0",
"Config.Account1.ANONYMOUS_CALL.OffCode": "",
"Config.Account1.ANONYMOUS_CALL.OnCode": "",
.......
"Config.Account1.ANONYMOUS_CALL.PrivacyHeaderValue": "id",
},
}

To get the configurations for one section.


Example Request 2: To get the configurations for one section.
POST:
{
"target": "config",
"action": "get",
"data": {
"filter": [
"Config.DoorSetting.CLOUDSERVER"
]
}
}

Example Return 2:

19
HTTP API Manual for Access Control

{
"retcode": 0
"action": "get",
"message": "OK",
"data": {
"Config.DoorSetting.CLOUDSERVER.DeviceCommunity": "",
"Config.DoorSetting.CLOUDSERVER.Enable": "0",
"Config.DoorSetting.CLOUDSERVER.GatePort": "0",
"Config.DoorSetting.CLOUDSERVER.GateServer": "",
"Config.DoorSetting.CLOUDSERVER.OpenDoorLimit": "",
"Config.DoorSetting.CLOUDSERVER.Port": "",
"Config.DoorSetting.CLOUDSERVER.RpsEnable": "1",
"Config.DoorSetting.CLOUDSERVER.RpsServer":
"http://rps.akuvox.com:8080/redirect?mac=",
"Config.DoorSetting.CLOUDSERVER.Server": "",
"Config.DoorSetting.CLOUDSERVER.Token": "",
"Config.DoorSetting.CLOUDSERVER.Type": "",
"Config.DoorSetting.CLOUDSERVER.UploadPassword": "",
"Config.DoorSetting.CLOUDSERVER.UploadUrl": "",
"Config.DoorSetting.CLOUDSERVER.UploadUser": ""
},

}

To get the specified configuration.


Example Request 3:

POST:
{
"action": "get",
"target": "config",
"data": {
"item": [
"Config.DoorSetting.CLOUDSERVER.Enable",
"Config.DoorSetting.CLOUDSERVER.RpsServer"
]
}
}

Example Return 3:

20
HTTP API Manual for Access Control

{
"retcode": 0
"action": "get",
"message": "OK",
"data": {
"Config.DoorSetting.CLOUDSERVER.Enable": "0",
"Config.DoorSetting.CLOUDSERVER.RpsServer":
"http://rps.akuvox.com:8080/redirect?mac="
},
}

Api config set

Only POST method can be used for this function. Api config set

Example Request:

POST:
{
"target": "config",
"action": "set",
"data": {
"Config.DoorSetting.CLOUDSERVER.Enable": "0",
"Config.DoorSetting.CLOUDSERVER.RpsServer":
"192.168.1.163"
}
}

Example Return:
{
"retcode": 0,
"action": "set",
"message": "OK"
}

21
HTTP API Manual for Access Control

Api config export

To export the configuration, equivalent to operate via web interface path: Upgrader- >
Advanced-> Config File->Export, and the exported configuration is encrypted which cannot
be modified.

The GET or POST method can be used for this function.

Example Request:

GET: /api/config/export

POST:
{
"action": "export",
"target": "config",
"data": {
}
}

Example Return:
Config.tgz file type

Api config import

To import the configuration, equivalent to operate via web interface path: Upgrader->
Advanced-> Config File->Import, and only tgz file can be accepted. Note: Device will reboot
after import the configuration successfully.

Only POST method can be used for this function.

22
HTTP API Manual for Access Control

Api config reset_factory

The GET or POST method can be used for this function. Example

Request:
GET: /api/config/reset_factory

POST:
{
"target": "config",
"action": "reset_factory"
}

Example Return:
{
"retcode": 0,
"action": "reset_factory",
"message": "OK"
}

Api relay

Params Description
Config.DoorSetting.RELAY.TypeA Relay Open Type
Config.DoorSetting.RELAY.TypeB 0 - NC - COM Open
Config.DoorSetting.RELAY.TypeC 1- NO -COM Open
Config.DoorSetting.RELAY.HoldDelayA Relay Hold Delay 0 ~ 60 second
Config.DoorSetting.RELAY.HoldDelayB
Config.DoorSetting.RELAY.HoldDelayC
Config.DoorSetting.RELAY.TriggerDelayA Relay Trigger Delay 0 ~ 60 second
Config.DoorSetting.RELAY.TriggerDelayB Delay X second to trigger relay
Config.DoorSetting.RELAY.TriggerDelayC
Config.DoorSetting.DTMF.Enable Config.DoorSetting.DTMF.Option
n=1: 1 digit dtmf, refer to
Config.DoorSetting.DTMF.CodeX
n=2~4: 2~4 digits dtmf, refer to
Config.DoorSetting.DTMF.MultiCodeX

Config.DoorSetting.DTMF.Code1 one dtmf code

23
HTTP API Manual for Access Control

Config.DoorSetting.DTMF.Code2
Config.DoorSetting.DTMF.Code3
Config.DoorSetting.DTMF.MultiCode1
Config.DoorSetting.DTMF.MultiCode2 2 ~ 4 digits dtmf code
Config.DoorSetting.DTMF.MultiCode3

Api relay get

The GET or POST method can be used for this function. Example

Request:
GET: /api/relay/get

POST:
{
"target": "relay",
"action": "get"
}

Example Return:

24
HTTP API Manual for Access Control

{
"retcode": 0, "action": "get",
"message": "OK", "data": {
"Config.DoorSetting.RELAY.TypeA": "0",
"Config.DoorSetting.RELAY.TypeB": "0",
"Config.DoorSetting.RELAY.TypeC": "0",
"Config.DoorSetting.RELAY.HoldDelayA": "5",
"Config.DoorSetting.RELAY.HoldDelayB": "5",
"Config.DoorSetting.RELAY.HoldDelayC": "5",
"Config.DoorSetting.RELAY.TriggerDelayA": "0",
"Config.DoorSetting.RELAY.TriggerDelayB": "0",
"Config.DoorSetting.RELAY.TriggerDelayC": "0",
"Config.DoorSetting.RELAY.NameA": "RelayA",
"Config.DoorSetting.RELAY.NameB": "RelayB",
"Config.DoorSetting.RELAY.NameC": "RelayC",
"Config.DoorSetting.RELAY.HttpTrig": "0",
"Config.DoorSetting.RELAY.UserName": "",
"Config.DoorSetting.RELAY.Password": "",
"Config.DoorSetting.DTMF.Enable": "1",
"Config.DoorSetting.DTMF.Option":"0",
"Config.DoorSetting.DTMF.Code1":"0",
"Config.DoorSetting.DTMF.Code2":"1",
"Config.DoorSetting.DTMF.Code3":"2",
"Config.DoorSetting.DTMF.MultiCode1": "010",
"Config.DoorSetting.DTMF.MultiCode2": "012",
"Config.DoorSetting.DTMF.MultiCode3": "013"
}
}

Api relay set

Only POST method can be used for this function. Example

Request:

25
HTTP API Manual for Access Control

POST:
{
"target": "relay",
"action": "set",
"data" : {
"Config.DoorSetting.RELAY.HoldDelayA": "8"
}
}

Example Return:

{
"retcode": 0,
"action": "set",
"message": "OK"
}

Api relay status

The GET or POST method can be used for this function. Example

Request:
GET: /api/relay/status

POST:
{
"target": "relay",
"action": "status"

Example Return:

26
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"RelayA": 0,
"RelayB": 0,
"RelayC": 0
}
}

Api relay

Params Description
0:Auto Close
mode
1: Manual
num 1 Relay A
2 Relay B
3 Relay C
level 0 NO - COM
1 NC - COM
delay 0~65535(Second)

Api relay trig

The GET or POST method can be used for this function. Example

Request:

GET: /api/relay/trig?mode=1&num=1&level=1&delay=5

27
HTTP API Manual for Access Control

POST:
{
"target": "relay",
"action": "trig",
"data" : {
"mode": 1,
"num": 1,
"level": 1,
"delay": 5
}
}

Example Return:
{
"retcode": 0,
"action": "trig",
"message": "OK"
}

Api input

Params Description
Config.DoorSetting.INPUT.EnableA
Config.DoorSetting.INPUT.EnableB Input Enable
Config.DoorSetting.INPUT.EnableC
Config.DoorSetting.INPUT.OptionA Trig Option:
Config.DoorSetting.INPUT.OptionB 0 Low Trig
Config.DoorSetting.INPUT.OptionC 1 High Trig
Config.DoorSetting.INPUT.DelayA Trig Delay 0 ~ 65536 second
Config.DoorSetting.INPUT.DelayB 0: trig now
Config.DoorSetting.INPUT.DelayC 1 ~ 65536: trig after X second
Config.DoorSetting.INPUT.RelayIdA Trig which relay id
Config.DoorSetting.INPUT.RelayIdB 1 - Relay A
Config.DoorSetting.INPUT.RelayIdC 2 - Relay B
3 - Relay C
Config.DoorSetting.INPUT.ActionUrlA Action URL
Config.DoorSetting.INPUT.ActionUrlB More Action URL Param see Action
Config.DoorSetting.INPUT.ActionUrlC URL document
Config.DoorSetting.INPUT.FtpEnableA when input trig, send capture files to

28
HTTP API Manual for Access Control

Config.DoorSetting.INPUT.FtpEnableA ftp server.


Config.DoorSetting.INPUT.FtpEnableA 0 - Disable
1 - Enable
Config.DoorSetting.INPUT.HttpEnableA when input trig, send a http get requst
Config.DoorSetting.INPUT.HttpEnableB with url
Config.DoorSetting.INPUT.HttpEnableC 0 - Disable
1 - Enable
Config.DoorSetting.INPUT.SmtpEnableA when input trig, send capture files with
Config.DoorSetting.INPUT.SmtpEnableB smtp
Config.DoorSetting.INPUT.SmtpEnableC 0 - Disable
1 - Enable
Config.DoorSetting.INPUT.SipEnableA when input trig, start a sip call
Config.DoorSetting.INPUT.SipEnableB
Config.DoorSetting.INPUT.SipEnableC
Config.DoorSetting.Action.CallNum sip call num
Config.DoorSetting.Action.CallName sip call remote display name

Api input get

The GET or POST method can be used for this function. Example

Request:
GET: /api/input/get

POST:
{
"target": "input",
"action": "get"
}

Example Return:

29
HTTP API Manual for Access Control

{
"retcode": 0, "action": "get",
"message": "OK", "data": {
"Config.DoorSetting.INPUT.EnableA": "1",
"Config.DoorSetting.INPUT.EnableB": "1",
"Config.DoorSetting.INPUT.EnableC": "1",
"Config.DoorSetting.INPUT.OptionA": "0",
"Config.DoorSetting.INPUT.OptionB": "0",
"Config.DoorSetting.INPUT.OptionC": "0",
"Config.DoorSetting.INPUT.DelayA": "0",
"Config.DoorSetting.INPUT.DelayB": "0",
"Config.DoorSetting.INPUT.DelayC": "0",
"Config.DoorSetting.INPUT.RelayIdA": "1",
"Config.DoorSetting.INPUT.RelayIdB": "2",
"Config.DoorSetting.INPUT.RelayIdC": "3",
"Config.DoorSetting.INPUT.FtpEnableA": "0",
"Config.DoorSetting.INPUT.FtpEnableB": "0",
"Config.DoorSetting.INPUT.FtpEnableC": "0",
"Config.DoorSetting.INPUT.HttpEnableA": "0",
"Config.DoorSetting.INPUT.HttpEnableB": "0",
"Config.DoorSetting.INPUT.HttpEnableC": "0",
"Config.DoorSetting.INPUT.SipEnableA": "0",
"Config.DoorSetting.INPUT.SipEnableB": "0",
"Config.DoorSetting.INPUT.SipEnableC": "0",
"Config.DoorSetting.INPUT.SmtpEnableA": "0",
"Config.DoorSetting.INPUT.SmtpEnableB": "0",
"Config.DoorSetting.INPUT.SmtpEnableC": "0",
"Config.DoorSetting.INPUT.ActionUrlA": "",
"Config.DoorSetting.INPUT.ActionUrlB": "",
"Config.DoorSetting.INPUT.ActionUrlC": ""
}
}

Api input set

Only POST method can be used for this function. Example

Request:

30
HTTP API Manual for Access Control

POST:
{
"target": "input",
"action": "set",
"data" : {
"Config.DoorSetting.INPUT.EnableA": "0"
}
}

Example Return:
{
"retcode": 0,
"action": "set",
"message": "OK"
}

Api input status

Params Description
InputA Door A GPIO Level
InputB Door B GPIO Level
InputC Door C GPIO Level

The GET or POST method can be used for this function. Example

Request:
GET: /api/input/status

POST:
{
"target": "input",
"action": "status",
}

Example Return:

31
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"InputA": 1,
"InputB": 1,
"InputC": 1
}
}

Api publiccode

Params Description
Config.DoorSetting.PASSWORD.PublicKeyEnable Enable Public Code
0: Disable
1: Enable
Config.DoorSetting.PASSWORD.PublicKey1 Public Key 1
Config.DoorSetting.PASSWORD.PublicKey2 Public Key 2
Config.DoorSetting.PASSWORD.PublicKey3 Public Key 3
Config.DoorSetting.PASSWORD.PublicKeyBitsLimit 0 - 8 bit
1 - 4bit
2 - 5bit
3 - 6bit
4 - 7bit

Api publiccode get

The GET or POST method can be used for this function. Example

Request:
GET: /api/publiccode/get

POST:
{
"target": "publiccode",
"action": "get",
}

32
HTTP API Manual for Access Control

Example Return:

{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"Config.DoorSetting.PASSWORD.PublicKeyEnable": "1",
"Config.DoorSetting.PASSWORD.PublicKey1": "33333333",
"Config.DoorSetting.PASSWORD.PublicKey2": "66666666",
"Config.DoorSetting.PASSWORD.PublicKey3": "88888888",
"Config.DoorSetting.PASSWORD.PublicKeyBitsLimit": "0"
}
}

Api publiccode set

Only POST method can be used for this function. Example

Request:

POST:
{
"target": "publiccode",
"action": "set",
"data" : {
"Config.DoorSetting.PASSWORD.PublicKeyEnable": "0"
}
}

Example Return:
{
"retcode": 0,
"action": "set",
"message": "OK"
}

33
HTTP API Manual for Access Control

Api privatekey

Param Description
ID e.g. “ID”:”1”
Code RF SN
e.g. “Code”:”12345678”
DoorNum 1 : Door A
2 : Door B
3 : Door C
e.g. “DoorNum”: “123”
Mon 0 - Disable
1 - Enable
Tue 0 - Disable
1 - Enable
Wed 0 - Disable
1 - Enable
Thur 0 - Disable
1 - Enable
Fri 0 - Disable
1 - Enable
Sat 0 - Disable
1 - Enable
Sun 0 - Disable
1 - Enable
TimeStart “00:00” - “23:59”
“00:00” - “00:00”: key will always workr
TimeEnd “00:00” - “23:59”

Api privatekey get

The GET or POST method can be used for this function. Example

Request:
GET: /api/privatekey/get

POST:
{
"target": "privatekey",
"action": "get",
}

34
HTTP API Manual for Access Control

Example Return:
{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"num": 2,
"item": [
{
"Code": "12345678",
"DoorNum": "1",
"Fri": "1",
"ID": "1",
"Mon": "1",
"Name": "123456",
"Sat": "1",
"Sun": "1",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
},
{
"Code": "78965412",
"DoorNum": "1",
"Fri": "1",
"ID": "2",
"Mon": "1",
"Name": "5555",
"Sat": "1",
"Sun": "1",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
}
]
}
}

35
HTTP API Manual for Access Control

Api privatekey add

Only POST method can be used for this function. Example

Request:

36
HTTP API Manual for Access Control

POST:
{
"target": "privatekey",
"action": "add",
"data" : {
"item": [
{
"Code": "88888888",
"DoorNum": "1",
"Fri": "1",
"ID": "1",
"Mon": "1",
"Name": "Lucy",
"Sat": "1",
"Sun": "1",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
},
{
"Code": "66666666",
"DoorNum": "1",
"Fri": "1",
"ID": "2",
"Mon": "1",
"Name": "Carol",
"Sat": "1",
"Sun": "1",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
}
]
}
}

Example Return:

37
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "add",
"message": "OK",
"data": {
"num": 2,
"item": [
{
"Code": "88888888",
"ID": "1",
"Name": "Lucy"
},
{
"Code": "66666666",
"ID": "2",
"Name": "Carol"
}
]
}
}

Api privatekey set

Only POST method can be used for this function. Example

Request:
GET: /api/firmware/upgrade

38
HTTP API Manual for Access Control

POST:
{
"target": "privatekey",
"action": "set",
"data" : {
"item": [
{
"Code": "12345678",
"DoorNum": "0",
"Fri": "1",
"ID": "5",
"Mon": "1",
"Name": "Lucy",
"Sat": "1",
"Sun": "1",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
},
{
"Code": "99999999",
"DoorNum": "0",
"Fri": "1",
"ID": "6",
"Mon": "1",
"Name": "Carol",
"Sat": "1",
"Sun": "1",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
}
]
}
}

Example Return:

39
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "set",
"message": "OK",
"data": {
"num": 2,
"item": [
{
"Ret": 0,
"Code": "12345678",
"ID": "5",
"Name": "Lucy"
},
{
"Ret": 0,
"Code": "99999999",
"ID": "6",
"Name": "Carol"
}
]
}
}

Api privatekey del

Only POST method can be used for this function. Example

Request:

40
HTTP API Manual for Access Control

POST:
{
"target": "privatekey",
"action": "del",
"data" : {
"item": [
{
"ID": "7"
},
{
"Code": "66666666"
},
{
"Name": "Carol"
},
{
"ID": "5",
"Code": "88888888",
"Name": "Lucy"
}
]
}
}

Example Return:

41
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "del",
"message": "OK",
"data": {
"num": 4,
"item": [
{
"Ret": 0,
"Code": "88888888",
"ID": "7",
"Name": "Lucy"
},
{
"Ret": 0,
"Code": "66666666",
"ID": "6",
"Name": "Carol"
},
{
"Ret": 0,
"Code": "66666666",
"ID": "8",
"Name": "Carol"
},
{
"Ret": 0,
"Code": "88888888",
"ID": "5",
"Name": "Lucy"
}
]
}
}

Api privatekey clear

The GET or POST method can be used for this function. Example

Request:

42
HTTP API Manual for Access Control

GET: /api/privatekey/clear

POST:
{
"target": "privatekey",
"action": "clear",
}

Example Return:
{
"retcode": 0,
"action": "clear",
"message": "OK"
}

Api privatekey export

The GET or POST method can be used for this function. Example

Request:
GET: /api/privatekey/export

POST:
{
"target": "privatekey",
"action": "export"
}

Example Return:

Content-Type: application/octet-stream
Content-Disposition: attachment;filename=PrivateKey.xml

Api privatekey import

Only POST method can be used for this function.

43
HTTP API Manual for Access Control

Api rfkey

Param Description
ID e.g. “ID”:”1”
Code RF SN
e.g. “Code”:”12345678”
DoorNum 1 : Door A
2 : Door B
3 : Door C
e.g. “DoorNum”: “123”
Mon 0 - Disable
1 - Enable
Tue 0 - Disable
1 - Enable
Wed 0 - Disable
1 - Enable
Thur 0 - Disable
1 - Enable
Fri 0 - Disable
1 - Enable
Sat 0 - Disable
1 - Enable
Sun 0 - Disable
1 - Enable
TimeStart “00:00” - “23:59”
“00:00” - “00:00”: key will always work
TimeEnd “00:00” - “23:59”
Tags 0: ALLOWED
1: FREQUENCY
2: FROBIDDEN forbidden
3: SCHEDULE
Frequency 0 ~ 65535
DoorWebRelay (Reserved) for WebRelay Action

44
HTTP API Manual for Access Control

Api rfkey get

The GET or POST method can be used for this function. Example

Request:
GET: /api/rfkey/get

POST:
{
"target": "rfkey",
"action": "get",

Example Return:

45
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"num": 2,
"item": [
{
"Code": "00B4161D",
"DoorNum": "0",
"Frequency": "0",
"Fri": "1",
"ID": "1",
"Mon": "1",
"Name": "Lucy",
"Sat": "1",
"Sun": "1",
"Tags": "0",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
},
{
"Code": "00B4161E",
"DoorNum": "0",
"Frequency": "0",
"Fri": "1",
"ID": "2",
"Mon": "1",
"Name": "Carol",
"Sat": "1",
"Sun": "1",
"Tags": "0",
"Thur": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00",
"Tue": "1",
"Wed": "1"
}
]
}
}

46
HTTP API Manual for Access Control

Api rfkey add

Only POST method can be used for this function. Example

Request:

47
HTTP API Manual for Access Control

POST:
{
"target": "rfkey",
"action": "add",
"data" : {
"item": [
{
"ID": "0",
"Name": "Lucy",
"Code": "00B4161D",
"DoorNum": "1",
"Tags": "0",
"Frequency": "0",
"Mon": "1",
"Tue": "1",
"Wed": "1",
"Thur": "1",
"Fri": "1",
"Sat": "1",
"Sun": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00"
},
{
"ID": "0",
"Name": "Carol",
"Code": "00B4161E",
"DoorNum": "1",
"Tags": "0",
"Frequency": "0",
"Mon": "1",
"Tue": "1",
"Wed": "1",
"Thur": "1",
"Fri": "1",
"Sat": "1",
"Sun": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00"
}
]
}
}

48
HTTP API Manual for Access Control

Example Return:
{
"retcode": 0,
"action": "add",
"message": "OK",
"data": {
"num": 2,
"item": [
{
"Ret": 1,
"Code": "00B4161D",
"ID": "1",
"Name": "Lucy"
},
{
"Ret": 2,
"Code": "00B4161E",
"ID": "2",
"Name": "Carol"
}
]
}
}

Api rfkey set

Only POST method can be used for this function. Example

Request:

49
HTTP API Manual for Access Control

POST:
{
"target": "rfkey",
"action": "set",
"data" : {
"item": [
{
"ID": "1",
"Name": "Lucy",
"Code": "00B4161D",
"DoorNum": "123",
"Tags": "0",
"Frequency": "0",
"Mon": "1",
"Tue": "1",
"Wed": "1",
"Thur": "1",
"Fri": "1",
"Sat": "1",
"Sun": "1",
"TimeEnd": "00:00",
"TimeStart": "00:00"
}
]
}
}

Example Return:

50
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "set",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Ret": 0,
"Code": "00B4161D",
"ID": "1",
"Name": "Lucy"
}
]
}
}

Api rfkey del

Only POST method can be used for this function. Example

Request:

51
HTTP API Manual for Access Control

POST:
{
"target": "rfkey",
"action": "del",
"data" : {
"item": [
{
"ID": "1"
},
{
"Name": "Carol"
},
{
"ID": "5",
"Code": "88888888",
"Name": "Lucy"
}
]
}
}

Example Return:

52
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "del",
"message": "OK",
"data": {
"num": 3,
"item": [
{
"Ret": 0,
"Code": "00B4161D",
"ID": "1",
"Name": "Lucy"
},
{
"Ret": 0,
"Code": "00B4161E",
"ID": "2",
"Name": "Carol"
},
{
"Ret": -1,
"Code": "88888888",
"ID": "5",
"Name": "Lucy"
}
]
}
}

Api rfkey clear

The GET or POST method can be used for this function. Example

Request:
GET: /api/rfkey/clear

POST:
{
"target": "rfkey",
"action": "clear",
}

53
HTTP API Manual for Access Control

Example Return:
{
"retcode": 0,
"action": "clear",
"message": "OK"
}

Api rfkey export

The GET or POST method can be used for this function. Example

Request:
GET: /api/rfkey/export

POST:
{
"target": "rfkey",
"action": "export"
}

Example Return:

Content-Type: application/octet-stream
Content-Disposition: attachment;filename=ICKey.xml

Api rfkey import

Only POST method can be used for this function.

54
HTTP API Manual for Access Control

Api contact

Param Description
ID Index
Name Name
Phone Phone Number
DialType 0 Auto (if phone number is ip, will can with direct
ip, others use register account )
1 Account 1
2 Account 2
Group Group Name

Api contact get

The GET or POST method can be used for this function. Example

Request:
GET: /api/contact/get

POST:
{
"target": "contact",
"action": "get"
}

Example Return:

55
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"num": 4,
"item": [
{
"DialType": "0",
"Group": "",
"ID": "2",
"Name": "Carol",
"Phone": "112"
},
{
"DialType": "0",
"Group": "FLOOR-1",
"ID": "3",
"Name": "Feya",
"Phone": "124"
},
{
"DialType": "0",
"Group": "FLOOR-0",
"ID": "4",
"Name": "Justa",
"Phone": "110"
},
{
"DialType": "0",
"Group": "",
"ID": "1",
"Name": "Lucy",
"Phone": "123"
}
]
}
}

Api contact add

56
HTTP API Manual for Access Control

Only POST method can be used for this function.

57
HTTP API Manual for Access Control

Example Request:
POST:
{
"target": "contact",
"action": "add",
"data": {
"num": 6,
"item": [
{
"DialType": "0",
"Group": "",
"ID": "0",
"Name": "Carol",
"Phone": "115"
},
{
"DialType": "0",
"Group": "",
"ID": "0",
"Name": "Eric",
"Phone": "115"
},
{
"DialType": "0",
"Group": "FLOOR-1",
"ID": "0",
"Name": "Feya",
"Phone": "126"
},
{
"DialType": "0",
"Group": "FLOOR-1",
"ID": "0",
"Name": "Leaf",
"Phone": "126"
},

58
HTTP API Manual for Access Control

{
"DialType": "0",
"Group": "",
"ID": "0",
"Name": "Lucy",
"Phone": "115"
},
{
"DialType": "0",
"Group": "FLOOR-1",
"ID": "0",
"Name": "Tony",
"Phone": "126"
}
]
}
}

Example Return:
{
"retcode": 0,
"action": "add",
"message": "OK",
"data": {
"num": 6,
"item": [
{
"Ret": 0,
"ID": "74",
"Name": "Carol",
"Phone": "115"
},
{
"Ret": 0,
"ID": "75",
"Name": "Eric",
"Phone": "115"
},
{
"Ret": 0,
"ID": "76",

59
HTTP API Manual for Access Control

"Name": "Feya",
"Phone": "126"
},
{
"Ret": 0,
"ID": "77",
"Name": "Leaf",
"Phone": "126"
},
{
"Ret": 0,
"ID": "78",
"Name": "Lucy",
"Phone": "115"
},
{
"Ret": 0,
"ID": "79",
"Name": "Tony",
"Phone": "126"
}
]
}
}

Api contact set

Only POST method can be used for this function. Example

Request:

60
HTTP API Manual for Access Control

POST:
{
"target": "contact",
"action": "set",
"data": {
"item": [
{
"ID": "1",
"Name": "Eric",
"Phone": "118",
"DialType": "0",
"Group": ""
},
{
"ID": "2",
"Name": "Tony",
"Phone": "116",
"DialType": "0",
"Group": "FLOOR-1"
}
]
}
}

Example Return:

61
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "set",
"message": "OK",
"data": {
"num": 2,
"item": [
{
"Ret": 0,
"ID": "1",
"Name": "Eric",
"Phone": "118"
},
{
"Ret": 0,
"ID": "2",
"Name": "Tony",
"Phone": "116"
}
]
}
}

Api contact del

Only POST method can be used for this function. Example

Request:

62
HTTP API Manual for Access Control

POST:
{
"target": "contact",
"action": "del",
"data": {
"item": [
{
"Name": "Carol"
},
{
"ID": "26"
},
{
"Phone": "126"
}
]
}
}

Example Return:

63
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "del",
"message": "OK",
"data": {
"num": 3,
"item": [
{
"Ret": 0,
"ID": "25",
"Name": "Carol",
"Phone": "115"
},
{
"Ret": 0,
"ID": "26",
"Name": "Eric",
"Phone": "115"
},
{
"Ret": 0,
"ID": "27",
"Name": "Feya",
"Phone": "126"
}
]
}
}

Api contact clear

The GET or POST method can be used for this function. Example

Request:
GET: /api/contact/clear

POST:
{
"target": "contact",
"action": "clear"
}

64
HTTP API Manual for Access Control

Example Return:
{
"retcode": 0
"action": "clear",
"message": "OK",
}

Api contact export

Param Description
filetype option param, default type csv
csv: csv file
xml: xml file
vcf: vcf file
Note: if contact is empty, it will return failed

The GET or POST method can be used for this function. Example

Request:
GET: /api/contact/export?filetype=csv

POST:
{
"target": "contact",
"action": "export",
"data": {
"filetype":"csv"
}
}

Example Return:
succeed: send csv file
failed:
{
"retcode": -1,
"action": "export",
"message": "Export Failed."
}

65
HTTP API Manual for Access Control

Api contact import

Only POST method can be used for this function. Example

Request&Return:

Api group

Param Description
ID Index
Name Group Name

Api group get

The GET or POST method can be used for this function. Example

Request:
GET: /api/group/get

POST:
{
"target": "group",
"action": "get",
}

Example Return:

66
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"ID": "12",
"Name": "FLOOR-1"
}
]
}
}

Api group add

Only POST method can be used for this function. Example

Request:
POST:
{
"target": "group",
"action": "add",
"data" : {
"item": [
{
"ID": "0",
"Name": "FLOOR2"
}
]
}
}

Example Return:

67
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "add",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Ret": 0,
"ID": "13",
"Name": "FLOOR2"
}
]
}
}

Api group set

Only POST method can be used for this function. Example

Request:
POST:
{
"target": "group",
"action": "set",
"data" : {
"item": [
{
"ID": "13",
"Name": "FLOOR-402"
}
]
}
}

Example Return:

68
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "set",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Ret": 0,
"ID": "13",
"Name": "FLOOR-402"
}
]
}
}

Api group clear

The GET or POST method can be used for this function. Example

Request:
GET: /api/contact/clear group

POST:
{
"target": "contact", group
"action": "clear"
}

Example Return:
{
"action": "clear",
"message": "OK",
"retcode": 0
}

69
HTTP API Manual for Access Control

Api call status

The GET or POST method can be used for this function. Example

Request:
GET: /api/call/status

POST:
{
"target": "call",
"action": "status"
}

Example Return:
{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"Status": "READY"
}
}

Api call dial

The GET or POST method can be used for this function. Example

Request:
GET: /api/call/dial?Phone=192.168.1.58&DisplayName=Justa

70
HTTP API Manual for Access Control

POST:
{
"target": "call",
"action": "dial",
"data" : {
"Phone": "192.168.1.58",
"DisplayName": "Justa"
}
}

Example Return:
{
"retcode": 0,
"action": "dial",
"message": "OK"
}

Api call hangup

The GET or POST method can be used for this function. Example

Request:
GET: /api/call/hangup

POST:
{
"target": "call",
"action": "hangup",
}

Example Return:
{
"retcode": 0,
"action": "hangup",
"message": "OK"
}

71
HTTP API Manual for Access Control

Api sip

Param Description
Account 1
Config.Account1.GENERAL.Enable 0 Disable
1 Enable
Config.Account1.SIP.Server SIP Server
Ex:192.168.1.115
Config.Account1.SIP.Port SIP Server Port
Ex:5060
Config.Account1.GENERAL.AuthName Sip Server Auth Name
Config.Account1.GENERAL.UserName Sip Server Register Name
Config.Account1.GENERAL.Pwd Sip Server Password
Config.Account1.GENERAL.DisplayName Remote Display Name
Account 2
Config.Account2.GENERAL.Enable 0 Disable
1 Enable
Config.Account2.SIP.Server SIP Server
Ex:192.168.1.115
Config.Account2.SIP.Port SIP Server Port
Ex:5060
Config.Account2.GENERAL.AuthName Sip Server Auth Name
Config.Account2.GENERAL.UserName Sip Server Register Name
Config.Account2.GENERAL.Pwd Sip Server Password
Config.Account2.GENERAL.DisplayName Remote Display Name

Api sip get

The GET or POST method can be used for this function. Example

Request:
GET: /api/sip/get

POST:
{
"target": "sip",
"action": "get"
}

Example Return:

72
HTTP API Manual for Access Control

{
"retcode": 0, "action": "get",
"message": "OK", "data": {
"Config.Account1.ANONYMOUS_CALL.Enable": "0",
"Config.Account1.ANONYMOUS_CALL.OffCode": "",
"Config.Account1.ANONYMOUS_CALL.OnCode": "",
"Config.Account1.ANONYMOUS_CALL.PrivacyHeaderValue": "id",
"Config.Account1.AUTO_ANSWER.Enable": "1",
"Config.Account1.GENERAL.AuthName": "",
"Config.Account1.GENERAL.DisplayName": "",
"Config.Account1.GENERAL.EditEnable": "",
"Config.Account1.GENERAL.Enable": "0", "Config.Account1.GENERAL.Label":
"", "Config.Account1.GENERAL.Pwd": "",
"Config.Account1.GENERAL.UserAgent": "",
"Config.Account1.GENERAL.UserName": "", "Config.Account1.NAT.Rport": "0",
"Config.Account1.NAT.UdpKeepEnable": "1",
"Config.Account1.NAT.UdpKeepInterval": "30",
"Config.Account1.OUTPROXY.BakPort": "5060",
"Config.Account1.OUTPROXY.BakServer": "",
"Config.Account1.OUTPROXY.DHCPOption": "0",
"Config.Account1.OUTPROXY.Enable": "0",
"Config.Account1.OUTPROXY.Port": "5060",
"Config.Account1.OUTPROXY.Server": "",
"Config.Account1.REJECT_ANONYMOUSCALL.Enable": "0",
"Config.Account1.REJECT_ANONYMOUSCALL.OffCode": "",
"Config.Account1.REJECT_ANONYMOUSCALL.OnCode": "",
"Config.Account1.SIP.ListenPortMax": "5062",
"Config.Account1.SIP.ListenPortMin": "5062",
"Config.Account1.SIP.Port": "5060",
"Config.Account1.SIP.Port2": "5060",
"Config.Account1.SIP.Server": "",
"Config.Account1.SIP.Server2": "",
"Config.Account1.SIP.TransType": "0",
"Config.Account1.STUN.Enable": "0",
"Config.Account1.STUN.Port": "3478",
"Config.Account1.STUN.Server": "",
"Config.Account2.ANONYMOUS_CALL.Enable": "0",
"Config.Account2.ANONYMOUS_CALL.OffCode": "",
"Config.Account2.ANONYMOUS_CALL.OnCode": "",

73
HTTP API Manual for Access Control

"Config.Account2.ANONYMOUS_CALL.PrivacyHeaderValue": "id",
"Config.Account2.AUTO_ANSWER.Enable": "1",
"Config.Account2.GENERAL.AuthName": "",
"Config.Account2.GENERAL.DisplayName": "",
"Config.Account2.GENERAL.EditEnable": "",
"Config.Account2.GENERAL.Enable": "0", "Config.Account2.GENERAL.Label":
"", "Config.Account2.GENERAL.Pwd": "",
"Config.Account2.GENERAL.UserAgent": "",
"Config.Account2.GENERAL.UserName": "", "Config.Account2.NAT.Rport": "0",
"Config.Account2.NAT.UdpKeepEnable": "1",
"Config.Account2.NAT.UdpKeepInterval": "30",
"Config.Account2.OUTPROXY.BakPort": "5060",
"Config.Account2.OUTPROXY.BakServer": "",
"Config.Account2.OUTPROXY.DHCPOption": "0",
"Config.Account2.OUTPROXY.Enable": "0",
"Config.Account2.OUTPROXY.Port": "5060",
"Config.Account2.OUTPROXY.Server": "",
"Config.Account2.REJECT_ANONYMOUSCALL.Enable": "0",
"Config.Account2.REJECT_ANONYMOUSCALL.OffCode": "",
"Config.Account2.REJECT_ANONYMOUSCALL.OnCode": "",
"Config.Account2.SIP.ListenPortMax": "5063",
"Config.Account2.SIP.ListenPortMin": "5063",
"Config.Account2.SIP.Port": "5060",
"Config.Account2.SIP.Port2": "5060",
"Config.Account2.SIP.Server": "",
"Config.Account2.SIP.Server2": "",
"Config.Account2.SIP.TransType": "0",
"Config.Account2.STUN.Enable": "0",
"Config.Account2.STUN.Port": "3478",
"Config.Account2.STUN.Server": ""
}
}

Api sip set

Only POST method can be used for this function. Example

Request:

74
HTTP API Manual for Access Control

POST:
{
"target": "sip",
"action": "set",
"data" : {
"Config.Account1.GENERAL.AuthName" : "130",
"Config.Account1.GENERAL.DisplayName": "130",
"Config.Account1.GENERAL.Enable": "1",
"Config.Account1.GENERAL.Label": "130",
"Config.Account1.GENERAL.Pwd": "130",
"Config.Account1.GENERAL.UserName":"130",
"Config.Account1.SIP.Port":"5060",
"Config.Account1.SIP.Server": "192.168.1.115"
}
}

Example Return:
{
"retcode": 0,
"action": "set",
"message": "OK"
}

Api sip status

The GET or POST method can be used for this function. Example

Request:
GET: /api/sip/status

POST:
{
"target": "sip",
"action": "status",
}

Example Return:

75
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"Account1": {
"UserName": "130",
"SipServer": "192.168.1.115",
"Status": "2"
},
"Account2": {
"UserName": "",
"SipServer": "",
"Status": "0"
}
}
}

Api dialreplace

Param Description
ID ID
Prefix number
Line 0 Auto
1 Account 1
2 Account 2
Replace1 number
Replace2 number
Replace3 number
Replace4 number
Replace5 number

Api dialreplace get

The GET or POST method can be used for this function. Example

Request:
GET: /api/dialreplace/get

76
HTTP API Manual for Access Control

POST:
{
"target": "dialreplace",
"action": "get"
}

Example Return:
{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"ID": "1",
"Line": "0",
"Prefix": "110",
"Replace1": "192.168.2.1",
"Replace2": "192.168.2.4",
"Replace3": "192.168.2.2",
"Replace4": "192.168.2.5",
"Replace5": "192.168.2.3"
}
]
}
}

Api dialreplace add

Only POST method can be used for this function. Example

Request:

77
HTTP API Manual for Access Control

POST:
{
"target": "dialreplace",
"action": "add",
"data" : {
"item": [
{
"ID": "1",
"Line": "0",
"Prefix" : "110",
"Replace1": "192.168.2.1",
"Replace2": "192.168.2.4",
"Replace3": "192.168.2.2",
"Replace4": "192.168.2.5",
"Replace5": "192.168.2.3"
}
]
}
}

Example Return:

{
"retcode": 0,
"action": "add",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Ret": 0,
"ID": "1",
"Prefix": "110"
}
]
}
}

Api dialreplace set

Only POST method can be used for this function.

78
HTTP API Manual for Access Control

Example Request:
POST:
{
"target": "dialreplace",
"action": "set",
"data" : {
"item": [
{
"ID": "1",
"Line": "0",
"Prefix" : "110",
"Replace1": "192.168.2.1",
"Replace2": "192.168.2.4",
"Replace3": "192.168.2.2",
"Replace4": "192.168.2.5",
"Replace5": "192.168.2.3"
}
]
}
}

Example Return:
{
"retcode": 0,
"action": "set",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Ret": 0,
"ID": "1",
"Prefix": "110"
}
]
}
}

Api dialreplace del

Only POST method can be used for this function.

79
HTTP API Manual for Access Control

Example Request:
POST:
{
"target": "dialreplace",
"action": "del",
"data" : {
"item": [
{
"ID": "1"
}
]
}
}

Example Return:
{
"retcode": 0,
"action": "del",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Ret": 0,
"ID": "1"
}
]
}
}

Api dialreplace clear

Example Request:
GET: /api/dialreplace/clear

POST:
{
"target": "dialreplace",
"action": "clear",
}

80
HTTP API Manual for Access Control

Example Return:
{
"retcode": 0,
"action": "clear",
"message": "OK"
}

Api dialreplace export

Example Request:
GET: /api/dialreplace/export

POST:
{
"target": "dialreplace",
"action": "export",
}

Example Return:

DialReplace.xml

Api dialreplace import

Only POST method can be used for this function. Example

Request&Return::

81
HTTP API Manual for Access Control

Api log

Param Description
Config.Settings.LOGLEVEL.Level log debug level
0 LOG_LEVEL_EMERG
1 LOG_LEVEL_ALERT
2 LOG_LEVEL_CRIT
3 LOG_LEVEL_ERR
4 LOG_LEVEL_WARNING
5 LOG_LEVEL_NOTICE
6 LOG_LEVEL_INFO
7 LOG_LEVEL_DEBUG

Api log get

The GET or POST method can be used for this function. Example

Request:
GET: /api/log/get

POST:
{
"target": "log",
"action": "get",
}

Example Return:

{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"Config.Settings.LOGLEVEL.Level": "3"
}
}

82
HTTP API Manual for Access Control

Api log set

Only POST method can be used for this function. Example

Request:
POST:
{
"target": "log",
"action": "set",
"data" : {
"Config.Settings.LOGLEVEL.Level": "7"
}
}

Example Return:
{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"Config.Settings.LOGLEVEL.Level": "7"
}
}

Api log export

Param Description
type export log type
log : default , application log(Android logcat or
Linux syslog)
kmsg: kernel log
log_debug: support android only

Example Request:
GET: /api/log/export?type=log

83
HTTP API Manual for Access Control

POST:
{
"target": "log",
"action": "export",
"data" : {
"type" : "log"
}
}

Example Return:

log.txt
kmsg.txt
log_debug.tar.gz

Api log clear

Param Description
type export log type
log : default , application log(Android logcat or
Linux syslog)
kmsg: kernel log
log_debug: support android only

Example Request:
GET: /api/log/clear?type=kmsg

POST:
{
"target": "log",
"action": "clear",
"data" : {
"type" : "kmsg"
}
}

Example Return:

84
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "clear",
"message": "OK"
}

Api calllog

Param Description
ID
Type 0 "All",
1 "Dialed",
2 "Received",
3 "Missed",
4 "Forwarded",
5 "Unknow",

Date
Time
Local Identity Sip Server
Name Remote DisplayName
Number Call Num

Api calllog get

Param Description
Type Optional , Default “All”
0 "All",
1 "Dialed",
2 "Received",
3 "Missed",
4 "Forwarded",
5 "Unknow",

Example Request:
GET: /api/calllog/get

85
HTTP API Manual for Access Control

POST:
{
"target": "calllog",
"action": "get"
}

Example Return:
{
"retcode": 0,
"action": "get",
"message": "OK",
"data": {
"num": 1,
"item": [
{
"Date": "2018-12-13",
"ID": "23",
"LocalIdentity": "[email protected]",
"Name": "192.168.1.48",
"Num": "[email protected]",
"Time": "05:55:59",
"Type": "Received"
}
]
}
}

Api calllog del

Param Description
ID string, index

Only POST method can be used for this function. Example

Request:

86
HTTP API Manual for Access Control

POST:
{
"target": "calllog",
"action": "del",
"data" : {
"ID" : "23"
}
}

Example Return:
{
"retcode": 0,
"action": "del",
"message": "OK"
}

Api calllog clear

Param Description
Type string
0 "All",
1 "Dialed",
2 "Received",
3 "Missed",
4 "Forwarded",
5 "Unknow",

The GET or POST method can be used for this function. Example

Request:
GET: /api/calllog/clear?type=Missed

87
HTTP API Manual for Access Control

POST:
{
"target": "calllog",
"action": "clear",
"data" : {
"Type" : "Missed"
}
}

Example Return:
{
"retcode": 0,
"action": "upgrade",
"message": "OK"
}

Api calllog export

The GET or POST method can be used for this function. Example

Request:
GET: /api/calllog/export

POST:
{
"target": "calllog",
"action": "export",
}

Example Return:
History.csv

88
HTTP API Manual for Access Control

Api doorlog

Param Description
ID
Type 0 “Unknow”,
1 "Card",
2 "Password",
3 "Public",
4 "Face",

Name
Status 0 Success
1 Failed
Code
Date
Time

Api doorlog get

The GET or POST method can be used for this function. Example

Request:
GET: /api/fe/upgrade /api/doorlog/get

POST:
{
"target": "doorlog",
"action": "get"
}

Example Return:
{
"retcode": 0,
"action": "upgrade",
"message": "OK"
}

89
HTTP API Manual for Access Control

Api doorlog del

Param Description
ID string, index

Only POST method can be used for this function. Example

Request:
POST:
{
"target": "calllog",
"action": "del",
"data" : {
"ID" : "1"
}
}

Example Return:
{
"retcode": 0,
"action": "del",
"message": "OK"
}

Api doorlog clear

The GET or POST method can be used for this function. Example

Request:
GET: /api/doorlog/clear

POST:
{
"target": "doorlog",
"action": "clear",
}

Example Return:

90
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "clear",
"message": "OK"
}

Api doorlog export

The GET or POST method can be used for this function. Example

Request:
GET: /api/calllog/export doorlog

POST:
{
"target": "calllog", doorlog
"action": "export",
}

Example Return:
DoorLog.xml

Api pcap status

The GET or POST method can be used for this function. Example

Request:
GET: /api/pcap/status

POST:
{
"target": "pcap",
"action": "status"
}

Example Return:

91
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "status",
"message": "OK",
"data": {
"FileSize": 0,
"Status": "stop"
}
}

Api pcap start

Param Description
type capature type, optional
auto auto stop (capture 60 second)
manual
filter pcap filter type, optional
more info see libpcap
default: “ip”
time capture time 1-180 , optional
default 60 second
only work on type == auto
size optional capture limit size, when reach size
limit it will auto stop
default: 1048576

The GET or POST method can be used for this function. Example

Request:
GET: /api//api/pcap/start

92
HTTP API Manual for Access Control

POST:
{
"target": "pcap",
"action": "start",
"data" : {
"type" : "auto",
"filter" : "ip",
"time": "180",
"size": "1048576"
}
}

Example Return:
{
"retcode": 0,
"action": "start",
"message": "OK",
"data": {
"filter": "ip",
"interface": "eth0",
"size": "1048576",
"time": "180",
"type": "auto"
}
}

Api pcap stop

The GET or POST method can be used for this function. Example

Request:
GET: /api/pcap/stop

POST:
{
"target": "pcap",
"action": "stop"
}

Example Return:

93
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "stop",
"message": "OK",
"data": {
"FileSize": "314407",
"Time": "9"
}
}

Api pcap export

The GET method can be used for this function. Example

Request:
GET: /api/pcap/export

Example Return:
phone.pcap

Api user info

The GET or POST method can be used for this function. Example

Request:

GET: http://device IP/api/user/info

POST:
{
"target": "user",
"action": "info"
}

Example Return:

94
HTTP API Manual for Access Control

{
"retcode": 0,
"action": "info",
"message":"OK",
"data": {
"DefaultUserId": 1
}

Api user get

The GET or POST method can be used for this function. Example

Request:

GET: http://device IP/api/user/get

POST:
{
"target": "user",
"action": "get"
"data": {
"SourceType" : "All"
}

95
HTTP API Manual for Access Control

Example Return:

"retcode": 0, "action":
"info",
"message":"OK", "data": {
"num": 1,
"item": [
{
"CardCode":
"2222",
"FaceUrl": "",
"ID": "2",
"LiftFloorNum":
"1;2",
"Name": "1111",
"PrivatePIN":
"2222",
"ScheduleRelay":
"1001-1",
"SourceType":
"1",
"Type": "0",
"UserID": "2",
"WebRelay": "1"
}
]
}

96
HTTP API Manual for Access Control

Api user add

The GET or POST method can be used for this function. Example

Request:

GET: http://device IP/api/user/add

POST:
{
"target": "user",
"action": "add"
"data": {
"item": [
{
"UserID": "2",
"CardCode":
"2222",
"FaceUrl": "",
"ID": "2",
"LiftFloorNum":
"1;2",
"Name":
"1111",
"PrivatePIN":
"2222",
"ScheduleRela
y": "1001-1",
"Type": "0",
"WebRelay":
"1"
}
]
}
}

97
HTTP API Manual for Access Control

Example Return:

{
"retcode": 1,
"action": "add",
"message": "OK"
}

Api user set

Only POST method can be used for this function.

Request:

POST:
{
"target": "user",
"action": "set"
"data": {
"item": [
{
"UserID": "5",
"CardCode":
"4321",
"FaceUrl": "",
"ID": "5",
"LiftFloorNum":
"1",
"Name":
"4321",
"PrivatePIN":
"44",
"ScheduleRela
y": "1001-1",
"Type": "0",
"WebRelay":
"1"
}
]
}
} 98
HTTP API Manual for Access Control

Example Return:

{
"retcode": 1,
"action": "set",
"message": "OK"
}

Api user scan

Only POST method can be used for this function.

Request:

POST:
{
"target": "user",
"action": "scan"
}

Example Return:

"retcode": 0,
"action": "scam",
"message": "OK"
"data": {
"RFCode":
"99D78D72"
}

99
HTTP API Manual for Access Control

Api user edit

This function do not support GET and POST method.

Api user del


Only POST method can be used for this function.

Request:

POST:
{
"target": "user",
"action": "del"
"data": {
"item": [
{
"ID": "4",
}
]
}
}

Example Return:

"retcode": 1,
"action": "del",
"message": "OK"
}
}

100
HTTP API Manual for Access Control

Api user clear

The GET or POST method can be used for this function. Example

Request:

GET: http://device IP/api/user/clear

POST:
{
"target": "user",
"action": "clear",
}

Example Return:

{
"retcode": 0,
"action":"clear",
"message":"OK",

Api user export

The GET or POST method can be used for this function. Example

Request:

GET: http://device IP/api/user/export

101
HTTP API Manual for Access Control

POST:
{
"target": "user",
"action": "export"
}

Example Return:

"retcode": 0,
"action": "export",
"message":"OK",
"data": {
"address":
"/download/UserData.tgz
"
}

Api user import

Only POST method can be used for this function.

Request:

POST:
{

Download UserData.tgz
http://device IP/download/UserData.tgz
http://another device IP /api/user/import

102
HTTP API Manual for Access Control

Example Return:

"retcode": 0,
"action": "import",
"message":"OK",
"data": {}
}

103

You might also like