You are on page 1of 431

Da

hu
aH
TT
P

API of HTTP Protocol Specification


AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

V2.89
2020-12-03
Cybersecurity Recommendations
Mandatory actions to be taken towards cybersecurity
Da

1. Change Passwords and Use Strong Passwords:


The number one reason systems get "hacked" is due to having weak or default passwords. It is
hu

recommended to change default passwords immediately and choose a strong password whenever
aH

possible. A strong password should be made up of at least 8 characters and a combination of special
characters, numbers, and upper and lower case letters.
TT

2. Update Firmware
As is standard procedure in the tech-industry, we recommend keeping NVR, DVR, and IP camera
P

firmware up-to-date to ensure the system is current with the latest security patches and fixes.
AP

"Nice to have" recommendations to improve your network security


1. Change Passwords Regularly
IV

Regularly change the credentials to your devices to help ensure that only authorized users are able to
2.

access the system.


89

2. Change Default HTTP and TCP Ports:


● Change default HTTP and TCP ports for systems. These are the two ports used to communicate and
fo

to view video feeds remotely.


● These ports can be changed to any set of numbers between 1025-65535. Avoiding the default ports
r1

reduces the risk of outsiders being able to guess which ports you are using.
00

3. Enable HTTPS/SSL:
Set up an SSL Certificate to enable HTTPS. This will encrypt all communication between your devices
M

and recorder.
EG

4. Enable IP Filter:
Enabling your IP filter will prevent everyone, except those with specified IP addresses, from accessing
A

the system.
Di

5. Change ONVIF Password:


st

On older IP Camera firmware, the ONVIF password does not change when you change the system's
credentials. You will need to either update the camera's firmware to the latest revision or manually
rib

change the ONVIF password.


ut

6. Forward Only Ports You Need:


● Only forward the HTTP and TCP ports that you need to use. Do not forward a huge range of numbers
io

to the device. Do not DMZ the device's IP address.


n

● You do not need to forward any ports for individual cameras if they are all connected to a recorder on
s.r

site; just the NVR is needed.


.o

7. Limit Features of Guest Accounts:


If your system is set up for multiple users, ensure that each user only has rights to features and functions
.

they need to use to perform their job.


8. UPnP:

Cybersecurity Recommendations I
● UPnP will automatically try to forward ports in your router or modem. Normally this would be a good
thing. However, if your system automatically forwards the ports and you leave the credentials defaulted,
you may end up with unwanted visitors.
● If you manually forwarded the HTTP and TCP ports in your router/modem, this feature should be
turned off regardless. Disabling UPnP is recommended when the function is not used in real
applications.
9. SNMP:
Da

Disable SNMP if you are not using it. If you are using SNMP, you should do so only temporarily, for
hu

tracing and testing purposes only.


10. Multicast:
aH

Multicast is used to share video streams between two recorders. Currently there are no known issues
involving Multicast, but if you are not using this feature, deactivation can enhance your network security.
TT

11. Check the Log:


P

If you suspect that someone has gained unauthorized access to your system, you can check the system
log. The system log will show you which IP addresses were used to login to your system and what was
AP

accessed.
IV

12. Physically Lock Down the Device:


Ideally, you want to prevent any unauthorized physical access to your system. The best way to achieve
2.

this is to install the recorder in a lockbox, locking server rack, or in a room that is behind a lock and key.
89

13. Connect IP Cameras to the PoE Ports on the Back of an NVR:


Cameras connected to the PoE ports on the back of an NVR are isolated from the outside world and
fo

cannot be accessed directly.


r1

14. Isolate NVR and IP Camera Network


The network your NVR and IP camera resides on should not be the same network as your public
00

computer network. This will prevent any visitors or unwanted guests from getting access to the same
network the security system needs in order to function properly.
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Cybersecurity Recommendations II
Foreword

Purpose
Da

Welcome to use API of HTTP protocol specification.


hu

Reader
aH

 API software development engineers


TT

 Project managers
P

 Product managers
AP

Safety Instructions
IV

The following categorized signal words with defined meaning might appear in the Manual.
2.

Signal Words Meaning


89

Indicates a high potential hazard which, if not avoided, will result in death
DANGER or serious injury.
fo
r1

Indicates a medium or low potential hazard which, if not avoided, could


WARNING result in slight or moderate injury.
00

Indicates a potential risk which, if not avoided, could result in property


M

CAUTION damage, data loss, lower performance, or unpredictable result.


EG

TIPS Provides methods to help you solve a problem or save you time.
A

Provides additional information as the emphasis and supplement to the


Di

NOTE
text.
st

Revision History
rib
ut

No. Version Revision Content Release Time


io

1 V2.40 Based on the old version. August 8, 2018


n

2 V2.60 Add find media file with TrafficCar info. September 12, 2018
s.r

3 V2.61 Add the "16 AI APIs " chapter. October 24, 2018
.o

4 V2.62 Add find media files with NonMotor info November 06, 2018
.

5 V2.63 Add close door and access control custom password November 27, 2018
6 V2.64 Add access control and video talk settings. December 12, 2018
7 V2.65 Add intelligent caps and resource usage info January 17, 2019

Foreword III
No. Version Revision Content Release Time
8 V2.66 Add people heat map, realtime trace, history trace info February 13, 2019
9 V2.67 Add subscribe heat map raw data April 18, 2019
10 V2.68 Add get traffic snap event info record May 15, 2019
11 V2.69 Add export traffic blacklist/redlist record May 20, 2019
12 V2.70 Add privacy masking May 29, 2019
Da

13 V2.71 Add get the max and min temperature values June 3, 2019
hu

14 V2.72 Add smart motion detection config June 27, 2019


aH

15 V2.73 Add ecrypted download media file July 16, 2019


Adjust Camera Image, Exposure, Backlight, White
TT

16 V2.74 Balance, Day-Night, Zoom and Focus, Lighting, Video July 25, 2019
in Options config.
P

17 V2.75 Add adjust angle and depth field August 13, 2019
AP

18 V2.76 Add subscribe vehicles distribution data. September 10, 2019


IV

19 V2.77 Add Seek Find Logs October 18, 2019


2.

20 V2.78 Add face recognition event handler config October 30, 2019
89

21 V2.79 Add RemoveEx Traffic BlackList/RedList record . December 9, 2019


22 V2.80 Add Get GPS Status December 12, 2019
fo

23 V2.81 Add Get Last Event Info February 28, 2020


r1

24 V2.82 Add Radar Adaptor March 23, 2020


00

Add Radar Adaptor getCapsEx


25 V2.83 May 20, 2020
Delete Radar Adaptor getCaps
M

26 V2.84 Add AccessControl getLockStatus June 12, 2020


EG

27 V2.85 Add GlobalDeviceParam SupportGlobalDeviceParam July 2, 2020


A

Add ObjectPlacementDetection
28 V2.86 November 5,2020
ObjectRemovalDetection
Di

Add Radar Adaptor addRadarLinkSD, delRadarLinkSD


st

29 V2.87 November 6,2020


Add VideoInAnalyse getTemplateRule
rib

30 V2.88 Add LensManager, resetAngle November 26,2020


ut

31 V2.89 Add config to Radar Adaptor December 3, 2020


io

Privacy Protection Notice


n
s.r

As the device user or data controller, you might collect personal data of other such as face,
fingerprints, car plate number, Email address, phone number, GPS and so on. You need to be in
.o

compliance with the local privacy protection laws and regulations to protect the legitimate rights and
.

interests of other people by implementing measures include but not limited to: providing clear and
visible identification to inform data subject the existence of surveillance area and providing related
contact.

Foreword IV
About the Manual

 The Manual is for reference only. If there is inconsistency between the Manual and the
actual product, the actual product shall prevail.
 We are not liable for any loss caused by the operations that do not comply with the Manual.
 The Manual would be updated according to the latest laws and regulations of related
regions. For detailed information, see the paper manual, CD-ROM, QR code or our official
Da

website. If there is inconsistency between paper manual and the electronic version, the
hu

electronic version shall prevail.


 All the designs and software are subject to change without prior written notice. The product
aH

updates might cause some differences between the actual product and the Manual. Please
contact the customer service for the latest program and supplementary documentation.
TT

 There still might be deviation in technical data, functions and operations description, or
errors in print. If there is any doubt or dispute, please refer to our final explanation.
P

 Upgrade the reader software or try other mainstream reader software if the Manual (in PDF
AP

format) cannot be opened.


 All trademarks, registered trademarks and the company names in the Manual are the
IV

properties of their respective owners.


Please visit our website, contact the supplier or customer service if there is any problem
2.


occurred when using the device.
89

 If there is any uncertainty or controversy, please refer to our final explanation.


fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Foreword V
Table of Contents
Cybersecurity Recommendations ........................................................................................................... I
Da

Foreword .................................................................................................................................................. III


1 Overview................................................................................................................................................. 1
hu

2 References........................................................................................................................................... 2
3 Definitions ........................................................................................................................................... 3
aH

3.1 Abbreviations................................................................................................................................. 3
3.2 Syntax Convention ........................................................................................................................ 3
TT

3.3 API Request Format...................................................................................................................... 3


P

3.4 Server Response Format .............................................................................................................. 4


3.5 Authentication................................................................................................................................ 5
AP

3.6 Conventions .................................................................................................................................. 6


IV

3.6.1 Channels ............................................................................................................................. 6


4 General APIs........................................................................................................................................ 7
2.

4.1 APIs of RTSP ................................................................................................................................ 7


89

4.1.1 Get Real-Time Stream ........................................................................................................ 7


4.1.2 Get Playback Stream .......................................................................................................... 7
fo

4.1.3 Get File Stream................................................................................................................... 8


4.1.4 Get MJPG Stream .............................................................................................................. 8
r1

4.2 Common ........................................................................................................................................ 9


00

4.2.1 Get and Set Configure ........................................................................................................ 9


4.3 Audio ........................................................................................................................................... 10
M

4.3.1 Get Audio Input Channel Numbers................................................................................... 10


4.3.2 Get Audio Output Channel Numbers ................................................................................ 10
EG

4.3.3 Post Audio Stream .............................................................................................................11


A

4.3.4 Get Audio Stream ............................................................................................................. 12


4.4 Snapshot ..................................................................................................................................... 13
Di

4.4.1 Snap.................................................................................................................................. 13
st

4.4.2 Get a Snapshot ................................................................................................................. 14


rib

4.4.3 Subscribe to Snapshot ..................................................................................................... 15


4.5 Video Attributes ........................................................................................................................... 16
ut

4.5.1 Get Max Extra Stream Numbers ...................................................................................... 16


io

4.5.2 Get Encode Capability ...................................................................................................... 17


4.5.3 Get Encode Config Capability .......................................................................................... 17
n

4.5.4 Encode of Media ............................................................................................................... 20


s.r

4.5.5 Encode of Region Interested ............................................................................................ 24


.o

4.5.6 Channel Title ..................................................................................................................... 25


4.5.7 Get Video Input Channels Device Supported .................................................................. 26
.

4.5.8 Get Video Output Channels Device Supported ................................................................ 26


4.5.9 Get Max Remote Input Channels ..................................................................................... 27
4.5.10 Video Standard ............................................................................................................... 27
4.5.11 Video Widget ................................................................................................................... 27

Table of Contents VI
4.5.12 Get Video Input Capability .............................................................................................. 30
4.5.13 Get Coordinates of Current Window .............................................................................. 33
4.5.14 Set Coordinates of Current Window ............................................................................... 34
4.5.15 Video Out ........................................................................................................................ 34
4.5.16 Smart Code ..................................................................................................................... 36
4.5.17 Get Decoder Caps .......................................................................................................... 36
4.5.18 [Config] PrivacyMasking ................................................................................................. 37
Da

4.5.19 Get Privacy Masking ....................................................................................................... 39


4.5.20 Set Privacy Masking ....................................................................................................... 40
hu

4.5.21 Goto Privacy Masking ..................................................................................................... 41


4.5.22 Delete Privacy Masking .................................................................................................. 41
aH

4.5.23 Clear Privacy Masking .................................................................................................... 42


4.5.24 Get Privacy Masking Rect .............................................................................................. 42
TT

4.5.25 [Config] SmartMotionDetect ........................................................................................... 43


P

4.5.26 [Config] LAEConfig ......................................................................................................... 44


4.5.27 Enable/Disable all privacy masking covers .................................................................... 45
AP

4.5.28 Get enable/disable state of all privacy masking covers ................................................. 46


IV

4.6 System ........................................................................................................................................ 46


4.6.1 General ............................................................................................................................. 46
2.

4.6.2 Get Current Time .............................................................................................................. 47


89

4.6.3 Set Current Time............................................................................................................... 47


4.6.4 Locales.............................................................................................................................. 48
fo

4.6.5 Get Language Capability .................................................................................................. 49


4.6.6 Language .......................................................................................................................... 50
r1

4.6.7 Get Client Access Filter .................................................................................................... 50


00

4.6.8 Auto Maintain .................................................................................................................... 51


4.6.9 Holiday Management ........................................................................................................ 52
M

4.6.10 Get Device Type ............................................................................................................. 53


EG

4.6.11 Get Hardware Version..................................................................................................... 53


4.6.12 Get Serial Number of Device .......................................................................................... 53
A

4.6.13 Get Machine Name ......................................................................................................... 54


4.6.14 Get System Information .................................................................................................. 54
Di

4.6.15 Get Vendor Information .................................................................................................. 54


st

4.6.16 Get Software Information................................................................................................ 54


rib

4.6.17 Get Version of Onvif ....................................................................................................... 55


4.6.18 Get Version of HTTP API ................................................................................................ 55
ut

4.6.19 Get Device Class ............................................................................................................ 55


io

4.6.20 Onvif Service Authorization ............................................................................................ 55


4.6.21 Backup of Config ............................................................................................................ 56
n

4.6.22 Restore the Config .......................................................................................................... 56


s.r

4.6.23 Restore except the Config .............................................................................................. 57


.o

4.6.24 Reboot ............................................................................................................................ 57


4.6.25 Shutdown ........................................................................................................................ 57
.

4.6.26 FactoryReset .................................................................................................................. 57


4.6.27 Get Tracing Code of Device ........................................................................................... 58
4.7 Network ....................................................................................................................................... 58
4.7.1 Get Network Interfaces ..................................................................................................... 58

Table of Contents VII


4.7.2 Network Basic Config ....................................................................................................... 59
4.7.3 PPPoE .............................................................................................................................. 60
4.7.4 DDNS ................................................................................................................................ 61
4.7.5 Email ................................................................................................................................. 64
4.7.6 WLan................................................................................................................................. 65
4.7.7 Scan Wlan Devices........................................................................................................... 66
4.7.8 UPnP................................................................................................................................. 67
Da

4.7.9 Get UPnP Status .............................................................................................................. 68


4.7.10 NTP ................................................................................................................................. 68
hu

4.7.11 RTSP ............................................................................................................................... 69


4.7.12 Alarm Server ................................................................................................................... 69
aH

4.8 Motion Detection ......................................................................................................................... 70


4.8.1 Motion Detection Settings................................................................................................. 70
TT

4.9 Event ........................................................................................................................................... 76


P

4.9.1 Event Handler ................................................................................................................... 76


4.9.2 Alarm Event ...................................................................................................................... 80
AP

4.9.3 Alarm Out .......................................................................................................................... 81


IV

4.9.4 Get Alarm Input Channels ................................................................................................ 82


4.9.5 Get Alarm Output Channels.............................................................................................. 82
2.

4.9.6 Get States of Alarm Input Channels ................................................................................. 82


89

4.9.7 Get States of Alarm Output Channels .............................................................................. 82


4.9.8 Video Blind Event ............................................................................................................. 83
fo

4.9.9 Video Loss Event .............................................................................................................. 84


4.9.10 Login Failure Event ......................................................................................................... 84
r1

4.9.11 Storage Not Exist Event .................................................................................................. 85


00

4.9.12 Storage Access Failure Event ........................................................................................ 86


4.9.13 Storage Low Space Event .............................................................................................. 87
M

4.9.14 Net Abort Event............................................................................................................... 87


EG

4.9.15 IP Conflict Event ............................................................................................................. 88


4.9.16 Get Channels Event Happened ...................................................................................... 89
A

4.9.17 Subscribe to Event Message .......................................................................................... 89


4.9.18 Get Capability of Event Management............................................................................. 92
Di

4.9.19 Net Alarm Event .............................................................................................................. 93


st

4.9.20 Set Net Alarm State ........................................................................................................ 94


rib

4.9.21 GetSupportedEvents ...................................................................................................... 94


4.10 PTZ............................................................................................................................................ 95
ut

4.10.1 PTZ Config ...................................................................................................................... 95


io

4.10.2 Get PTZ Protocol List ..................................................................................................... 96


4.10.3 Get PTZ Capability of Current Protocol .......................................................................... 96
n

4.10.4 Get PTZ Status ............................................................................................................... 98


s.r

4.10.5 PTZ Control .................................................................................................................... 98


.o

4.10.6 Preset............................................................................................................................ 102


4.10.7 Tour ............................................................................................................................... 103
.

4.10.8 Scan .............................................................................................................................. 105


4.10.9 Pattern .......................................................................................................................... 106
4.10.10 Pan.............................................................................................................................. 107
4.10.11 PTZ Auto Movement ................................................................................................... 108

Table of Contents VIII


4.10.12 PTZ Restart ................................................................................................................ 109
4.10.13 PTZ Reset ....................................................................................................................110
4.10.14 OSD Menu ...................................................................................................................110
4.11 Record ...................................................................................................................................... 111
4.11.1 Get Capability of Recording ........................................................................................... 111
4.11.2 Record Config ................................................................................................................112
4.11.3 Record Mode..................................................................................................................113
Da

4.11.4 Media Global ..................................................................................................................114


4.11.5 Find Media Files.............................................................................................................115
hu

4.11.6 Find media files with FaceDetection info .......................................................................117


4.11.7 Find media files with FaceRecognition info .................................................................. 120
aH

4.11.8 Find media files with HumanTrait info........................................................................... 123


4.11.9 Find media files with TrafficCar info .............................................................................. 127
TT

4.11.10 Find media files with IVS info...................................................................................... 130


P

4.11.11 Find media files with NonMotor info ............................................................................ 132


4.11.12 Download Media File with the File Name ................................................................... 134
AP

4.11.13 Download Media File between Times ......................................................................... 135


IV

4.11.14 Encrypted Download Media File with the File Name .................................................. 135
4.12 User management .................................................................................................................. 136
2.

4.12.1 Get Information of a Particular User ............................................................................. 136


89

4.12.2 Get Information of All Users.......................................................................................... 136


4.12.3 Get Information of All Active Users ............................................................................... 137
fo

4.12.4 Get Information of a Particular Group .......................................................................... 137


4.12.5 Get Information of All Groups ....................................................................................... 137
r1

4.12.6 Add a New User ............................................................................................................ 138


00

4.12.7 Delete a User ................................................................................................................ 138


4.12.8 Modify User Information ............................................................................................... 138
M

4.12.9 Modify User's Password ............................................................................................... 139


EG

4.12.10 Manager Modify Common User's Password .............................................................. 139


4.13 Log .......................................................................................................................................... 140
A

4.13.1 Find Logs ...................................................................................................................... 140


4.13.2 Clear All the Logs.......................................................................................................... 141
Di

4.13.3 Backup Logs ................................................................................................................. 141


st

4.13.4 Seek Find Logs ............................................................................................................. 142


rib

4.14 Upgrader ................................................................................................................................. 143


4.14.1 Strat to Upgrade ........................................................................................................... 143
ut

4.14.2 Get Upgrade State ........................................................................................................ 143


io

4.14.3 Set upgrader url ............................................................................................................ 144


4.15 Wiper ....................................................................................................................................... 144
n

4.15.1 Move Continuously ....................................................................................................... 144


s.r

4.15.2 Stop Move ..................................................................................................................... 144


.o

4.15.3 Move Once ................................................................................................................... 144


4.16 Security ................................................................................................................................... 145
.

4.16.1 Set User Login Authentication Policy ........................................................................... 145


5 Camera APIs ...................................................................................................................................... 146
5.1 Image ........................................................................................................................................ 146
5.1.1 Brightness, Contrast and Saturation .............................................................................. 146

Table of Contents IX
5.1.2 Sharpness ....................................................................................................................... 147
5.1.3 Flip, Mirror and Rotate90 ................................................................................................ 148
5.2 Exposure ................................................................................................................................... 149
5.2.1 Exposure Config ............................................................................................................. 149
5.3 Backlight .................................................................................................................................... 151
5.3.1 Backlight Config .............................................................................................................. 151
5.4 White Balance ........................................................................................................................... 152
Da

5.4.1 White Balance Config ..................................................................................................... 152


5.5 Day-Night .................................................................................................................................. 153
hu

5.5.1 Day-Night Config ............................................................................................................ 153


5.6 Zoom and Focus ....................................................................................................................... 154
aH

5.6.1 Adjust Focus ................................................................................................................... 154


5.6.2 Adjust Focus Continuously ............................................................................................. 154
TT

5.6.3 Auto Focus ...................................................................................................................... 155


P

5.6.4 Get Focus Status ............................................................................................................ 155


5.6.5 Zoom Config ................................................................................................................... 156
AP

5.6.6 Focus Config ................................................................................................................... 156


IV

5.7 Lighting ...................................................................................................................................... 158


5.7.1 Lighting Config ................................................................................................................ 158
2.

5.8 Video in Options ........................................................................................................................ 159


89

5.8.1 Video in Options Config .................................................................................................. 159


6 Storage APIs .................................................................................................................................... 169
fo

6.1 Storage Devices ........................................................................................................................ 169


6.1.1 Get Hard Disk Information .............................................................................................. 169
r1

6.1.2 Get All the Names of Storage Devices ........................................................................... 169


00

6.1.3 Get Storage Device Information ..................................................................................... 169


6.1.4 Get Storage Capability ................................................................................................... 170
M

6.1.5 Format Camera SD-Card ............................................................................................... 170


EG

6.2 NAS ........................................................................................................................................... 170


6.2.1 NAS Information ............................................................................................................. 170
A

6.3 Storage Point ............................................................................................................................ 172


6.3.1 Record Storage Point ..................................................................................................... 172
Di

6.3.2 Storage Group ................................................................................................................ 173


st

6.4 SDEncrypt ................................................................................................................................. 174


rib

6.4.1 Encrypt SD Card ............................................................................................................. 174


6.4.2 Decrypt SD Card............................................................................................................. 175
ut

6.4.3 Clear SD Card Password ............................................................................................... 175


io

6.4.4 Modify SD Card Password ............................................................................................. 175


6.4.5 Get SD Card Operate Error Policy ................................................................................. 176
n

6.4.6 Storage Health Alarm Settings ....................................................................................... 176


s.r

7 Display APIs ..................................................................................................................................... 178


.o

7.1 GUI ............................................................................................................................................ 178


7.1.1 GUISet ............................................................................................................................ 178
.

7.2 Split Screen ............................................................................................................................... 179


7.2.1 Split Screen Mode .......................................................................................................... 179
7.3 Moniter Tour .............................................................................................................................. 180
7.3.1 Moniter Tour .................................................................................................................... 180

Table of Contents X
7.3.2 Enable Tour ..................................................................................................................... 181
7.3.3 Monitor Collection ........................................................................................................... 181
8 Video Analyse APIs ........................................................................................................................... 183
8.1 Video Analyse ........................................................................................................................... 183
8.1.1 Get Video Analyse Capability ......................................................................................... 183
8.1.2 Video Analyse Global...................................................................................................... 184
8.1.3 Video Analyse Rule......................................................................................................... 185
Da

8.1.4 Get Last Event Info ......................................................................................................... 187


8.1.5 [Config] GlobalDeviceParam .......................................................................................... 188
hu

8.1.6 getTemplateRule ............................................................................................................. 189


8.2 Number of People ..................................................................................................................... 190
aH

8.2.1 Video Widget Number Status ......................................................................................... 190


8.2.2 Get Heat Map Information .............................................................................................. 191
TT

8.2.3 Get People Heat Map Information .................................................................................. 192


P

8.2.4 Subscribe People Realtime Trace Information ............................................................... 193


8.2.5 Get People Histroy Trace Information ............................................................................ 195
AP

8.2.6 Subscribe Heat Map Raw Data ...................................................................................... 196


IV

8.2.7 Clear statistics in time section ........................................................................................ 197


8.3 FishEye ..................................................................................................................................... 197
2.

8.3.1 Get FishEye Capability ................................................................................................... 197


89

8.3.2 FishEye Setting............................................................................................................... 198


8.4 CrowdDistriMap......................................................................................................................... 199
fo

8.4.1 Get Channel Caps .......................................................................................................... 199


8.4.2 Subscribe to Realtime Crowd Stat ................................................................................. 199
r1

8.4.3 Get Current Crowd Stat .................................................................................................. 201


00

8.5 Intelligent ................................................................................................................................... 201


8.5.1 Get Intelligent Caps ........................................................................................................ 201
M

8.5.2 Subscribe Resource Usage Info..................................................................................... 203


EG

9 Intelligent Traffic APIs ....................................................................................................................... 205


9.1 Traffic Snap ............................................................................................................................... 205
A

9.1.1 Get the Specific Parking Space Status .......................................................................... 205


9.1.2 Open Strobe ................................................................................................................... 205
Di

9.1.3 Open/Close Unlicensed Vehicle Detection ..................................................................... 206


st

9.1.4 Snap................................................................................................................................ 206


rib

9.2 Traffic Parking ........................................................................................................................... 207


9.2.1 Get All Status of Parking Spaces ................................................................................... 207
ut

9.2.2 Parking Space Light State .............................................................................................. 207


io

9.2.3 Set Order State ............................................................................................................... 209


9.2.4 Set Light State ................................................................................................................ 209
n

9.2.5 [Config] Parking Space Access Filter Setting ................................................................. 209


s.r

9.2.6 Set OverLine State ......................................................................................................... 210


.o

9.3 Traffic Record Import Export ......................................................................................................211


9.3.1 Traffic BlackList / RedList ................................................................................................211
.

9.3.2 Traffic Flow...................................................................................................................... 212


9.3.3 Traffic Snap Event Info ................................................................................................... 213
9.4 Vehicles Distribution .................................................................................................................. 214
9.4.1 Subscribe Vehicles Distribution Data ............................................................................. 214

Table of Contents XI
10 Thermography and Radiometry APIs ............................................................................................ 217
10.1 Thermography Manager ......................................................................................................... 217
10.1.1 Get Capability of Thermography .................................................................................. 217
10.1.2 Thermography Options ................................................................................................. 218
10.1.3 Get ExternSystem Information ..................................................................................... 220
10.1.4 Get Information of Preset Mode ................................................................................... 220
10.1.5 Get Optimized Region Information ............................................................................... 221
Da

10.1.6 Enable Shutter .............................................................................................................. 221


10.1.7 Fix Focus ...................................................................................................................... 222
hu

10.1.8 Do Flat Field Correction................................................................................................ 222


10.2 Radiometry .............................................................................................................................. 222
aH

10.2.1 Get Capability of Radiometry........................................................................................ 222


10.2.2 Heat Image Thermometry............................................................................................. 223
TT

10.2.3 Thermometry Rule ........................................................................................................ 225


P

10.2.4 Heat Image Temper Event ............................................................................................ 227


10.2.5 Get Temperature of Particular Point ............................................................................. 228
AP

10.2.6 Get Temperature of Particular Condition ...................................................................... 229


IV

10.2.7 Query Temperature Information.................................................................................... 229


10.2.8 Subscribe to Temperature Information ......................................................................... 230
2.

10.2.9 Subscribe to Radiometry Data ..................................................................................... 231


89

10.2.10 To Fetch Radiometry Data .......................................................................................... 232


10.2.11 Get FireWarning Config .............................................................................................. 232
fo

10.2.12 Set FireWarning Config .............................................................................................. 233


10.2.13 Get FireWarningMode Config ..................................................................................... 234
r1

10.2.14 Set FireWarningMode Config ..................................................................................... 234


00

10.2.15 Get Current Hot Cold Spot ......................................................................................... 234


10.2.16 Heat Image Temper PreAlarm Event.......................................................................... 235
M

11 Access Control APIs ...................................................................................................................... 237


EG

11.1 Door ......................................................................................................................................... 237


11.1.1 Open Door..................................................................................................................... 237
A

11.1.2 Get Door Status ............................................................................................................ 237


11.1.3 Close Door .................................................................................................................... 237
Di

11.1.4 Capture Fingerprint ....................................................................................................... 238


st

11.1.5 Capture face picture...................................................................................................... 238


rib

11.2 Access Control ........................................................................................................................ 239


11.2.1 Add Access Control Custom Password ........................................................................ 239
ut

11.2.2 Modify Access Control Custom Password .................................................................... 240


io

11.2.3 Delete Access Control Custom Password .................................................................... 240


11.2.4 Find Access Control Custom Password ....................................................................... 241
n

11.2.5 Get the Total Number of Records of Access Control Custom Password ..................... 243
s.r

11.2.6 Get Access Control Caps.............................................................................................. 244


.o

11.2.7 Get Lock Status ............................................................................................................ 245


11.2.8 [Config] Access Control General Setting ...................................................................... 245
.

11.2.9 [Config] Access Control Setting .................................................................................... 247


11.2.10 [Config] Wiegand Setting ............................................................................................ 251
11.2.11 [Config] Access Time Schedule Setting ...................................................................... 252
11.2.12 [Config] Special Day Group Setting ............................................................................ 254

Table of Contents XII


11.2.13 [Config] Special Days Schedule Setting ..................................................................... 255
11.2.14 [Config] MeasureTemperature Setting ........................................................................ 256
11.2.15 [Config] CitizenPictureCompare Setting ..................................................................... 259
12 Intelligent Building APIs ................................................................................................................. 287
12.1 Video Talk ................................................................................................................................ 287
12.1.1 Subscribe Video Talk Status ......................................................................................... 287
12.1.2 Unsubscribe Video Talk Status ..................................................................................... 287
Da

12.1.3 Invite Server on Video Talk ........................................................................................... 288


12.1.4 Cancel the Video Talk ................................................................................................... 288
hu

12.1.5 Answer the Invitation .................................................................................................... 288


12.1.6 Refuse to Answer the Video Talk Invitation .................................................................. 289
aH

12.1.7 Hang Up ........................................................................................................................ 289


12.2 Video Talk Log......................................................................................................................... 289
TT

12.2.1 Query Video Talk Log ................................................................................................... 289


P

12.3 Announcement Record ........................................................................................................... 290


12.3.1 Insert Record ................................................................................................................ 290
AP

12.4 Alarm Record .......................................................................................................................... 290


IV

12.4.1 Query Alarm Record ..................................................................................................... 290


12.4.2 Query Access Control Alarm Record ............................................................................ 291
2.

13 DVR Custom APIs............................................................................................................................ 305


89

13.1 File Finder ............................................................................................................................... 305


13.1.1 Create a File Finder ...................................................................................................... 305
fo

13.1.2 Create a Motion File Finder .......................................................................................... 306


13.1.3 Get the File Information Found by the Finder .............................................................. 307
r1

13.1.4 Stop the Finder ............................................................................................................. 307


00

13.1.5 Get Bound Files ............................................................................................................ 308


13.2 BandLimit ................................................................................................................................ 308
M

13.2.1 Get Bandwidth Limit State ............................................................................................ 308


EG

13.3 Record Files Protection........................................................................................................... 309


13.3.1 Add Protection .............................................................................................................. 309
A

13.3.2 Cancel Protection ......................................................................................................... 309


13.3.3 Remove Protection ....................................................................................................... 310
Di

13.3.4 DownloadFile ................................................................................................................ 310


st

13.4 Get Daylight .............................................................................................................................311


rib

14 Comm .............................................................................................................................................. 312


14.1 Coaxial Control IO ................................................................................................................... 312
ut

14.1.1 Control White Light or Speaker .................................................................................... 312


io

14.2 Pir Alarm .................................................................................................................................. 312


14.2.1 Configure Pir Parameter ............................................................................................... 312
n

15 Other APIs ...................................................................................................................................... 317


s.r

15.1 Discover Devices .................................................................................................................... 317


.o

15.1.1 Discover Devices on Internet........................................................................................ 317


15.2 Flashlight ................................................................................................................................. 317
.

15.2.1 Flashlight Config ........................................................................................................... 317


15.3 Open Platform ......................................................................................................................... 319
15.3.1 Application Start and Stop ............................................................................................ 319
15.3.2 Install Application .......................................................................................................... 319

Table of Contents XIII


15.3.3 Update Application and License ................................................................................... 320
15.3.4 Uninstall Application ..................................................................................................... 321
15.3.5 Download Application Log ............................................................................................ 322
15.4 LensFunc ................................................................................................................................ 323
15.4.1 getCaps......................................................................................................................... 323
15.4.2 adjustAngleContinuously .............................................................................................. 323
15.4.3 stopAdjustingAngle ....................................................................................................... 324
Da

15.4.4 adjustDepthField ........................................................................................................... 324


15.4.5 adjustDepthFieldContinuously ...................................................................................... 324
hu

15.4.6 getDepthFieldStatus ..................................................................................................... 325


15.4.7 autoAdjustDepthField ................................................................................................... 325
aH

15.5 positionManager ..................................................................................................................... 326


15.5.1 getGPSStatus ............................................................................................................... 326
TT

15.6 Radar Adaptor ......................................................................................................................... 326


P

15.6.1 getCaps......................................................................................................................... 326


15.6.2 getCapsEx .................................................................................................................... 327
AP

15.6.3 getStatus ....................................................................................................................... 327


IV

15.6.4 calculateRealSize ......................................................................................................... 327


15.6.5 attachAlarmPointInfo .................................................................................................... 328
2.

15.6.6 getLinkSDState ............................................................................................................. 329


89

15.6.7 manualLocate ............................................................................................................... 330


15.6.8 startRadarCalibration .................................................................................................... 330
fo

15.6.9 addRadarLinkSD .......................................................................................................... 331


15.6.10 delRadarLinkSD.......................................................................................................... 331
r1

15.7 TemperCustom ........................................................................................................................ 332


00

15.7.1 Set Environment Temperature ...................................................................................... 339


15.8 GpsControl .............................................................................................................................. 340
M

15.8.1 getCaps......................................................................................................................... 340


EG

15.8.2 GPS config .................................................................................................................... 340


16 AI APIs .............................................................................................................................................. 342
A

16.1 Video Analyse APIs ................................................................................................................. 342


16.1.1 People Counting ........................................................................................................... 342
Di

16.1.2 FaceRecognitionServer ................................................................................................ 350


st

16.1.3 Video Analyse Event ..................................................................................................... 376


rib

16.2 Intelligent Traffic APIs ............................................................................................................. 384


16.2.1 Traffic Record ............................................................................................................... 384
ut

16.2.2 Intelligent Traffic Event ................................................................................................. 387


io

16.2.3 Traffic Flow.................................................................................................................... 392


16.3 Access Control APIs................................................................................................................ 394
n

16.3.1 Access User .................................................................................................................. 394


s.r

16.3.2 Access control............................................................................................................... 409


.o
.

Table of Contents XIV


1 Overview
This document specifies the HTTP-based application programming interface of video products.
The HTTP-based interface provides the functionality for requesting snapshot and media stream,
Da

controlling camera functions (for example, PTZ and focus), and getting and setting internal
parameter values.
hu

The video products serve as a server. The client sends requests to server, and then server handles
aH

requests and returns resources accordingly.


TT
P
AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Overview 1
[1] RFC 2616 Hypertext Transfer Protocol-HTTP/1.1
2 References

[2] RFC 2617 HTTP Authentication: Basic and Digest Access Authentication
Da

[3] RFC 3986 Uniform Resource Identifiers (URI) Generic Syntax


hu

[4] RFC 2326 Real Time Streaming Protocol (RTSP)


aH
TT
P
AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

References 2
3 Definitions
3.1 Abbreviations
Da

The following abbreviations are used throughout this document.


hu

Application Programming Interface. In the document, it especially presents


API
application programming interface of video products.
aH

3.2 Syntax Convention


TT

 In URL syntax and in descriptions of API parameters, text in italic within angle brackets
P

denotes content that should be replaced with either a value or a string. When replacing the
AP

text string, the angle brackets must also be replaced. For example, <server> in URL syntax
is replaced with the IP number of server, e.g., 192.168.1.108.
IV

 String shown in bold face denotes a brief explanatory note of the string close to it.
Name-value pair in square brackets denotes content that is optional. For example,
2.


"http ://<server>/cgi-bin/snapshot.cgi[?channel=1]" can be like this
89

"http ://<server>/cgi-bin/snapshot.cgi".
 The API syntax must follow the standard of URI. (RFC 3986: Uniform Resource Identifiers
fo

(URI) Generic Syntax); that is, spaces and other reserved characters (e.g, ":", "/", "?", "@",
r1

";", "=", "+", ",", "$", "&") within a name-value pair should be replaced with %< ASCII hex>.
For example, the blank should be replaced with %20.
00

 To describe the range of a variable, we use some symbols such as "[]" and "{}". For
example, "[0-100]" denotes an integer not less than 0 and not larger than 100. "{0, 1, 2, 3}"
M

denotes the valid value of an integer among 0, 1, 2 and 3.


EG

 "[]" following a string denotes an array. The index is an integer and starts from 0. For
example, "Snap[channel]" may be "Snap[0]" "Snap[0]" etc.
A

 The variable may be different types: string, integer, bool or float. Integer is 32 bits. The
Di

range of bool is "true" and "false".


"R/O" in parameters means this parameter is required or not, "R"means required,
st


"O"means optional.
rib

3.3 API Request Format


ut
io

This section defines the syntax and semantics for APIs.


n

<protocol>://<server><abs_path>[?query]
s.r

protocol: URL scheme for the particular request. The http and https protocols are both supported in
.o

this specification. So "http", as most of the APIs' default protocol except several RTSP APIs, can be
.

replaced by "https".
server: Server could be "hostname[:port]". The hostname can be IP address or the fully qualified
domain name of an IP device. The port is the port number of server listening for TCP connections.
If the port is not given, the default port is assumed. For HTTP, the default port is 80. For HTTPS, the
default port is 443.

Definitions 3
abs_path: The Request-URI for the resources is abs_path. The abs_path in this specification is
most often of the form "/cgi-bin/*.cgi".
query: The query field is a string of information to be interpreted by the resource. It consists of
resource-related parameters. And it must be listed in name-value pair syntax
(p1=v1&p2=v2&…&pn=vn).
For example: http://192.168.1.108/cgi-bin/snapshot.cgi?channel=1
Da

3.4 Server Response Format


hu

The server uses the standard HTTP status codes.


aH

Return:
HTTP/1.1 <HTTP code> <HTTP text>\r\n
TT

With the following HTTP code and meanings


P

Table 3-1
AP

HTTP code HTTP text Description


The request has succeeded. The requested
IV

200 OK
resource will be returned in the HTTP text.
The request had bad syntax or was inherently
2.

400 Bad Request


impossible to be satisfied.
89

The request requires user authentication or the


401 Unauthorized
authorization has been refused.
fo

The user does not have the right to access the


403 Forbidden
r1

service.
The server has not found anything matching the
00

404 Not Found


request.
The server encountered an unexpected condition
M

500 Internal Server Error


that prevented it from fulfilling the request.
EG

501 Not Implemented The server has not implemented the service.
A

If the HTTP code is 200, means the API execute success, and the response data in http body
( maybe multipart ) can be a multiline key=value data, or a json object, or just a line with a word
Di

"OK".
st

Example: success respose with multiline key=value


rib

HTTP/1.1 200 OK
Server: xxx
ut

Content-Length: <length>
io

status.Focus=0.5
n

status.Zoom=0.5
s.r


.o

Example: success respose with a word "OK"


.

HTTP/1.1 200 OK
Server: xxx
Content-Length: <length>

OK

Definitions 4
If the HTTP code is not 200, means the API execute failed, and the response data in http body
maybe empty, or just two line, first line is a word "Error"to indicate error happened, the second line
contain error detail.
Example: request does not fit with syntax.
HTTP/1.1 404 Not Found
Server: xxxx
Example: Request spells wrong.
Da

HTTP/1.1 400 Bad Request


hu

Server: xxx
Content-Length: <length>
aH

Error
TT

Bad Request!
Example: If the request fits with syntax but an error occurs while the server handles it, the response
P

would like this:


AP

HTTP/1.1 500 Internal Server Error


IV

Server: xxx
Content-Length: <length>
2.

Error
89

Internal Server Error!


fo

3.5 Authentication
r1

Video products support either basic authentication or digest authentication, see RFC 2617 for detail.
00

If the http request sent by client does not provide valid "Authorization" header information, video
M

products would return HTTP status code 401 and some information for authentication, then client
should calculate authentication information according RFC 2617, and sent request again with
EG

authentication information using “Authorization” header. Video products return the required resource
only if authorization information correct.
A

For example:
Di

1. When basic authentication fails, response is:


st

HTTP/1.1 401 Unauthorized


rib

WWW-Authenticate: Basic realm="XXXXXX"


The client encodes the username and password with base64, and then sends it to server. A valid
ut

Authorization like this:


io

Authorization: Basic VXZVXZ


n

2. When digest authentication fails, response is:


HTTP/1.1 401 Unauthorized
s.r

WWW-Authenticate: Digest realm="DH_00408CA5EA04",


.o

nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad", stale=FALSE, qop="auth"


.

The client calculates the digest authorization using information like username, password, nonce,
HTTP method and URI with MD5, and then sends it to server.
For example:

Definitions 5
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001,
cnonce="0a4f113b", qop="auth",
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",
uri="/cgi-bin/magicBox.cgi?action=getLanguageCaps",
response="65002de02df697e946b750590b44f8bf"
Da

3.6 Conventions
hu
aH

3.6.1 Channels
TT

For requests containing the param ‘channel’ like :


P

http://<server>/cgi-bin/mjpg/video.cgi[?channel=<ChannelNo>
AP

ChannelNo: integer, must starts from 1. Default is 1 if not present. But for response, the ‘ChannelNo’
should start from 0. In other words, the request channel 1 equals response channel 0.
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Definitions 6
4
The APIs specified in this section are supported by all video products.
General APIs

4.1 APIs of RTSP


Da
hu

4.1.1 Get Real-Time Stream


aH

Get real-time media stream APIs use RTSP protocol, please refer to RFC 2326 for detail. The rtsp
service default port is 554. The IP Camera supports both TCP and UDP transmission forms. It also
TT

supplies basic authentication and digest authentication ways. The authentication process is similar with
P

"3.5 Authentication".
AP

The rtsp url parameters format is in following table. If the stream does not exist or not enabled, it will
response with error result.
IV

URL rtsp://<server>:[port]/cam/realmonitor
2.

Method DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN, ...


89

URL Params ( key=value format in URL )


Name Type R/O Description Example
fo

The video channel index which starts from 1, 1


channel int O
default 1 if not specified.
r1

The stream type, include main stream and extra 0


00

stream. The extra stream counts can be obtained


in "4.5.1 Get Max Extra Stream Numbers". It can
M

subtype int O be :
EG

0 : main stream
1 : extra stream 1
A

2 : extra stream 2
URL Example
Di

rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=1
st
rib

4.1.2 Get Playback Stream


ut

It's similar with "4.1.1 Get Real-Time Stream". Except there are parameters "starttime" and
io

"endtime".
n

URL rtsp://<server>:[port]/cam/playback
s.r

Method DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN, ...


URL Params ( key=value format in URL )
.o

Name Type R/O Description Example


.

The video channel index which starts 1


channel int O
from 1, default 1 if not specified.
starttime string R The playback begin time 2012_09_15_12_37_05
endtime string O The playback end time 2012_09_15_18_34_14
URL Example

General APIs 7
rtsp://192.168.1.108:554/cam/playback?channel=1&starttime=2012_09_15_12_37_05&endtime=2012_
09_15_18_34_14

4.1.3 Get File Stream


It's similar with "4.1.1 Get Real-Time Stream". The filename with absolute path of file stream to get
is place in rtsp url.
Da

URL rtsp://<server>:[port]/<path to filename>


hu

Method DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN, ...


URL Params ( key=value format in URL )
aH

Name Type R/O Description Example


URL Example
TT

rtsp://192.168.1.108:554//mnt/sd/2015-09-16/001/dav/20/20.32.08-20.32.28[M][0@0][0].dav
P

4.1.4 Get MJPG Stream


AP

Get a video stream encoded by mjpg ( motion jpeg ).


IV

Request URL http://<server>/cgi-bin/mjpg/video.cgi


2.

Method GET
89

Request Params ( key=value format in URL )


Name Type R/O Description Example
fo

The video channel index which starts from 1, 1


channel int O
default 1 if not specified.
r1

The stream type, default 0 if not specified. It can be 0


00

the following value:


subtype int O 0-Main Stream
M

1-Extra Stream 1
EG

2-Extra Stream 2
Request Example
A

http://192.168.1.108/cgi-bin/mjpg/video.cgi?channel=1&subtype=0
Di

Response Params ( multipart, binary in body )


st

<binary data> : JPEG image data


rib

Response Example
HTTP/1.1 200 OK
ut

Server: Device/1.0
io

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


n
s.r

--<boundary>
Content-Type: image/jpeg
.o

Content-Length:<image size>
.

<JPEG image data>


--<boundary>
Content-Type: image/jpeg
Content-Length:<image size>

General APIs 8
<JPEG image data>
--<boundary>

4.2 Common
Da

4.2.1 Get and Set Configure


hu

 Get Configure
aH

Get configure detail by name. Each configure name has it’s specific configure detail. Please refer to
configure detail APIs in later chapters.
TT

Request URL http://<server>/cgi-bin/configManager.cgi?action=getConfig


P

Method GET
AP

Request Params ( key=value format in URL )


Name Type R/O Description Sample
IV

name string R The name of the configure SmartEncode


2.

Request Example
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SmartEncode
89
fo

Response Params ( key=value format in body )


Name Type R/O Description Sample
r1

table object R The configure table object.


00

The configure detail of the requested


configure name. Each configure
M

+<config name> string/object/object[] R name has it’s specific configure


detail. Please refer to configure detail
EG

apis in later chapters.


A

Response Example
table.SmartEncode.Enable=true
Di

table.SmartEncode.Extra[0]=true
st

table.SmartEncode.Extra[1]=false
rib

 Set Configure
ut

Set configure detail by name. Each configure name has it’s specific configure detail. Please refer to
io

configure detail APIs in later chapters.


n

Request URL http://<server>/cgi-bin/configManager.cgi?action=setConfig


s.r

Method GET
Request Params ( key=value format in URL )
.o

Name Type R/O Description Sample


.

The configure detail of the configure name.


string/o
+<config Each configure name has it’s specific
bject/ob R
name> configure detail. Please refer to configure
ject[]
detail apis in later chapters.
Request Example

General APIs 9
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SmartEncode.Enable=true&SmartEn
code.Extra[0]=true&SmartEncode.Extra[1]=false

Response Params ( OK in body )


Response Example
OK
Da

4.3 Audio
hu
aH

4.3.1 Get Audio Input Channel Numbers


TT

Get audio input channel number.


P

Request URL http://<server>/cgi-bin/devAudioInput.cgi?action=getCollect


AP

Method GET
Request Params ( key=value format in URL )
IV

Name Type R/O Description Example


Request Example
2.

http://192.168.1.108/cgi-bin/devAudioInput.cgi?action=getCollect
89

Response Params ( key=value format in body )


fo

Name Type R/O Description Example


r1

audio input channel number minus 1. For example, 1


result int R
return 1 means there are 2 audio input channels.
00

Response Example
M

result=1
EG

4.3.2 Get Audio Output Channel Numbers


A

Get audio output channel number.


Di

Request URL http://<server>/cgi-bin/devAudioOutput.cgi?action=getCollect


st

Method GET
rib

Request Params ( key=value format in URL )


Name Type R/O Description Example
ut

Request Example
io

http://192.168.1.108/cgi-bin/devAudioOutput.cgi?action=getCollect
n
s.r

Response Params ( key=value format in body )


Name Type R/O Description Example
.o

audio output channel number minus 1. For example, 1


result int R
.

return 1 means there are 2 audio output channels.


Response Example
result=1

General APIs 10
4.3.3 Post Audio Stream
Table 4-1
http://<server>/cgi-bin/audio.cgi?action=postAudio&<paramName>=<paramValue>[&
Syntax
<paramName>=<paramValue>…]
Method POST
Da

Description Post audio.


Example for single part
hu

The URL of transmit a single part, channel 1 audio stream(encoded with G.711 A-law)
is:
aH

http://192.168.1.108/cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=
1
TT

example:
POST /cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1 HTTP/1.1
P

Content-Type: Audio/G.711A
AP

Content-Length: 9999999
IV

<Audio data>
2.

<Audio data>
89

Example Example for multipart


The URL of transmit a multipart, channel 1 audio stream(encoded with G.711 A-law) is:
fo

http://192.168.1.108/cgi-bin/audio.cgi?action=postAudio&httptype=multipart&channel=
r1

1
00

example:
M

POST /cgi-bin/audio.cgi?action=postAudio&httptype=multipart&channel=1 HTTP/1.1


Content-Type: multipart/x-mixed-replace; boundary=<boundary>
EG

--<boundary>
Content-Type: Audio/G.711A
A

Content-Length: 800
Di
st

<Audio data>
rib

--<boundary>
Success
OK
ut

Return
Parameters in URL:
io

Comment
The paramName and paramValue are in the table below.
n

Appendix A: Parameters in URL


s.r

ParamName ParamValue type Description


.o

singlepart: HTTP content is a continuous flow of audio packets


.

httptype string multipart: HTTP content type is multipart/x-mixed-replace, and


each audio packet ends with a boundary string
channel integer The audio channel index which starts from 1.

Appendix B: Audio Encode Type

General APIs 11
MIME Description
Audio/PCM PCM
Audio/ADPCM ADPCM
Audio/G.711A G.711 A Law
Audio/G.711Mu G.711 Mu Law
Audio/G.726 G.726
Audio/G.729 G.729
Da

Audio/MPEG2 MPEG2
Audio/AMR AMR
hu

Audio/AAC AAC
aH

4.3.4 Get Audio Stream


TT

Table 4-2
P

http://<server>/cgi-bin/audio.cgi?action=getAudio&<paramName>=<paramValue>[&<
Syntax
AP

paramName>=<paramValue>…]
Method GET
IV

Description Get audio.


Example for single part
2.

The URL of Request a single part, channel 1 audio stream(encoded with G.711 A-law)
89

is:
http://192.168.1.108/cgi-bin/audio.cgi?action=getAudio&httptype=singlepart&channel=
fo

1
r1

If the request was successful, the server returns a continuous flow of audio packets.
00

The content type is only set at the beginning of the connection.


Return:
M

HTTP Code: 200 OK


EG

Content-Type: Audio/G.711A
Body:
A

<Audio data>
Di

<Audio data>
Example
st

Example for multipart


rib

The URL of Request a multipart, channel 1 audio stream(encoded with G.711 A-law) is:
ut

http://192.168.1.108/cgi-bin/audio.cgi?action=getAudio&httptype=multipart&channel=1
io

If the request was successful, the server returns a continuous flow of audio packets.
n

The content type is "multipart/x-mixed-replace" and each audio packet ends with a
s.r

boundary string.
Return:
.o

HTTP Code: 200 OK


.

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


--<boundary>
Content-Type: Audio/G.711A
Content-Length: 800

General APIs 12
<Audio data>
--<boundary>
Success
OK
Return
Parameters in URL:
Comment
The paramName and paramValue are in the table below.
Da

Appendix:

ParamName ParamValue type Description


hu

httptype string singlepart: HTTP content is a continuous flow of audio packets


aH

multipart: HTTP content type is multipart/x-mixed-replace, and


each audio packet ends with a boundary string
channel integer The audio channel index which starts from 1.
TT
P

4.4 Snapshot
AP

4.4.1 Snap
IV
2.

 Get snap config


89

Table 4-3
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Snap
fo

Method GET
r1

Description Get snap config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Snap
00

table.Snap[0].HolidayEnable=false
table.Snap[0].TimeSection[0][0]=6 00:00:00-23:59:59
M

table.Snap[0].TimeSection[0][1]=0 00:00:00-23:59:59
EG

table.Snap[0].TimeSection[0][2]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[0][3]=0 00:00:00-23:59:59
A

table.Snap[0].TimeSection[0][4]=0 00:00:00-23:59:59
Di

Success table.Snap[0].TimeSection[0][5]=0 00:00:00-23:59:59


Return table.Snap[0].TimeSection[1][0]=6 00:00:00-23:59:59
st

table.Snap[0].TimeSection[1][1]=0 00:00:00-23:59:59
rib

table.Snap[0].TimeSection[1][2]=0 00:00:00-23:59:59
table.Snap[0].TimeSection[1][3]=0 00:00:00-23:59:59
ut

table.Snap[0].TimeSection[1][4]=0 00:00:00-23:59:59
io

table.Snap[0].TimeSection[1][5]=0 00:00:00-23:59:59
n


s.r

Response format:
table. Snap[channelNo].TimeSection[weekday][configNo]=1 00:00:00-23:59:59
.o

channelNo: integer, array index starts from 0, which means video channel (equals to
Comment
.

video channel index -1, and so 0 means channel 1).


weekday: range is [0—7] (Sunday — Saturday, Holiday).
configNo: the index of time section config. There are many time sections each day.
 Set snap config

General APIs 13
Table 4-4
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set snap config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Snap[0].TimeSection
Example
[0][0]=1%2012:00:00-18:00:00
Da

Success
OK
Return
hu

In table below,
aH

ch: integer, array index starts from 0, which means video channel (equals to video
Comment channel index -1, and so 0 means channel 1).
wd: week day index, range is [0—6] (Sunday — Saturday).
TT

ts: time section index, starts from 0.


P

Appendix:
AP

ParamName ParamValue type Description


IV

wd (week day) range is [0 — 7] (Sunday —


Saturday, Holiday)
2.

ts (time section) range is [0 — 23], it's time


89

section table index.


Format: mask hh:mm:ss-hh:mm:ss
fo

Mask: [0—4294967295], hh: [0—24], mm: [0—


r1

59], ss: [0—59]


Snap[ch].TimeSection[wd][ts] string
Mask indicates record type by bits:
00

Bit0: regular snapshot


Bit1: motion detection snapshot
M

Bit2: alarm snapshot


EG

Bit3: card snapshot


Bit6- POS record
A

Bit4,Bit4,Bit7~Bit31-reserved。
Di

4.4.2 Get a Snapshot


st
rib

Table 4-5
Syntax http://<server>/cgi-bin/ snapshot.cgi[?channel=<ChannelNo>]
ut

Method GET
io

Description Get a snapshot of a video channel.


n

To get a snapshot of video channel 1, the URL can be


s.r

Example http://192.168.1.108/cgi-bin/snapshot.cgi or
http://192.168.1.108/cgi-bin/snapshot.cgi?channel=1
.o

Success
Image of jpg format.
.

Return
Comment ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.

General APIs 14
4.4.3 Subscribe to Snapshot
Table 4-6
http://<server>/cgi-bin/snapManager.cgi?action=attachFileProc&Flags[0]=Event&Event
Syntax s=[<eventCode>,<eventCode>...][&channel=<ChannelNo>][&heartbeat=<Heartbeat
>]
Method GET
Da

Description Subscribe pictures when event of code eventCode happens.


hu

http://192.168.1.108/cgi-bin/snapManager.cgi?action=attachFileProc&Flags[0]=Event&
Example
Events=[VideoMotion%2CVideoLoss]&heartbeat=5
aH

--<boundary>\r\n
Content-Type: text/plain\r\n
TT

Content-Length: <data length>\r\n


Events[0].Code=TrafficJunction
P

Events[0].CountInGroup=1
AP

Events[0].IndexInGroup=1
Events[0].Lane=1
IV

Events[0].Data.PTS= 42949485818.0
2.

Events[0].TrafficCar.PlateNumber=Z A12345
Events[0].TrafficCar. DeviceAddress=Hangzhou
89

Success ……
Return Events[1].Code=TrafficJunction
fo

……
r1

--<boundary>
Content-Type: image/jpeg
00

Content-Length:<image size>
M

<JPEG image data>


--<boundary>
EG

Content-Type: text/plain
Content-Length:<data length>
A

Heartbeat
Di

--<boundary>
st
rib
ut
io
n
s.r
.o
.

General APIs 15
ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
Heartbeat: integer,range is [1,60],unit is second.If the URL contains this parameter,
and the value is 5, it means every 5 seconds the device should send the heartbeat
message to the client,the heartbeat meaage is the string "Heartbeat".
eventCode: it can be any one of the standard codes defined in DHIIF.
eventCode includes:
VideoMotion: motion detection event
Da

VideoLoss: video loss detection event


VideoBlind: video blind detection event.
hu

AlarmLocal: alarm detection event.


TrafficJunction: vehicle passing event
aH

TrafficRetrograde: retrograde event


TrafficParking: illegal parking event
TT

TrafficJam: traffic congestion event


P

TrafficThrow: throw something out of the car event


Comment TrafficPedestrain: pedestrain enter traffic lane(driverway) event
AP

TrafficParkingSpaceParking: a vehicle in the parking space event


IV

TrafficParkingSpaceNoParking: no vehicle in the parking space event


TrafficParkingSpaceOverLine: a vehicle over the parking line event
2.

TrafficManualSnap: manual snapshot event


89

TrafficSuspiciousCar: when the vehicle is in the blacklist, it wiil produce this event.
FaceRecognition: face recognition event.
fo

Also, the eventCode can be All


All means all kinds of the eventcode.
r1
00

Parameters in Response:
GroupID: string, the ID of the snapshot event
M

CountInGroup: integer, the number of the snapshots


EG

IndexInGroup: integer, the index of the snapshots. For example, the CountInGroup is
3, the IndexInGroup is 1,it means there are 3 pictures in this snapshot event, and this is
A

the first picture.


Di

4.5 Video Attributes


st
rib

4.5.1 Get Max Extra Stream Numbers


ut

Table 4-7
io

http://<server>/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExtraStre
Syntax
n

am
s.r

Method GET
Description Get max extra stream count.
.o

http://192.168.1.108/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExt
Example
.

raStream
Success
table.MaxExtraStream=1
Return
Comment MaxExtraStream: max extra stream numbers. It can be 1, 2 or 3.

General APIs 16
4.5.2 Get Encode Capability
Table 4-8
Syntax http://<server>/cgi-bin/encode.cgi?action=getCaps
Method GET
Description Get encode capabilities.
Da

Example http://192.168.1.108/cgi-bin/encode.cgi?action=getCaps
Success caps.PlaybackCompressSplitNumList[0]=1
hu

Return caps.PlaybackCompressSplitNumList[1]=2
caps.PlaybackCompressSplitNumList[2]=4
aH

caps.PreviewMode=SplitSnap
caps.VideoEncodeDevices[0].CoverAreaPercent=100
TT

caps.VideoEncodeDevices[0].CoverCount=4
caps.VideoEncodeDevices[0].LadenBitrate=162201600
P

caps.VideoEncodeDevices[0].MaxCIFPFrameSize=40
AP

caps.VideoEncodeDevices[0].MaxExtraStream=1
caps.VideoEncodeDevices[0].MinCIFPFrameSize=7
IV

caps.VideoEncodeDevices[0].RecordIndividualResolution=true
2.

caps.VideoEncodeDevices[0].SupportIndividualResolution=true
caps.VideoEncodeDevices[0].TitleCount=4
89

Comment —
fo

4.5.3 Get Encode Config Capability


r1

Table 4-9
00

http://<server>/cgi-bin/encode.cgi?action=getConfigCaps[&channel=<ChannelNo>&<p
Syntax
M

aramName>=<paramValue>&<paramName>=<paramValue>...]
Method GET
EG

Description Get encode config capabilities.


A

http://192.168.1.108/cgi-bin/encode.cgi?action=getConfigCaps&channel=1&Encode[0].
Example
MainFormat[0].Video.Width=1920&Encode[0].MainFormat[0].Video.Height=1080
Di

headMain.Video.BitRateOptions=448,2560
st

headMain.Video.CompressionTypes=H.264,MJPG
rib

headMain.Video.FPSMax=25
headMain.Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF
ut

Success headExtra.Video.BitRateOptions=80,448
io

Return headExtra.Video.CompressionTypes=H.264,MJPG
headExtra.Video.FPSMax=25
n

headExtra.Video.ResolutionTypes=D1,CIF
s.r

headSnap.Video.CompressionTypes=H.264,MJPG
headSnap.Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF
.o
.

General APIs 17
Parameters in URL:
ChannelNo: integer,video channel index which starts from 1.it is a optional parameter, if
it is not present in the URL, the value of the channelno will be regarded as 1.
The description of <paramName> and <paramValue> is the same as 4.5.5(Set encode
config).
Parameters in Response:
headMain= caps[Channel].MainFormat[RecordType]
Da

headExtra = caps[Channel].ExtraFormat[ExtraStream]
headSnap = caps[Channel].SnapFormat[SnapType]
hu

Channel: integer, array index starts from 0, which means video channel (equals to video
aH

channel index ChannelNo -1, and so 0 means channel 1).


Comment
RecordType:
TT

0 = regular record
P

1 = motion detection record


2 = alarm record
AP

ExtraStream:
IV

0 = extra stream 1
1 = extra stream 2
2.

2 = extra stream 3
89

SnapType:
0 = regular snapshot
fo

1 = motion detection snapshot


2 = alarm snapshot
r1

Appendix A: Encode Config Capabilities


00

Field in response Value range Description


M

Before comma is minimum bit rate. (kbps), after comma is


EG

maximum bit rate.(kbps)


BitRateOptions string
BitRateOptions=80,448
A

80 is the minimum bitrates, 448 is maximum.


Di

To video, it contains all supported video compression types,


separated by comma. Range is {MPEG4, MPEG2, MPEG1,
st

MJPG, H.263, H.264, H.265, SVAC2}.


rib

CompressionTypes string To audio, it contains all supported audio compression types,


separated by comma.
ut

Range is {PCM, ADPCM, G.711A, G.711Mu, G.726, G.729,


io

MPEG2, AMR, SVAC}


n

FPSMax integer Maximum FPS.


It contains all supported video resolutions.
s.r

ResolutionTypes string
Range is in below Resolution list.
.o

Appendix B: Video Resolution


.

Fixed Resolution Name Size in PAL Size in NTSC


"D1" 704 x 576 704 x 480
"HD1" 352 x 576 352 x 480
"BCIF"/"2CIF" 704 x 288 704 x 240

General APIs 18
Fixed Resolution Name Size in PAL Size in NTSC
"CIF" 352 x 288 352 x 240
"QCIF" 176 x 144 176 x 120
"NHD" 640 x 360 —
"VGA" 640 x 480 —
"QVGA" 320 x 240 —
"SVCD" 480 x 480 —
Da

"QQVGA" 160 x 128 —


"SVGA" —
hu

800 x 592
"SVGA1" 800 x 600 —
aH

"WVGA" 800 x 480 —


"FWVGA" 854 x 480 —
TT

"DVGA" 960 x 640 —


"XVGA" 1024 x 768 —
P

"WXGA" 1280 x 800 —


AP

"WXGA2" 1280 x 768 —


"WXGA3" 1280 x 854 —
IV

"WXGA4" 1366 x 768 —


2.

"SXGA" 1280 x 1024 —


"SXGA+" 1400 x 1050 —
89

"WSXGA" 1600 x 1024 —


"UXGA" —
fo

1600 x 1200
"WUXGA" 1920 x 1200 —
r1

"ND1" 240 x 192 —


"720P" —
00

1280 x 720
"1080P" 1920 x 1080 —
M

"QFHD" 3840 x 2160 —


"1_3M", "1280x960" —
EG

1280 x 960 (1.3 Mega Pixels)


"2_5M", "1872x1408" 1872 x 1408 (2.5 Mega Pixels) —
A

"5M", "3744x1408" 3744 x 1408 (5 Mega Pixels) —


"3M", "2048x1536" —
Di

2048 x 1536 (3 Mega Pixels)


"5_0M", "2432x2048" 2432 x 2048 (5 Mega Pixels) —
st

"1_2M", "1216x1024" 1216 x 1024 (1.2 Mega Pixels) —


rib

"1408x1024" 1408 x 1024 (1.5 Mega Pixels) —


"3296x2472" 3296 x 2472 (8 Mega Pixels) —
ut

"5_1M", "2560x1920" 2560 x 1920 (5 Mega Pixels) —


io

"960H", 960 x 576 960 x 480


n

"DV720P" 960 x 720 —


"2560x1600" —
s.r

2560 x 1600 (4 Mega Pixels)


"2336x1752" 2336 x 1752 (4 Mega Pixels) —
.o

"2592x2048" 2592 x 2048 —


.

"2448x2048" 2448 x 2048 —


"1920x1440" 1920x1440 —
"2752x2208" 2752x2208 —
"3840x2160" 3840x2160 —
"4096x2160" 4096x2160 —

General APIs 19
Fixed Resolution Name Size in PAL Size in NTSC
"3072x2048" 3072x2048 —

Appendix C: Audio Compression Type

Field in response Value range Description


It contains all supported audio compression types, separated by
CompressionTypes string comma. Range is {PCM, ADPCM, G.711A, G.711Mu, G.726,
Da

G.729, MPEG2, AMR, SVAC}


hu

4.5.4 Encode of Media


aH

 Get encode config


TT

Table 4-10
Syntax
P

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Encode
Method GET
AP

Description Get video encode config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Encode
IV

table.Encode[0].MainFormat[0].Audio.Bitrate=64
2.

table.Encode[0].MainFormat[0].Audio.Channels[0]=0
89

table.Encode[0].MainFormat[0].Audio.Compression=G.711A
table.Encode[0].MainFormat[0].Audio.Depth=16
fo

table.Encode[0].MainFormat[0].Audio.Frequency=8000
table.Encode[0].MainFormat[0].Audio.Mode=0
r1

table.Encode[0].MainFormat[0].Audio.Pack=DHAV
00

table.Encode[0].MainFormat[0].AudioEnable=true
table.Encode[0].MainFormat[0].Video.resolution=1920x1080
M

table.Encode[0].MainFormat[0].Video.BitRate=4096
EG

table.Encode[0].MainFormat[0].Video.BitRateControl=CBR
table.Encode[0].MainFormat[0].Video.Compression=H.264
A

table.Encode[0].MainFormat[0].Video.CustomResolutionName=1080P
table.Encode[0].MainFormat[0].Video.FPS=18
Di

Success
table.Encode[0].MainFormat[0].Video.GOP=36
Return
st

table.Encode[0].MainFormat[0].Video.Height=1080
rib

table.Encode[0].MainFormat[0].Video.Pack=DHAV
table.Encode[0].MainFormat[0].Video.Profile=High
ut

table.Encode[0].MainFormat[0].Video.Quality=4
io

table.Encode[0].MainFormat[0].Video.QualityRange=6
table.Encode[0].MainFormat[0].Video.SVCTLayer=1
n

table.Encode[0].MainFormat[0].Video.Width=1920
s.r

table.Encode[0].MainFormat[0].Video.Priority=0
.o

table.Encode[0].MainFormat[0].VideoEnable=true
table.Encode[0].MainFormat[1].Audio.Bitrate=64
.

table.Encode[0].MainFormat[1].Audio.Channels[0]=0
table.Encode[0].MainFormat[1].Audio.Compression=G.711A
table.Encode[0].MainFormat[1].Audio.Depth=16
table.Encode[0].MainFormat[1].Audio.Frequency=8000

General APIs 20
table.Encode[0].MainFormat[1].Audio.Mode=0
table.Encode[0].MainFormat[1].Audio.Pack=DHAV
table.Encode[0].MainFormat[1].AudioEnable=true
table.Encode[0].MainFormat[1].Video.resolution=1920x1080
table.Encode[0].MainFormat[1].Video.BitRate=4096
table.Encode[0].MainFormat[1].Video.BitRateControl=CBR
table.Encode[0].MainFormat[1].Video.Compression=H.264
Da

table.Encode[0].MainFormat[1].Video.CustomResolutionName=1080P
table.Encode[0].MainFormat[1].Video.FPS=18
hu

table.Encode[0].MainFormat[1].Video.GOP=36
aH

table.Encode[0].MainFormat[1].Video.Height=1080
table.Encode[0].MainFormat[1].Video.Pack=DHAV
table.Encode[0].MainFormat[1].Video.Profile=High
TT

table.Encode[0].MainFormat[1].Video.Quality=4
P

table.Encode[0].MainFormat[1].Video.QualityRange=6
AP

table.Encode[0].MainFormat[1].Video.SVCTLayer=1
table.Encode[0].MainFormat[1].Video.Width=1920
IV

table.Encode[0].MainFormat[1].Video.Priority=0
table.Encode[0].MainFormat[1].VideoEnable=true
2.

table.Encode[0].MainFormat[2].Audio.Bitrate=64
89

table.Encode[0].MainFormat[2].Audio.Channels[0]=0
table.Encode[0].MainFormat[2].Audio.Compression=G.711A
fo

table.Encode[0].MainFormat[2].Audio.Depth=16
r1

table.Encode[0].MainFormat[2].Audio.Frequency=8000
table.Encode[0].MainFormat[2].Audio.Mode=0
00

table.Encode[0].MainFormat[2].Audio.Pack=DHAV
table.Encode[0].MainFormat[2].AudioEnable=true
M

table.Encode[0].MainFormat[2].Video.resolution=1920x1080
EG

table.Encode[0].MainFormat[2].Video.BitRate=4096
table.Encode[0].MainFormat[2].Video.BitRateControl=CBR
A

table.Encode[0].MainFormat[2].Video.Compression=H.264
Di

table.Encode[0].MainFormat[2].Video.CustomResolutionName=1080P
table.Encode[0].MainFormat[2].Video.FPS=18
st

table.Encode[0].MainFormat[2].Video.GOP=36
rib

table.Encode[0].MainFormat[2].Video.Height=1080
table.Encode[0].MainFormat[2].Video.Pack=DHAV
ut

table.Encode[0].MainFormat[2].Video.Profile=High
io

table.Encode[0].MainFormat[2].Video.Quality=4
n

table.Encode[0].MainFormat[2].Video.QualityRange=6
table.Encode[0].MainFormat[2].Video.SVCTLayer=1
s.r

table.Encode[0].MainFormat[2].Video.Width=1920
.o

table.Encode[0].MainFormat[2].Video.Priority=0
table.Encode[0].MainFormat[2].VideoEnable=true
.

table.Encode[0].MainFormat[3].Audio.Bitrate=64
table.Encode[0].MainFormat[3].Audio.Channels[0]=0
table.Encode[0].MainFormat[3].Audio.Compression=G.711A
table.Encode[0].MainFormat[3].Audio.Depth=16

General APIs 21
table.Encode[0].MainFormat[3].Audio.Frequency=8000
table.Encode[0].MainFormat[3].Audio.Mode=0
table.Encode[0].MainFormat[3].Audio.Pack=DHAV
table.Encode[0].MainFormat[3].AudioEnable=true
table.Encode[0].MainFormat[3].Video.resolution=704x576
table.Encode[0].MainFormat[3].Video.BitRate=2048
table.Encode[0].MainFormat[3].Video.BitRateControl=VBR
Da

table.Encode[0].MainFormat[3].Video.Compression=H.264
table.Encode[0].MainFormat[3].Video.FPS=25
hu

table.Encode[0].MainFormat[3].Video.GOP=50
aH

table.Encode[0].MainFormat[3].Video.Height=576
table.Encode[0].MainFormat[3].Video.Pack=DHAV
table.Encode[0].MainFormat[3].Video.Profile=Main
TT

table.Encode[0].MainFormat[3].Video.Quality=4
P

table.Encode[0].MainFormat[3].Video.QualityRange=6
AP

table.Encode[0].MainFormat[3].Video.SVCTLayer=1
table.Encode[0].MainFormat[3].Video.Width=704
IV

table.Encode[0].MainFormat[3].Video.Priority=0
table.Encode[0].MainFormat[3].VideoEnable=true
2.

table.Encode[0].ExtraFormat[0].Audio.Bitrate=64
89


table.Encode[0].SnapFormat[0].Audio.Bitrate=64
fo


r1

Parameters in Response:
The format of the config is head.configItems. The head can be:
00

headMain= table. Encode[Channel].MainFormat[Type]


headSnap = table. Encode[Channel].SnapFormat[Type]
M

headExtra =table. Encode[Channel].ExtraFormat[ExtraStream]


EG

Channel: integer, array index starts from 0, which means video channel (equals to video
A

channel index -1, and so 0 means channel 1).


Di

Type:
Comment
0 = regular encode
st

1 = motion detection encode


rib

2 = alarm encode
3= emergency encode
ut

ExtraStream:
io

0 = extra stream 1
n

1 = extra stream 2
2 = extra stream 3
s.r

The configItems are list as bellow.


.o

 Set encode config


.

Table 4-11
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>...]
Method GET

General APIs 22
Description Set encode config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Encode[1].MainForm
Example
at[0].Video.Compression=MPEG4&
Success
OK
Return
Parameters in URL:
In table below,
Da

head=Encode[Channel].MainFormat[RecordType] (or)
Encode[Channel].ExtraFormat[ExtraStream]
hu
aH

Channel: integer, array index starts from 0, which means video channel(equals to video
channel index -1, and so 0 means channel 1).
Comment
TT

RecordType:
0 = regular record
P

1 = motion detection record


AP

2 = alarm record
ExtraStream:
IV

0 = extra stream 1
1 = extra stream 2
2.

2 = extra stream 3
89

Appendix A: Video Encode Config


fo

ParamName ParamValue type Description


r1

Unit is Kbps
head.Video.BitRate integer
Range depends on capability in GetVideoConfigCaps
00

Range is {CBR, VBR}


head.Video.BitRateControl string CBR: constant bitrates
M

VBR: variable bitrates


EG

Range is {MPEG4, MPEG2, MPEG1, MJPG, H.263,


head.Video.Compression String H.264, H.265, SVAC2}
A

Depends on capacity in GetVideoConfigCaps


Di

Frames per second.


<1.0: several seconds/frame, FPS=0.3333: 3 seconds
st

per frame.
rib

head.Video.FPS float
>1.0: several frames/second. FPS=3: 3 frames per
second.
ut

Range depends on capability in GetVideoConfigCaps


io

Range is [1—100].
n

Group of picture, it's the interval of I Frame,


head.Video.GOP integer
s.r

Example: GOP=50, means there is one I frame every


49 P or B frames
.o

head.Video.Height integer Video height


.

head.Video.Width integer Video Width


Range is { Baseline, Main , Extended , High }
head.Video.Profile String
Only when video compression is H.264, it's effective.

General APIs 23
ParamName ParamValue type Description
Range is [1—6].
Image Quality, available when
head.Video.Quality integer Video.BitRateControl=VBR
1: worst quality
6: best quality
Range is 0 or 1
Da

head.Video.Priority integer 0 for Image Quality first


1 for Bitstream first
hu

head.VideoEnable bool True: enable video


aH

Appendix B: Audio Encode Config

ParamName ParamValue type Description


TT

Unit is kbps
P

head.Audio.Bitrate integer Range depends on capacity in


AP

GetAudioConfigCaps
Range depends on capacity in
head.Audio.Compression string
IV

GetAudioConfigCaps
head.Audio.Depth integer Audio sampling depth
2.

head.Audio.Frequency integer Audio sampling frequency


89

Range is {0,1,2,3,4,5,6,7}
Audio encode mode.
fo

0: 4.75kbps,
r1

1: 5.15 kbps,
2: 5.9 kbps,
head.Audio.Mode integer
00

3: 6.7 kbps,
4: 7.4 kbps,
M

5: 7.95 kbps,
EG

6: 10.2 kbps,
7: 12.2 kbps,
A

head.AudioEnable bool Enable/Disable audio


Di

4.5.5 Encode of Region Interested


st
rib

 Get encode config of region interested


ut

Table 4-12
io

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoEncodeROI
Method GET
n

Description Get video encode config of region interested.


s.r

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoEncode
Example
.o

ROI
head.Regions[0][0]=0
.

head.Regions[0][1]=0
Success
head.Regions[0][2]=0
Return
head.Regions[0][3]=0
head.Regions[1][0]=0

General APIs 24

head.Quality=4,
head.Main=true,
head.Extra1=true,
head.Extra2=true,
head.Extra3=true,
head.Snapshot=true
Da

head.DynamicTrack=true,
head.DynamicDelayTime=60
hu

Parameters in Response:
head=table.VideoEncodeROI[ChannelNo]
aH

Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
TT

 Set encode config of region interested


P

Table 4-13
AP

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
IV

Method GET
2.

Description Set video encode config of region interested.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoEncodeROI[0].
89

Example
DynamicTrack=true
Success
fo

OK
Return
r1

Parameters in URL:
paramName and paramValue are as table below.
00

In table below,
Comment
M

head = VideoEncodeROI[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel(equals to
EG

video channel index -1, and so 0 means channel 1).


A

Appendix:
ParamName ParamValue type Description
Di

head. DynamicTrack bool Enable/Disable


st
rib

4.5.6 Channel Title


ut

 Get channel title


io

Table 4-14
n

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ChannelTitle
s.r

Method GET
Description Get the title of the video channel.
.o

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=ChannelTitle
.

Success
table.ChannelTitle[Channel].Name=CAM1|123
Return

General APIs 25
Parameters in Response:
Channel: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
Name: string, which means title content. character '|' means newlines.
 Set channel title

Table 4-15
Da

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>
hu

Method GET
Description Set the title of the channel.
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ChannelTitle[1].Nam
Example
e= test1|test2
TT

Success
OK
Return
P

If VideoWidget[Channel].ChannelTitle.EncodeBlend is true, this title is blended to the


AP

video frames.
Please refer to SetVideoWidgetConfig.
IV
2.

Parameters in URL:
Channel Name Format:
89

Comment
ChannelTitle[Channel].Name
Channel: integer, array index starts from 0, which means video channel(equals to video
fo

channel index -1, and so 0 means channel 1).


r1

Name: string, which means title content. Character '|' means newlines.
00

Limit: Support 2 lines at most.


M

4.5.7 Get Video Input Channels Device Supported


EG
A

Table 4-16
Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=getCollect
Di

Method GET
st

Description Get the video input channel numbers.


rib

Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCollect
Success
result=1
ut

Return
io

Comment —
n

4.5.8 Get Video Output Channels Device Supported


s.r
.o

Table 4-17
Syntax http://<server>/cgi-bin/devVideoOutput.cgi?action=getCollect
.

Method GET
Description Get the video output channel numbers.
Example http://192.168.1.108/cgi-bin/devVideoOutput.cgi?action=getCollect
Success result=2

General APIs 26
Return
Comment —

4.5.9 Get Max Remote Input Channels


Table 4-18
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxRemoteI
Da

nputChannels
Method GET
hu

Description Get max remote input channels.


aH

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxRe
moteInputChannels
TT

Success table.MaxRemoteInputChannels=16
Return
P

Comment MaxRemoteInputChannels: max remote input channels.


AP

4.5.10 Video Standard


IV

 Get video standard


2.
89

Table 4-19
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoStandard
fo

Method GET
Description Get video standard config.
r1

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoStandar
00

d
Success table.VideoStandard=PAL
M

Return
EG

Comment —
 Set video standard
A

Table 4-20
Di

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&VideoStandard=<paramV
st

alue>
Method GET
rib

Description Set video standard config.


ut

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoStandard=PAL
Success OK
io

Return
n

Comment VideoStandard: string, range is {PAL, NTSC} Video Standard.


s.r

4.5.11 Video Widget


.o
.

 Get video widget config

Table 4-21
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Method GET

General APIs 27
Description Video widget config contains Channel Title, User-defined Title, Covers and Time Title
parameters, defines the background color, front color and positions of channel title and
time title, User-defined title and defines the regions which are not visible (cover).
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Success head.BackColor[0]=0
Return head.BackColor[1]=0
head.BackColor[2]=0
Da

head.BackColor[3]=128
head.EncodeBlend=true
hu

head.FrontColor[0]=255
aH

head.FrontColor[1]=255
head.FrontColor[2]=255
head.FrontColor[3]=0
TT

head.Rect[0]=0
P

head.Rect[1]=8191
AP

head.Rect[2]=0
head.Rect[3]=8191
IV


Comment Parameters in Response:
2.

head=table.VideoWidget[Channel].ChannelTitle (or)
89

table.VideoWidget[Channel].Covers[CoReg] (or)
table.VideoWidget[Channel].TimeTitle
fo

table.VideoWidget[Channel].UserDefinedTitle[Index]
r1

Channel: integer, array index starts from 0, which means video channel (equals to
00

video channel index -1, and so 0 means channel 1).


CoReg: Cover Region, Covers is an array which sustains multi- Cover regions
M

0 = region 1
EG

1 = region 2
2 = region 3
A

3 = region 4
Di

Index: integer, User-defined title index, now only index 0 is valid, others are reserved.
 Set video widget config
st
rib

Table 4-22
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
ut

alue>[&<paramName>=<paramValue>…]
Method GET
io

Description Set video widget config.


n

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[1].Cov
s.r

Example ers[0].BackColor[0]=128&VideoWidget[1].Covers[0].BackColor[1]=128&VideoWidget[1]
.Covers[0].BackColor[2]=128&VideoWidget[1].Covers[0].BackColor[3]=0
.o

Success
.

OK
Return
Parameters in URL:
Comment In table below,
headChannelTitle = VideoWidget[Channel].ChannelTitle

General APIs 28
headCover = VideoWidget[Channel].Covers[CoReg]
headTimeTitle = VideoWidget[Channel].TimeTitle
headUserDefinedTitle = VideoWidget[Channel].UserDefinedTitle[Index]

Channel: integer, array index starts from 0, which means video channel(equals to video
channel index -1, and so 0 means channel 1).
CoReg: Cover region index. Covers is an array which contains multiple cover regions
Da

0 = region 1
1 = region 2
hu

2 = region 3
3 = region 4
aH

Index: integer, User-defined title index, now only index 0 is valid, others are reserved.
TT

Appendix:
P

ParamName ParamValue type Description


AP

Range is [0—255].
headCover.BackColor[0]
BackColor[0]:red value
headCover.BackColor[1]
IV

integer BackColor[1]:green value


headCover.BackColor[2]
BackColor[2]:blue value
2.

headCover.BackColor[3]
BackColor[3]: alpha value
89

headCover.EncodeBlend bool false - widget blend is disabled.


Range is [0—255].
headCover.FrontColor[0]
fo

FrontColor[0]:red value
headCover.FrontColor[1]
r1

integer FrontColor[1]:green value


headCover.FrontColor[2]
FrontColor[2]:blue value
headCover.FrontColor[3]
00

FrontColor[3]: alpha value


Range is [0—8191].
M

headCover.Rect[0] Rect[0]: top left corner x coordinate (left)


EG

headCover.Rect[1] Rect[1]: top left corner y coordinate (top)


integer
headCover.Rect[2] Rect[2]: bottom right x coordinate (right)
A

headCover.Rect[3] Rect[3]: bottom right y coordinate


Di

(bottom)
headChannelTitle.BackColor[0]
st

headChannelTitle.BackColor[1]
rib

integer
headChannelTitle.BackColor[2]
headChannelTitle.BackColor[3]
ut

headChannelTitle.EncodeBlend bool Range is the same with headCover.


io

headChannelTitle.FrontColor[0]
n

headChannelTitle.FrontColor[1]
integer
headChannelTitle.FrontColor[2]
s.r

headChannelTitle.FrontColor[3]
.o

Only use the value of (left, top),the value


headChannelTitle.Rect[0]
.

of (right, bottom) is the same as (left, top)


headChannelTitle.Rect[1]
integer Rect[0], Rect[1] are used, and Rect[2]
headChannelTitle.Rect[2]
must be same with Rect[0], Rect[3] must
headChannelTitle.Rect[3]
be same with Rect[1].
headUserDefinedTitle.Text string Title content. Character '|' means

General APIs 29
ParamName ParamValue type Description
newlines.
Limit: Support 2 lines at most.
headUserDefinedTitle.TextAlign integer Range is the same with
headUserDefinedTitle.BackColor[0] headChannelTitle
headUserDefinedTitle.BackColor[1] These are configs about User-defined
integer
headUserDefinedTitle.BackColor[2] title.
Da

headUserDefinedTitle.BackColor[3]
headUserDefinedTitle.EncodeBlend bool
hu

headUserDefinedTitle.FrontColor[0]
aH

headUserDefinedTitle.FrontColor[1]
integer
headUserDefinedTitle.FrontColor[2]
headUserDefinedTitle.FrontColor[3]
TT

headUserDefinedTitle.Rect[0]
P

headUserDefinedTitle.Rect[1]
integer
AP

headUserDefinedTitle.Rect[2]
headUserDefinedTitle.Rect[3]
IV

headTimeTitle.BackColor[0]
headTimeTitle.BackColor[1]
2.

integer
headTimeTitle.BackColor[2]
89

headTimeTitle.BackColor[3]
headTimeTitle.EncodeBlend bool
fo

headTimeTitle.FrontColor[0] Range is the same with


r1

headTimeTitle.FrontColor[1] headChannelTitle.
integer
headTimeTitle.FrontColor[2] These are configs about time title.
00

headTimeTitle.FrontColor[3]
headTimeTitle.Rect[0]
M

headTimeTitle.Rect[1]
integer
EG

headTimeTitle.Rect[2]
headTimeTitle.Rect[3]
A

headTimeTitle.ShowWeek bool True: Display week within the time title.


Di

4.5.12 Get Video Input Capability


st
rib

Table 4-23
Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=getCaps&channel=<ChannelNo>
ut

Method GET
io

Description Get video input capabilities.


n

Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCaps&channel=1
s.r

caps.AutoSyncPhase=false
caps.Backlight=2
.o

caps.BrightnessCompensation=true
Success
.

caps.ChipID=0
Return
caps.CoverCount=4
caps.CoverType=1
caps.CustomManualExposure=true

General APIs 30
caps.DayNightColor=true
caps.DayNightColorIO=false
caps.DoubleExposure=0
caps.DownScaling=false
caps.EEModeRange=100
caps.ElectricFocus=false
caps.Exposure=16
Da

caps.ExposureMode=31
caps.ExternalSyncInput=false
hu

caps.FishEye=false
caps.FlashAdjust=false
aH

caps.Flip=true
caps.FormatCount=5
TT

caps.Gain=true
P

caps.GainAuto=true
caps.Gamma=true
AP

caps.GammaModeRange=100
IV

caps.GlareInhibition=1
caps.HorizontalBinning=0
2.

caps.IRCUT=true
89

caps.ImageEnhancement.LevelRange[0]=0
caps.ImageEnhancement.LevelRange[1]=100
fo

caps.ImageEnhancement.Support=true
caps.InfraRed=true
r1

caps.Iris=true
00

caps.IrisAuto=true
caps.LadenBitrate=972000
M

caps.LimitedAutoExposure=true
EG

caps.MaxExposureTime=300.0
caps.MaxExposureTime1=0.0
A

caps.MaxHeight=1080
caps.MaxMultiProfile=3
Di

caps.MaxWidth=1920
st

caps.MeteringRegionCount=0
rib

caps.MinExposureTime=1.0
caps.MinExposureTime1=0.0
ut

caps.Mirror=true
io

caps.MultiOptions=false
caps.NightOptions=true
n

caps.ReferenceLevel=false
s.r

caps.Rotate90=true
.o

caps.SetColor=true
caps.SignalFormats=Inside
.

caps.SignalType[0]=VGA
caps.SnapshotExposure=false
caps.SupportProfile=false
caps.SupportWhiteLevel=true

General APIs 31
caps.SupportWriteLevel=false
caps.SyncChipChannels=false
caps.SyncFocus=false
caps.TitleCount=4
caps.TridimDenoise=2
caps.TridimDenoiseDetails=0
caps.UTC=0
Da

caps.UpScaling=false
caps.Version=0
hu

caps.VerticalBinning=0
caps.VideoInDenoise.2D.LevelRange[0]=0
aH

caps.VideoInDenoise.2D.LevelRange[1]=100
caps.VideoInDenoise.2D.Support=true
TT

caps.VideoInDenoise.3D.3DAutoType.ModRange[0]=0
P

caps.VideoInDenoise.3D.3DAutoType.ModRange[1]=100
caps.VideoInDenoise.3D.Support=true
AP

caps.VideoInDenoise.Support=true
IV

caps.WhiteBalance=3
caps.WideDynamicRange=1
2.

Parameters in URL:
89

ChannelNo: integer, video channel index which starts from 1.


Comment
Parameters in Response:
fo

see table below


r1

Appendix:
00

Field in response Value type Description


0: not support backlight ;
M

Backlight integer 1: support backlight;


EG

2: support regional regulation


ChipID String ID of chips in this channel
A

CoverCount integer The maximum cover region count.


Di

0: don't support cover


CoverType integer 1: support realtime cover
st

2: support non-realtime cover


rib

CustomManualExposur
bool, true: support use defined manual exposure time
e
ut

DayNightColor bool true: support color alternate between day and night.
io

DownScaling bool true: support down scaling, binning mode not included.
n

Exposure integer Exposure grade. 0 — don't support exposure control.


s.r

ExternalSyncInput bool true: support HD signal external synchronization.


FlashAdjust bool true: support flash adjust
.o

Flip bool true: support picture flip.


.

Gain bool true: support gain control.


GainAuto bool true: support auto gain.
HorizontalBinning integer Horizontal/Vertical pixel binning mask,

General APIs 32
Field in response Value type Description
1 — support 2 pixel binning,
2 — support 3 pixel binning
VerticalBinning integer 4 — support 4 pixel binning

2^n — support n+2 pixel binning
InfraRed bool true: support Infra compensation
Da

Iris bool true: support Iris adjust


IrisAuto bool true: support auto Iris adjust
hu

Unit is Kbps.
aH

LadenBitrate integer Maximum value of video stream bitrates, 16bpp, not in


binning mode.
LimitedAutoExposure bool true: support auto exposure with time limit.
TT

MaxExposureTime double upper limit of exposure time, unit: ms


P

MaxExposureTime1 double upper limit of exposure time, unit: ms


AP

MaxHeight integer Maximum video height


MaxWidth integer Maximum video width
IV

MinExposureTime double lower limit of exposure time, unit: ms


MinExposureTime1 double lower limit of exposure time, unit: ms
2.

Mirror bool true: support picture mirror.


89

NightOptions bool true: support night options.


ReferenceLevel bool true: support reference level.
fo

Rotate90 bool true: support clockwise/anticlockwise 90°rotate


r1

SetColor bool true: support color set.


It's a string contains supported video input signal formats
00

for this channel. Signal formats are separated by comma.


M

Range is {Inside, BT656, 720p, 1080p, 1080i, 1080sF,


SignalFormats string 1_3M}
EG

Inside — inside input.


A

1_3M — 1280*960
Di

True: channels in same chip should be synchronized.


st

SyncChipChannels bool Synchronized means video resolution of these channels


should be the same.
rib

TitleCount integer Maximum count of blending titles.


ut

UpScaling bool true: support up scaling.


Range is {0, 1, 2, 3}
io

0: don't support white balance.


n

1: support auto white balance


WhiteBalance integer
s.r

2: support auto and pre defined white balance.


3: support auto, pre defined and user defined white
.o

balance
.

4.5.13 Get Coordinates of Current Window


Table 4-24

General APIs 33
http://<server>/cgi-bin/devVideoInput.cgi?action=getCurrentWindow&channel=<Chann
Syntax
elNo>
Method GET
Description Get the coordinates of the current window.
Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCurrentWindow&channel=1
rect[0]=500
Success rect[1]=500
Da

Return rect[2]=5000
rect[3]=5000
hu

Parameters in URL:
aH

ChannelNo: integer, video channel index which starts from 1.


Comment Parameters in Response:
rect[n] : relative coordinates, range is 0-8192.{0,0,0,0} top-left,
TT

{8192,0,0,0} top-right, {0,8192,0,0} bottom-left, {8192,8192,0,0} bottom-right


P

4.5.14 Set Coordinates of Current Window


AP
IV

Table 4-25
http://<server>/cgi-bin/devVideoInput.cgi?action=setCurrentWindow&channel=<Chann
2.

Syntax
elNo>&rect[0]=<rect0>&rect[1]=<rect1>&rect[2]=<rect2>&rect[3]=<rect3>
89

Method GET
Description Set the coordinates of the current window.
fo

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=setCurrentWindow&channel=1&
Example
r1

rect[0]=0&rect[1]=0&rect[2]=5000&rect[3]=5000
Success
OK
00

Return
Parameters in URL:
M

ChannelNo: integer, video channel index which starts from 1.


Comment
EG

rect0 & rect1 & rect2 & rect3: relative coordinates, range is 0-8192.{0,0,0,0} top-left,
{8192,0,0,0} top-right, {0,8192,0,0} bottom-left, {8192,8192,0,0} bottom-right
A
Di

4.5.15 Video Out


st

 Get video out config


rib

Table 4-26
ut

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoOut
io

Method GET
Description Get video out config.
n

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoOut
s.r

head.Margin[0]=0
.o

head.Margin[1]=0
head.Margin[2]=0
.

Success
head.Margin[3]=0
Return
head.Color.Brightness=50
head.Color. Contrast =50
head.Color. Satuation =50

General APIs 34
head.Color. Hue =50
head.Mode. Width =800
head.Mode. Height=600
head.Mode. BPP =16
head.Mode. Format ="Auto"
head.Mode. RefreshRate =60

Da

Parameters in Response:
head = table.VideoOut[ChannelNo].
hu

Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
aH

 Set video out config


TT

Table 4-27
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
P

Syntax
alue>[&<paramName>=<paramValue>…]
AP

Method GET
Description Set video out config.
IV

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&table.VideoOut[1].Co
Example
2.

lor.Brightness=50
Success
89

OK
Return
Parameters in URL:
fo

In table below,
r1

Comment head = table.VideoOut[ChannelNo].


ChannelNo: integer, array index starts from 0, which means video channel (equals to
00

video channel index -1, and so 0 means channel 1).


M

Appendix:
EG

ParamName ParamValue type Description


A

head. Margin[0]
head. Margin[1]
Di

integer Margin.
head. Margin[2]
st

head. Margin[3]
rib

head. Color.Brightness integer Brightness.


head. Color.Contrast =50 integer Contrast.
ut

head.Color.Satuation =50 integer Satuation.


io

head. Color.Hue =50 integer Hue.


head. Mode.Width =800
n

integer Resolution.
head. Mode.Height=600
s.r

head. Mode.BPP =16 integer Bits per pixel.


.o

The range is {"Auto","TV","VGA","DVI","HDMI",


head.Mode.Format="Auto" string
"SPOT","SDI", "HDMI/VGA"}.
.

head.Mode.RefreshRate=60 integer Refresh rate.

General APIs 35
4.5.16 Smart Code
 Get Smart Code config

Table 4-28
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SmartEncode
Method GET
Da

Description Get smart code config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=SmartEncode
hu

Success head.Enable=false
aH

Return head.Extra[0]=false
Parameters in Response:
head = table.SmartEncode[ChannelNo].
TT

Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
P

video channel index -1, and so 0 means channel 1).


AP

 Set Smart Code config


IV

Table 4-29
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
2.

alue>[&<paramName>=<paramValue>…]
89

Method GET
Description Set smart code config.
fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SmartEncode[0].Ena
Example
ble=true
r1

Success
OK
Return
00

Parameters in URL:
M

In table below,
Comment head = SmartEncode[ChannelNo].
EG

ChannelNo: integer, array index starts from 0, which means video channel(equals to
A

video channel index -1, and so 0 means channel 1).


Di

Appendix:
st

ParamName ParamValue type Description


rib

head.Enbale bool Open or close the smart code of the main stream.
head.Extra[0] bool Open or close the smart code of the extra stream.
ut
io

4.5.17 Get Decoder Caps


n

URL http://<server>/cgi-bin/DevVideoDec.cgi?action=getCaps
s.r

Method GET
.o

Description Get capability of decoder


[ Request Params ] (None )
.

[ Response Params ] (key=value format)


Name Type R/O Param Description
Video object R The video caps

General APIs 36
The stream types that the device supports, ex : h264, h265
+StreamType array<string> R
etc.
The maximum decoding capability that the device supports
+LadenBitrate int R (w * h * FPS * 16)/1024, uint: kbps, ex : 7680*4320*30*8/1024
= 7776000
[ Example ]
Request GET http://192.168.1.108/cgi-bin/DevVideoDec.cgi?action=getCaps
Da

Video.StreamType[0]=h264
Response Video.StreamType[1]=h265
hu

Video.LadenBitrate=7776000
aH

4.5.18 [Config] PrivacyMasking


TT
P

 Get privacy masking config


AP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PrivacyMasking
Method GET
IV

Description Get privacy masking setting


[ Request Params ] (None )
2.

[ Response Params ] (key=value format)


89

Name Type R/O Param Description


table object R Config info table.
fo

Array<Array<object> PrivacyMasking config, each channel has several


+PrivacyMasking R
r1

> masking region


++Enable bool R Enable/Disable
00

Size is 3
M

Postion[0] is horizontal angle, range is [-1—1]


++Postion Array<double> O
Postion[1] is vertical angel, range is [-1—1]
EG

Postion[2] is zoom, range is [ 0—1]


++ShapeType string O Shape type,can be: “Rect”, “Polygon”
A

It is valid if ShapeType is Rect , top left and bottom


Di

++Rect Array<int> O right point, each point has x and y value, oordinate
st

remap to 0 — 8192.
rib

It is valid if ShapeType is Polygon


the first array is point list, minimum item is 3, the
++Polygon Array<Array<int>> O
ut

second array is point, must be two int, means x and


y value, coordinate remap to 0 — 8192.
io

++Color Array<int> O Mask color, RGBA color, 4 integer range is 0-255


n

Mosaic type, Range is {0, 8, 16, 24, 32}


s.r

0: no mosaic
8: mosaic size 8*8
.o

++Mosaic int O
16: mosaic size 16*16
.

24: mosaic size 24*24


32: mosaic size 32*32
++ViewAngle double O View angle, range is [0.0, 360.0], unit: degree
[ Example ]

General APIs 37
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PrivacyMaskin
Request
g
table.PrivacyMasking[0][0].Enable=true
table.PrivacyMasking[0][0].Postion[0]=0.0
table.PrivacyMasking[0][0].Postion[1]=0.0
table.PrivacyMasking[0][0].Postion[2]=1.0
table.PrivacyMasking[0][0].ShapeType=Rect
Da

table.PrivacyMasking[0][0].Rect[0]=0
table.PrivacyMasking[0][0].Rect[1]=0
hu

table.PrivacyMasking[0][0].Rect[2]=50
Response table.PrivacyMasking[0][0].Rect[3]=100
aH

table.PrivacyMasking[0][0].Color[0]=128
table.PrivacyMasking[0][0].Color[1]=128
TT

table.PrivacyMasking[0][0].Color[2]=128
P

table.PrivacyMasking[0][0].Color[3]=255
AP

table.PrivacyMasking[0][0].Mosaic=8
table.PrivacyMasking[0][0].ViewAngle=30.0
IV

table.PrivacyMasking[0][1].Enable=true

2.
89

 Set privacy masking config


Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig
fo

Method GET
r1

Description Set privacy masking setting


[ Request Params ] (key=value format )
00

Name Type R/O Param Description


privacy masking config, each channel has several
M

PrivacyMasking Array<Array<object>> R
masking region
EG

+Enable bool R Enable/Disable


Size is 3
A

Postion[0] is horizontal angle, range is [-1—1]


+Postion Array<double> O
Di

Postion[1] is vertical angel, range is [-1—1]


Postion[2] is zoom, range is [ 0—1]
st

+ShapeType string O Shape type,can be: “Rect”, “Polygon”


rib

It is valid if ShapeType is Rect , top left and bottom


+Rect Array<int> O right point, each point has x and y value, oordinate
ut

remap to 0 — 8192.
io

It is valid if ShapeType is Polygon


n

the first array is point list, minimum item is 3, the


+Polygon Array<Array<int>> O
s.r

second array is point, must be two int, means x


and y value, coordinate remap to 0 — 8192.
.o

+Color Array<int> O Mask color, RGBA color, 4 integer range is 0-255


.

General APIs 38
Mosaic type, Range is {0, 8, 16, 24, 32}
0: no mosaic
8: mosaic size 8*8
+Mosaic int O
16: mosaic size 16*16
24: mosaic size 24*24
32: mosaic size 32*32
+ViewAngle double O View angle, range is [0.0, 360.0], unit: degree
Da

[ Response Params ] ( OK )
[ Example ]
hu

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PrivacyMasking[0][0].En
aH

able=true&PrivacyMasking[0][0].Postion[0]=0.0&PrivacyMasking[0][0].Postion[1]=0.0&Priv
acyMasking[0][0].Postion[2]=1.0&PrivacyMasking[0][0].ShapeType=Rect&PrivacyMasking
Request
[0][0].Rect[0]=0&PrivacyMasking[0][0].Rect[1]=0&PrivacyMasking[0][0].Rect[2]=50&Privac
TT

yMasking[0][0].Rect[3]=100&PrivacyMasking[0][0].Mosaic=8&PrivacyMasking[0][0].ViewA
P

ngle=30.0
AP

Response OK
IV

4.5.19 Get Privacy Masking


2.
89

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMasking
Method GET
fo

Description Get privacy masking


r1

[ Request Params ] (key=value format at URL)


Name Type R/O Param Description
00

channel int R video channel index which starts from 1


M

offset int R Offset in the result record set, range is [0, Total – 1].
limit int R Count of result to get.
EG

[ Response Params ] (key=value format)


Name Type R/O Param Description
A

total int R Count of result


Di

PrivacyMasking Array<object > R PrivacyMasking config


st

+Index int R Index of PrivacyMasking which starts from 0


rib

+Name string O PrivacyMasking name


+Enable int R 1: enable; 0: disable
ut

+ShapeType string O Shape type,can be: “Rect”, “Polygon”


io

It is valid if ShapeType is Rect , top left and bottom


+Rect Array<int> O right point, each point has x and y value, oordinate
n

remap to 0 — 8192.
s.r

It is valid if ShapeType is Polygon


.o

the first array is point list, minimum item is 3, the


+Polygon Array<Array<int>> O
second array is point, must be two int, means x
.

and y value, coordinate remap to 0 — 8192.


+Color Array<int> O Mask color, RGBA color, 4 integer range is 0-255

General APIs 39
Mosaic type, Range is {0, 8, 16, 24, 32}
0: no mosaic
8: mosaic size 8*8
+Mosaic int O
16: mosaic size 16*16
24: mosaic size 24*24
32: mosaic size 32*32
[ Example ]
Da

http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMasking&channel=1&
Request
offset=2&limit =5
hu

total=5
aH

PrivacyMasking[0].Index=0
PrivacyMasking[0].Name=Privacy Masking1
PrivacyMasking[0].Enable=1
TT

PrivacyMasking[0].ShapeType=Polygon
P

PrivacyMasking[0].Polygon[0][0]= 0
AP

PrivacyMasking[0].Polygon[0][1]=0
PrivacyMasking[0].Polygon[1][0]=128
IV

PrivacyMasking[0].Polygon[1][1]=128
PrivacyMasking[0].Polygon[2][0]=256
2.

Response
PrivacyMasking[0].Polygon[2][1]=200
89


PrivacyMasking[0].Color[0]=128,
fo

PrivacyMasking[0].Color[1]=128,
PrivacyMasking[0].Color[2]=128,
r1

PrivacyMasking[0].Color[3]=255,
00

PrivacyMasking[0].Mosaic=8,
PrivacyMasking[1].Index =1,
M

PrivacyMasking[1].Enable=1,
EG


A
Di

4.5.20 Set Privacy Masking


st

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMasking
rib

Method GET
Description Set privacy masking
ut

[ Request Params ] (key=value format at URL)


io

Name Type R/O Param Description


n

channel int R video channel index which starts from 1


s.r

PrivacyMasking object R Privacy masking config


+Index int R Index of PrivacyMasking which starts from 0
.o

+Name string O PrivacyMasking name


.

+Enable int R 1: enable; 0: disable


+ShapeType string O Shape type,can be: “Rect”, “Polygon”

General APIs 40
It is valid if ShapeType is Rect , top left and
+Rect Array<int> O bottom right point, each point has x and y value,
oordinate remap to 0 — 8192.
It is valid if ShapeType is Polygon
the first array is point list, minimum item is 3, the
+Polygon Array<Array<int>> O
second array is point, must be two int, means x
and y value, coordinate remap to 0 — 8192.
Da

+Color Array<int> Mask color, RGBA color, 4 integer range is 0-255


Mosaic type, Range is {0, 8, 16, 24, 32}
hu

0: no mosaic
aH

8: mosaic size 8*8


+Mosaic int
16: mosaic size 16*16
24: mosaic size 24*24
TT

32: mosaic size 32*32


P

[ Response Params ] ( OK )
AP

[ Example ]
http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMasking&channel=2&
IV

PrivacyMasking.Index=3&PrivacyMasking.Name=Privacy%20Masking1&PrivacyMasking.
Request Enable=1&PrivacyMasking.ShapeType=Rect&PrivacyMasking.Rect[0]=0&PrivacyMaskin
2.

g.Rect[1]=0&PrivacyMasking.Rect[2]=50&PrivacyMasking.Rect[3]=100&PrivacyMasking.
89

Mosaic=8
Response OK
fo
r1

4.5.21 Goto Privacy Masking


00

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=gotoPrivacyMasking
M

Method GET
EG

Description Goto privacy masking


[ Request Params ] (key=value format at URL)
A

Name Type R/O Param Description


Di

channel int R video channel index which starts from 1


st

index int R Index of PrivacyMasking which starts from 0


rib

[ Response Params ] ( OK )
[ Example ]
ut

http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=gotoPrivacyMasking&channel=
Request
2&index=3
io

Response OK
n
s.r

4.5.22 Delete Privacy Masking


.o
.

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=deletePrivacyMasking
Method GET
Description Delete privacy masking
[ Request Params ] (key=value format at URL)

General APIs 41
Name Type R/O Param Description
channel int R video channel index which starts from 1
index int R Index of PrivacyMasking which starts from 0
[ Response Params ] ( OK )
[ Example ]
http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=deletePrivacyMasking&channel
Request
=2&index=3
Da

Response OK
hu
aH

4.5.23 Clear Privacy Masking


TT

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=clearPrivacyMasking
Method GET
P

Description Clear privacy masking


AP

[ Request Params ] (key=value format at URL)


Name Type R/O Param Description
IV

channel int R video channel index which starts from 1


2.

[ Response Params ] ( OK )
[ Example ]
89

Request http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=clearPrivacyMasking&channel=2
Response OK
fo
r1

4.5.24 Get Privacy Masking Rect


00
M

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=getRealRect
EG

Method GET
Description Get privacy masking rect
A

[ Request Params ] (key=value format at URL )


Di

Name Type R/O Param Description


channel int R video channel index which starts from 1
st

index int R Index of PrivacyMasking which starts from 0


rib

[ Response Params ] (key=value format )


Name Type R/O Param Description
ut

Rect, top left and bottom right point, each point has x and y
Rect Array<int> R
io

value, oordinate remap to 0 — 8192.


n

[ Example ]
s.r

Request http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=getRealRect&channel=2&index=1
Rect[0]=0
.o

Rect[1]=0
Response
.

Rect[2]=50
Rect[3]=100

General APIs 42
4.5.25 [Config] SmartMotionDetect
 Get smart motion detection setting
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDete
Syntax
ct
Method GET
Da

Description Get smart motion detection setting


[ Request Params ] (None )
hu

[ Response Params ] (key=value format)


Name Type R/O Param Description
aH

table object R Config info table.


+SmartMotionDetec PrivacyMasking config, each channel has one
TT

Array<object> R
t config object
++Enable bool R Enable/Disable
P

Detection sensitivity, can be: "Low", "Middle",


AP

++Sensitivity string R
"High"
IV

++ObjectTypes object R Detection object type


+++Human bool R Whether detect motion of human
2.

+++Vehicle bool R Whether detect motion of vehicle


89

[ Example ]
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDe
Request
fo

tect
table.SmartMotionDetect[0].Enable=true
r1

table.SmartMotionDetect[0].Sensitivity=Middle
00

Response table.SmartMotionDetect[0].ObjectTypes.Human=true
table.SmartMotionDetect[0].ObjectTypes.Vejhicle=true
M


EG

 Set smart motion detection setting


A

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Di

Description Set smart motion detection setting


st

[ Request Params ] (key=value format )


rib

Name Type R/O Param Description


SmartMotionDet Smart motion detection config, each channel has
ut

Array<object> R
ect one config object
io

+Enable bool R Enable/Disable


n

Detection sensitivity, can be: "Low", "Middle",


+Sensitivity string R
"High"
s.r

+ObjectTypes object R Detection object type


.o

++Human bool R Whether detect motion of human


.

++Vehicle bool R Whether detect motion of vehicle


[ Response Params ] ( OK )
[ Example ]

General APIs 43
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SmartMotionDetect[0].E
Request nable=true&SmartMotionDetect[0].Sensitivity=Middle&SmartMotionDetect[0].ObjectTypes.
Human=true&SmartMotionDetect[0].ObjectTypes.Vejhicle=true
Response OK

4.5.26 [Config] LAEConfig


Da

Get LAEConfig setting


hu

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LAEConfig
aH

Method GET
Description Get LAE Configs.
TT

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=LAEConfig
Success table.LAEConfig.Enable=true
P

Return table.LAEConfig.ManulEn=1
AP

table.LAEConfig.YSIGMA =1
table.LAEConfig.Dethr =1
IV

table.LAEConfig.STS =1
table.LAEConfig.GauFilter0=1
2.

table.LAEConfig.GauFilter1=1
89

table.LAEConfig.GauFilter2=1
table.LAEConfig.UVGauFilter0=1
fo

table.LAEConfig.UVGauFilter1=1
r1

table.LAEConfig.UVGauFilter2=1
table.LAEConfig.UVSigma =1
00

table.LAEConfig.EEGauFilter0=1
table.LAEConfig.EEGauFilter1=1
M

table.LAEConfig.EEGauFilter2=1
EG

table.LAEConfig.EEratio =1
table.LAEConfig.GEnable =1
A

table.LAEConfig.GainLevel =1
Di

table.LAEConfig.DebugPin =1
Comment
st
rib

 Set LAEConfig setting


ut

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVal
ue>[&<paramName>=<paramValue>…]
io

Method GET
n

Description Set LAE Configs.


s.r

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LAEConfig.Enable=tru
e&LAEConfig.ManulEn=1
.o

Success OK
.

Return
Comment

Appendix:

General APIs 44
ParamName ParamValue type Description
turn on/off LAE fuction
table.LAEConfig.Enable bool The following parameters will take effacts when
it’s on
whether use manual mode, 1 for manual mode,
table.LAEConfig.ManulEn integer
0 for alternative plan
absolute strength of Y channel Grinding,
Da

table.LAEConfig.YSIGMA integer
The smaller the stronger(fuzzier)
relative strength of Y channel Grinding,
hu

table.LAEConfig.Dethr integer
The smaller the stronger(fuzzier)
aH

table.LAEConfig.STS integer Y channel STS


table.LAEConfig.GauFilter0 Y channel pre filter0, meet the conditions:
integer GauFilter0 * 2 + GauFilter1 * 2 + GauFilter2 =
TT

256
P

table.LAEConfig.GauFilter1 integer Y channel pre filter1


AP

table.LAEConfig.GauFilter2 integer Y channel pre filter2


table.LAEConfig.UVGauFilter0 UV channel pre filter0, meet the conditions:
IV

integer GauFilter0 * 2 + GauFilter1 * 2 + GauFilter2 =


256
2.

table.LAEConfig.UVGauFilter1 integer UV channel pre filter1


89

table.LAEConfig.UVGauFilter2 integer UV channel pre filter2


table.LAEConfig.UVSigma absolute strength of UV channel Grinding,
fo

integer
The smaller the stronger
r1

table.LAEConfig.EEGauFilter0 EE pre filter0, meet the conditions: GauFilter0 *


integer
2 + GauFilter1 * 2 + GauFilter2 = 256
00

table.LAEConfig.EEGauFilter1 integer EE pre filter1, extracts low-frequenc


table.LAEConfig.EEGauFilter2 integer EE pre filter2
M

table.LAEConfig.EEratio strength of enhancement, the bigger the


EG

integer
stronger
table.LAEConfig.GEnable integer Brightening switch, default false
A

table.LAEConfig.GainLevel integer it is used to choose paramas, as an alternative


Di

table.LAEConfig.DebugPin integer debug option


st

4.5.27 Enable/Disable all privacy masking covers


rib
ut

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMaskingEnable
Method GET
io

Description Enable/Disable all privacy masking covers


n

[ Request Params ] (key=value format at URL )


s.r

Name Type R/O Param Description


channel int R video channel index which starts from 1
.o

Enable bool R true: Enable, false: Disable


.

[ Response Params ] ( OK )
[ Example ]
http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMaskingEnable&ch
Request
annel=2&Enable=true

General APIs 45
Response OK

4.5.28 Get enable/disable state of all privacy masking covers


Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMaskingEnable
Method GET
Description Get enable/disable state of all privacy masking covers
Da

[ Request Params ] (key=value format at URL )


Name Type R/O Param Description
hu

channel int R video channel index which starts from 1


aH

[ Response Params ] (key=value format)


Name Type R/O Param Description
TT

Enable bool R true: Enable, false: Disable


[ Example ]
P

http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMaskingEnable&ch
Request
AP

annel=2
Response Enable=false
IV
2.

4.6 System
89
fo

4.6.1 General
r1

 Get general config


00

Table 4-30
M

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=General
Method GET
EG

Description Get general config.


A

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General
table.General.LocalNo=8,
Di

table.General.MachineID=20832748927,
st

table.General.MachineName=Dahua001,
rib

table.General.MachineAddress=滨江区.江南大道.伟业路口,
table.General.MachineGroup=交警一队,
ut

table.General.LockLoginEnable=true,
table.General.CheckDuration=30,
io

Success
table.General.LockLoginTimes=3,
n

Return
table.General.LoginFailLockTime=1800,
s.r

table.General.MaxOnlineTime=1800,
table.General.LocalPolicy.LockLoginEnable=true,
.o

table.General.LocalPolicy.CheckDuration=30,
.

table.General.LocalPolicy.LockLoginTimes=3,
table.General.LocalPolicy.LoginFailLockTime=1800
table.General.ActivationTime=2000-01-01 00:00:00
Comment —

General APIs 46
 Set general config

Table 4-31
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set general config.
Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&General.MachineNa
Example
me=MyIPC
hu

Success
OK
Return
aH

Comment —

Appendix:
TT

ParamName ParamValue type Description


P

General.MachineName string Device name or serial number.


AP

General.LocalNo integer Local number for remote controller


IV

General.MachineAddress string Address machine places in


General.MachineGroup string Group machine belongs to
2.

4.6.2 Get Current Time


89
fo

Table 4-32
Syntax http://<server>/cgi-bin/global.cgi?action=getCurrentTime
r1

Method GET
00

Description Get current time.


Example http://192.168.1.108/cgi-bin/global.cgi?action=getCurrentTime
M

Success
result = 2011-7-3 21:02:32
EG

Return
The time format is "Y-M-D H-m-S". It's not be effected by Locales. TimeFormat in
Comment
A

SetLocalesConfig.
Di

4.6.3 Set Current Time


st
rib

Table 4-33
Syntax http://<server>/cgi-bin/global.cgi?action=setCurrentTime&time=2011-7-3%2021:02:32
ut

Method GET
io

Description Set current time.


n

http://192.168.1.108/cgi-bin/global.cgi?action=setCurrentTime&time=2016-01-01%202
Example
1:02:32
s.r

Success
OK
.o

Return
.

The time format is "Y-M-D H-m-S". It's not be effected by Locales. TimeFormat in
Comment
SetLocalesConfig.

General APIs 47
4.6.4 Locales
 Get locales config

Table 4-34
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Locales
Method GET
Da

Description Get locales config


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Locales
hu

table.Locales.DSTEnable=false
aH

table.Locales.DSTEnd.Day=1
table.Locales.DSTEnd.Hour=0
table.Locales.DSTEnd.Minute=0
TT

table.Locales.DSTEnd.Month=1
P

table.Locales.DSTEnd.Week=2
AP

Success table.Locales.DSTEnd.Year=2011
Return table.Locales.DSTStart.Day=0
IV

table.Locales.DSTStart.Hour=0
table.Locales.DSTStart.Minute=0
2.

table.Locales.DSTStart.Month=1
89

table.Locales.DSTStart.Week=1
table.Locales.DSTStart.Year=2011
fo

table.Locales.TimeFormat=yyyy-MM-dd HH:mm:ss
r1

Comment —
 Set locales config
00

Table 4-35
M

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
EG

Method GET
A

Description Set Locales config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Locales.DSTEnable
Di

Example
=false
st

Success
OK
rib

Return
Comment —
ut

Appendix:
io

ParamName ParamValue type Description


n

Locales.DSTEnable bool Enable/Disable DST (daylight saving time)


s.r

Range is [0—6] or [1—31]


.o

[0—6]: week day, 0 = Sunday, 6 = Saturday


Locales.DSTEnd.Day integer [1—31]: month day
.

If Locales.DSTEnd.Week is 0, use month day,


otherwise, use week day.
Locales.DSTEnd.Hour integer Range is [0—23]
Locales.DSTEnd.Minute integer Range is [0—59]

General APIs 48
ParamName ParamValue type Description
Locales.DSTEnd.Month integer Range is [1—12]
Range is {1, 2, 3, 4, -1, 0}.
0 = Use month day
Locales.DSTEnd.Week Integer [1, 2, 3, 4, -1]: use week day.
1 = first week, 2 = second, 3 = third, 4 = fourth, -1 =
last.
Da

Locales.DSTEnd.Year Integer Range is [2000-2038]


Locales.DSTStart.Day
hu

Locales.DSTStart.Hour
Range is the same with items in Locales.DSTEnd.
aH

Locales.DSTStart.Minute
Integer Locales.DSTStart table and Locales.DSTEnd table
Locales.DSTStart.Month
define the time range of DST.
TT

Locales.DSTStart.Week
Locales.DSTStart.Year
P

Defines time format displayed in video time title.


AP

String form is: year-month-day hour:mm:ss.


Position of year, month and day can be exchanged.
IV

Range of year is {yy, yyyy}


2.

yy = year without century, yyyy = year with century.


89

Range of month is {M, MM, MMMM}


M = 1 for January, MM = 01 for January, MMMM =
fo

Jan for January


r1

Locales.TimeFormat string Range of day is {d, dd}


d = 1 for first day, dd = 01 for first day
00

Range of hour is {H, HH, h, hh}


H = 1 for 1:00, HH = 01 for 1:00, range is 0-23
M

h = 1 for 1:00, hh = 01 for 1:00, time range is 1-12


EG

Example:
A

yyyy-MM-dd HH:mm:ss or
Di

MM-dd-yyyy HH:mm:ss or
dd-M-yy hh:mm:ss
st
rib

4.6.5 Get Language Capability


ut

Table 4-36
io

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getLanguageCaps
n

Method GET
s.r

Description Get the list of supported languages.


Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getLanguageCaps
.o

Success
Languages=SimpChinese,English,French
.

Return
response is a string contains languages with comma separated.
Comment Languages include { English, SimpChinese, TradChinese, Italian, Spanish, Japanese,
Russian, French, German }

General APIs 49
4.6.6 Language
 Get language config

Table 4-37
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Language
Method GET
Da

Description Get system language config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Language
hu

Success
table.Language=SimpChinese
aH

Return
Comment —
Set language config
TT


P

Table 4-38
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
AP

Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
IV

Description Set system language config.


2.

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Language=SimpChi
Example
89

nese
Success
OK
fo

Return
Comment NOTE: After changing language setting, system will automatically reboot!
r1

Appendix:
00

ParamName ParamValue type Description


M

The language range is get from interface in


Language string
EG

GetLanguageCaps
A

4.6.7 Get Client Access Filter


Di

Table 4-39
st

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessFilter
rib

Method GET
Description Get access filter config.
ut

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AccessFilter
io

Success table.AccessFilter.Enable=false
n

Return table.AccessFilter.TrustList[0]=10.6.10.23
table.AccessFilter.TrustList[1]=10.6.10.62
s.r

table.AccessFilter.Type=TrustList
.o

Comment Parameters in Response:


.

Type: Range is {TrustList, BannedList}. If Trustlist is supported, Bannedlist is not


supported.
More information in Appendix.

Appendix:

General APIs 50
ParamName ParamValue type Description
AccessFilter.BannedList[index] string Banned IP address list
AccessFilter.TrustList[index] string Trusted IP address list
AccessFilter.Enable bool Enable/Disable access filter function
Range is {TrustList, BannedList},
TrustList: Trust list is used, banned list
AccessFilter.Type string is not used.
Da

BannedList: Banned list is used, trust


list is not used.
hu

4.6.8 Auto Maintain


aH

Get auto maintain config


TT

Table 4-40
P

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AutoMaintain
AP

Method GET
Description Get Auto Maintain config.
IV

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AutoMaintain
2.

table.AutoMaintain.AutoRebootDay=3
89

table.AutoMaintain.AutoRebootHour=0
table.AutoMaintain.AutoRebootMinute=0
fo

table.AutoMaintain.AutoShutdownDay=1
Success
table.AutoMaintain.AutoShutdownHour=0
r1

Return
table.AutoMaintain.AutoShutdownMinute=0
table.AutoMaintain.AutoStartUpDay=1
00

table.AutoMaintain.AutoStartUpHour=2
M

table.AutoMaintain.AutoStartUpMinute=0
Comment —
EG

 Set auto maintain config


A

Table 4-41
Di

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
st

Method GET
rib

Description Set auto maintain config.


ut

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AutoMaintain.AutoR
Example
ebootDay=7
io

Success
OK
n

Return
s.r

Comment —
.o

Appendix:
.

ParamName ParamValue type Description

General APIs 51
ParamName ParamValue type Description
Range is [-1—7].
Auto restart day.
AutoMaintain.AutoRebootDay integer -1 = never auto restart
0—6 = Sunday—Saturday
7 = restart every day
Range is [0—23].
Da

AutoMaintain.AutoRebootHour integer
Auto restart hour
Range is [0—59].
hu

AutoMaintain.AutoRebootMinute integer
Auto restart minute
aH

AutoMaintain.AutoShutdownDay auto reboot time


AutoMaintain.AutoShutdownHour integer Range is same with AutoOpenDay,
AutoMaintain.AutoShutdownMinute AutoOpenHour and AutoOpenMinute.
TT

AutoMaintain.AutoStartUpDay Auto shutdown time.


P

AutoMaintain.AutoStartUpHour integer Range is same with AutoOpenDay,


AP

AutoMaintain.AutoStartUpMinute AutoOpenHour, and AutoOpenMinute.


IV

4.6.9 Holiday Management


2.

 Get holiday config


89

Table 4-42
fo

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Holiday
Method GET
r1

Description Get holiday config for record or snap.


00

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Holiday
table.Holiday.MonthMask[0]=3
M

table.Holiday.MonthMask[1]=0
EG

table.Holiday.MonthMask[2]=0
table.Holiday.MonthMask[3]=0
A

table.Holiday.MonthMask[4]=0
Success table.Holiday.MonthMask[5]=0
Di

Return table.Holiday.MonthMask[6]=0
st

table.Holiday.MonthMask[7]=0
rib

table.Holiday.MonthMask[8]=0
table.Holiday.MonthMask[9]=1610612739
ut

table.Holiday.MonthMask[10]=0
io

table.Holiday.MonthMask[11]=0
Comment —
n

 Set holiday config


s.r

Table 4-43
.o

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
.

alue>[&<paramName>=<paramValue>…]
Method GET
Description Set holiday config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Holiday.MonthMask[

General APIs 52
0]=3
Success
OK
Return
Parameters in URL:
In table below,
Comment
monthIndex presents the index of a month. 0 presents January, 1 presents February,
11 presents December.
Da

Appendix:
hu

ParamName ParamValue type Description


aH

It is the mask of a month.Every bit present a


day. For example, 0x0001 presents the first
day of a month is holiday. 0x0002 presents the
TT

Holiday.MonthMask[monthIndex] integer
second day of a month is holiday, 0x0003
P

presents the first day and second day of a


AP

month is holiday.
IV

4.6.10 Get Device Type


2.

Table 4-44
89

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getDeviceType
Method GET
fo

Description Get the device type displaying which is not the real type.
r1

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getDeviceType
Success
type=DVR
00

Return
Comment —
M
EG

4.6.11 Get Hardware Version


A

Table 4-45
Di

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getHardwareVersion
st

Method GET
Description Get the device hardware version.
rib

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getHardwareVersion
ut

Success
version=1.00
Return
io

Comment —
n
s.r

4.6.12 Get Serial Number of Device


.o

Table 4-46
.

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSerialNo
Method GET
Description Get the device serial number.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSerialNo

General APIs 53
Success
sn=YZC0GZ05100020
Return
Comment —

4.6.13 Get Machine Name


Table 4-47
Da

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getMachineName
Method GET
hu

Description Get the device machine name.


aH

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getMachineName
Success
name=YZC0GZ05100020
TT

Return
Comment —
P
AP

4.6.14 Get System Information


IV

Table 4-48
Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSystemInfo
2.

Method GET
89

Description Get the system information.


Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSystemInfo
fo

serialNumber=PA1FQ15900207
Success
r1

deviceType=27
Return
processor=ST7108
00

Comment —
M

4.6.15 Get Vendor Information


EG

Table 4-49
A

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getVendor
Di

Method GET
st

Description Get the vendor information.


Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getVendor
rib

Success
vendor=TTT
ut

Return
Comment —
io
n

4.6.16 Get Software Information


s.r

Table 4-50
.o

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSoftwareVersion
.

Method GET
Description Get the software information.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSoftwareVersion
Success version=2.212.0000.0.R,build:2013-11-14

General APIs 54
Return
Comment —

4.6.17 Get Version of Onvif


Table 4-51
Syntax http://<server>/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=Onvif
Da

Method GET
Description Get onvif version.
hu

Example http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=Onvif
aH

Success
version=2.4.2
Return
TT

Comment —
P

4.6.18 Get Version of HTTP API


AP

Table 4-52
IV

Syntax http://<server>/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
Method GET
2.

Description Get CGI version.


89

Example http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
Success
fo

version=2.0.0
Return
r1

Comment —
00

4.6.19 Get Device Class


M

Table 4-53
EG

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getDeviceClass
Method GET
A

Description Get the device class.


Di

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getDeviceClass
st

Success
class=HDVR
rib

Return
Comment —
ut

4.6.20 Onvif Service Authorization


io
n

 Get config of Onvif service authorization


s.r

Table 4-54
.o

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=UserGlobal
.

Method GET
Description Get user global config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=UserGlobal
Success
table.UserGlobal.OnvifLoginCheck=false
Return

General APIs 55
If "OnvifLoginCheck" is false, you can get Onvif service directly; if true, you should enter
Comment
your ID/username and password.
 Set config of Onvif service authorization

Table 4-55
http://<server>/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCh
Syntax
eck=<flag>
Da

Method GET
Description Enable onvif login check or not.
hu

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLog
Example
inCheck=true
aH

Success
OK
Return
TT

Parameters in URL:
Comment
flag : range is {true, false}.
P
AP

4.6.21 Backup of Config


IV

Table 4-56
2.

Syntax http://<server>/cgi-bin/Config.backup?action=All
89

Method GET
Description Download all the settings of a device as a file named Config.Backup by default.
fo

Example http://192.168.1.108/cgi-bin/Config.backup?action=All
Success HTTP/1.1 200 OK
r1

Return CONTENT-LENGTH: 743087


00

CONNECTION: close
Content-type: application/binarytet-stream; charset=utf-8
M

{
EG

"ATM" : {
A

"DataSource" : "RS232",
"DisplayPostion" : "lefttop",
Di

"EncodeBlend" : true,
st

"PreviewBlend" : true,
rib

"ProtocolAbility" : [ "POS" ],
"ProtocolName" : "ATM\/POS",
ut

"RecordChannels" : [ 0, 1, 2, 3 ]
io

}
……
n

}
s.r

Comment —
.o

4.6.22 Restore the Config


.

Table 4-57
http://<server>/cgi-bin/configManager.cgi?action=restore&names[0]=<xxx>&names[1]=
Syntax
<yyy>[&…]

General APIs 56
Method GET
Description Restore config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=restore&names[0]=UPnP
Success
OK
Return
Parameters in URL:
Comment
xxx and yyy is config name which need to be restore
Da

4.6.23 Restore except the Config


hu
aH

Table 4-58
Syntax http://<server>/cgi-bin/configManager.cgi?action=restoreExcept&names[0]=<xxx>&na
mes[1]=<yyy>[&…]
TT

Method GET
P

Description Restore all config except several.


AP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=restoreExcept&names[0]=UPnP
Success OK
IV

Return
Comment Parameters in URL:
2.

All the config file but xxx and yyy will be restored.
89

4.6.24 Reboot
fo
r1

Table 4-59
Syntax http://<server>/cgi-bin/magicBox.cgi?action=reboot[&delay=<paramValue>]
00

Method GET
Description Reboot the device.
M

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=reboot
EG

Success
OK
Return
A

Comment If successful, response OK. If fail, response Error.


Di

4.6.25 Shutdown
st
rib

Table 4-60
ut

Syntax http://<server>/cgi-bin/magicBox.cgi?action=shutdown
Method GET
io

Description Shutdown the device.


n

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=shutdown
s.r

Success
OK
Return
.o

Comment If successful, response OK. If fail, response Error.


.

4.6.26 FactoryReset
Table 4-61

General APIs 57
Syntax http://<server>/cgi-bin/magicBox.cgi?action=resetSystemEx[&type=<type>]
Method GET
Description Reset the configuration for the device to the factory default.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=resetSystemEx&type=0
Success
OK
Return
Parameters in URL:
Da

Type: integer, it can be 0 or1.


0 means all parameters are set to their factory default value;
hu

1 means all parameters are set to their factory default value expect the specific
aH

Comment parameters;
The specific parameters of different device types are different. But it always contains the
network settings and user settings. After resetting, the device is reachable on the same
TT

ip address as used before the reset.


P

When the Type parameter is not present in the URL, the default value of the Type is 0.
AP

4.6.27 Get Tracing Code of Device


IV

Table 4-62
2.

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getTracingCode
89

Method GET
Description Get the tracing code of the device.
fo

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getTracingCode
r1

Success
tc=0001...1101
Return
00

Only system default admin can get it.


Comment
tc is a 64bit binary string.
M
EG

4.7 Network
A

4.7.1 Get Network Interfaces


Di
st

Table 4-63
rib

Syntax http://<server>/cgi-bin/netApp.cgi?action=getInterfaces
Method GET
ut

Description Get all of the system network interfaces.


io

Example http://192.168.1.108/cgi-bin/netApp.cgi?action=getInterfaces
n

netInterface[0].Name=eth0
netInterface[0].Type=Normal
s.r

netInterface[0].Valid=true
.o

Success …
Return netInterface[1].Name=3g
.

netInterface[1].Type=Auto,WCDMA,TD-SCDMA,TD-LTE,FDD-LTE
netInterface[1].Valid=true

Comment result item value:

General APIs 58
Name: network interface name.
"eth0" - wired network interface
"eth2" - wireless network interface
"3G" - 3G network interface
"bond0" - bond network interface
"bond1" - bond network interface
Not listed in detail
Da

Type: Network types that support settings


hu

"Normal" — wired network


"Wireless" — wireless network
aH

"Auto", "TD-SCDMA", "WCDMA", "CDMA1x", "EDGE", "EVDO", "TD-LTE", "FDD-LTE",


"NR" — 3G network types.
TT
P

Valid: network interface is valid if netInterface[n].Valid is true.


AP

4.7.2 Network Basic Config


IV

 Get network config


2.

Table 4-64
89

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Network
Method GET
fo

Get network basic config. The basic config contains basic network parameters (default
Description
r1

interface, domain name, host name), and configuration of each network interface.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Network
00

table.Network.DefaultInterface=eth0
M

table.Network.Domain=ttt
table.Network.Hostname=badak
EG

table.Network.interface.DefaultGateway=10.7.0.1
table.Network.interface.DhcpEnable=false
A

Success
table.Network.interface.DnsServers[0]=221.123.33.228
Di

Return
table.Network.interface.DnsServers[1]=221.12.1.228
st

table.Network.interface.IPAddress=10.7.2.3
rib

table.Network.interface.MTU=1500
table.Network.interface.PhysicalAddress=00:10:5c:f2:1c:b4
ut

table.Network.interface.SubnetMask=255.255.0.0
Comment interface in response is network interface name, such as eth0, eth2…
io

 Set network config


n
s.r

Table 4-65
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
.o

alue>[&<paramName>=<paramValue>…]
.

Method GET
Description Set network basic config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetWork.Domain=ttt
Example
&NetWork.eth0.DhcpEnable=true
Success OK

General APIs 59
Return
Comment interface in below ParamName is network interface name, such as eth0 and eth2

Appendix:

ParamName ParamValue type Description


Set default network interface when
multiple interfaces exist.
Da

Network.DefaultInterface string
Range of interfaces is depends on
GetInterfaces.
hu

Network.Domain string Domain name.


aH

Hostname and Domain compose a


Network.Hostname string
network address.
TT

Network.interface.DefaultGateway string IP address.


Network.interface.DhcpEnable bool Enable/Disable DHCP.
P

Network.interface.DnsServers[0] string IP address of first DNS server.


AP

Network.interface.DnsServers[1] string IP address of second DNS server.


Network.interface.IPAddress string Interface IP address.
IV

Network.interface.MTU integer Interface MTU.


MAC address of interface.
2.

HEX string in the form of:


89

xx:xx:xx:xx:xx:xx.
Network.interface.PhysicalAddress string Range of x is [0-9, a-f, A-F]
fo

Example:
r1

00:10:5c:f2:1c:b4
00:10:5C:F2:1C:B5
00

Network mask string:


In the form of x.x.x.x, range of x is [0-255]
M

Network.interface.SubnetMask string
Example:
EG

255.255.255.0
Enable/Disable
A

Network.interface.EnableDhcpReserv
bool when dhcp failed, it will continue sending
edIP
Di

dhcp request, if it was enabled.


st

4.7.3 PPPoE
rib
ut

 Get PPPoE config


io

Table 4-66
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PPPoE
n

Method GET
s.r

Description Get PPPoE config.


.o

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PPPoE
table.PPPoE.Enable=true,
.

table.PPPoE.AuthType[0]=PAP,
Success
table.PPPoE.UserName=hz150260,
Return
table.PPPoE.Password=Dont Know,
table.PPPoE.Mode=Default,

General APIs 60
table.PPPoE.Eth=eth0,
table.PPPoE.DefaultPPPoEInterface=ppp0,
table.PPPoE.PPPOE1.Enable=true,
table.PPPoE.PPPOE1.AuthType[0]=PAP,
table.PPPoE.PPPOE1.UserName=hz150260,
table.PPPoE.PPPOE1.Password=Don’t Know,
table.PPPoE.PPPOE1.Mode=Custom,
Da

table.PPPoE.PPPOE1.Eth=eth1
Comment —
hu

 Set PPPoE config


aH

Table 4-67
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
TT

Syntax
alue>[&<paramName>=<paramValue>…]
P

Method GET
AP

Description Set PPPoE config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PPPoE.UserName=
Example
IV

user1&PPPoE.Password=123456
Success
2.

OK
Return
89

Comment —
fo

Appendix:
r1

ParamName ParamValue type Description


PPPoE.Enable bool Enable/Disable PPPoE.
00

PPPoE.UserName string PPPoE user name.


PPPoE.Password string PPPoE user password.
M
EG

4.7.4 DDNS
A

 Get DDNS config


Di

Table 4-68
st

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=DDNS
rib

Method GET
Description Get DDNS config.
ut

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=DDNS
io

Success table.DDNS[index].Address=www.ttt.com
n

Return table.DDNS[index].Enable=true
table.DDNS[index].HostName=www.ttt.com
s.r

table.DDNS[index].KeepAlive=10
.o

table.DDNS[index].Password=none
table.DDNS[index].Port=5050
.

table.DDNS[index].Protocol= Quick DDNS


table.DDNS[index].UserName=user1
table.DDNS[index].DefaultHostName.Enable=false
table.DDNS[index].DefaultHostName.HostName=9002A9D77133.quickddns.com

General APIs 61
Comment index in response is the DDNS protocol table index, start from 0.
The meaning of parameters can refer to SetDDNSConfig chapter.
 Set DDNS config

Table 4-69
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
Da

Method GET
Description Set DDNS config.
hu

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&DDNS[0].Address=w
ww.ttt.com&DDNS[0].Enable=true
aH

Success OK
Return
TT

Comment index in below ParamName is the DDNS protocol table index, start from 0.
P

Appendix:
AP

ParamName ParamValue type Description


IV

DDNS[index].Address string DDNS server IP address or name.


Multiple DDNS hostname can be configured,
2.

DDNS[index].Enable bool but Only one hostname can be enabled,


89

others should be disabled.


DDNS[index].HostName String Hostname of this device.
fo

Range is [1—65535].
DDNS[index].KeepAlive integer
Unit is minutes.
r1

DDNS[index].Password string DDNS user password


00

Range is [1—65535].
DDNS[index].Port integer
Port of DDNS server
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

General APIs 62
ParamName ParamValue type Description
DDNS protocol type.
Range is {
"PRIVATE DDNS": 大华一代
"Private DDNS": 大华二代(使用 quickddns 域
名)
"CN99 DDNS"
Da

"NO-IP DDNS"
"Dyndns DDNS"
hu

"LUPUS DDNS"
"Oray DDNS"
aH

"CP Plus DDNS"


"Ipplus DDNS"
TT

"Q-See DDNS"
P

"SYSDNS DDNS"
AP

"Videotrend DDNS"
"CEPSA DDNS"
IV

"G4IP DDNS"
"HOSS DDNS"
2.

DDNS[index].Protocol string
"Intelbras DDNS"
89

"HSY DDNS"
"Flir DDNS"
fo

"Private P2P DDNS": 大华 P2P 设备注册


"Mivigilante DDNS": 西班牙 DDNS
r1

"ByDemes DDNS"
00

"DYNDNS OLD DDNS": 针对存储 dyndns 协



M

"WATASHI DDNS"
EG

"CNB DDNS": 韩国 CNB DDNS


"Peoplefu DDNS": 泰国 PeopleFu DDNS
A

"MINT DDNS"
"SPECO DDNS"
Di

"SHANY DDNS"
st

"WITHCCTV DDNS": "AMCREST DDNS"


rib

"SONIC DDNS": 印度松下 DDNS


"KBVISION DDNS": 越南 kbvision
ut

"BOSCH DDNS": 博世 DDNS}.


io

DDNS[index].UserName string DDNS user name


n

Only protocol is in range {"Private DDNS",


DDNS[index].DefaultHostName "DHDDNS", "QUICK DDNS"}, it effects.
s.r

bool
.Enable true : use the DefaultHostName.HostName
.o

false: use the HostName


DDNS[index].DefaultHostName
.

string The default hostname. It cannot be modified.


.HostName

General APIs 63
4.7.5 Email
 Get email config

Table 4-70
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Email
Method GET
Da

Description Get Email config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Email
hu

table.Email.Address=www.ttt.com
aH

table.Email.Anonymous=true
table.Email.AttachEnable=true
table.Email.Enable=true
TT

table.Email.HealthReport.Enable=false
P

table.Email.HealthReport.Interval=61
AP

table.Email.Password=123456
table.Email.Port=26
IV

table.Email.Receivers[0]=x@tttt.com
Success
table.Email.Receivers[1]=y@ttt.com
2.

Return
table.Email.Receivers[2]=z@ttt.com
89

table.Email.SendAddress=x@ttt.com
table.Email.SslEnable=false
fo

table.Email.TlsEnable=false
table.Email.Authentication=false
r1

table.Email.OnlyAttachment=false
00

table.Email.SendInterv=10
table.Email.Title=DVRMessage
M

table.Email.UserName=anonymity
EG

Comment —
 Set email config
A

Table 4-71
Di

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
st

alue>[&<paramName>=<paramValue>…]
rib

Method GET
Description Set Email config.
ut

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Email.Address=mail.
Example
ttt.com&Email.Anonymous=false
io

Success
n

OK
Return
s.r

Comment —
.o

Appendix:
.

ParamName ParamValue type Description


Email.Address string SMTP server IP address or name.
Email.Anonymous bool Enable/Disable anonymous email.
Email.AttachEnable bool Enable/Disable email attachment

General APIs 64
ParamName ParamValue type Description
Email.AttachmentEnable bool Enable/Disable email attachment
Email.Enable bool Enable/Disable email function
Email.HealthReport.Enable bool Enable/Disable report device status by email.
Range is [30-1440].
Email.HealthReport.Interval integer
Unit is minutes
Email.Password string User password of email account.
Da

Email.Port integer Range is [1-65535]


Email.Receivers[0] string
hu

Email.Receivers[1] string Email addresses of 3 receivers.


aH

Email.Receivers[2] string
Email.SendAddress string Sender email address.
TT

Email.SslEnable bool True: enable SSL email.


Email.Title string Title of email.
P

Email.UserName string User name of email account.


AP

4.7.6 WLan
IV

Get WLan config


2.


89

Table 4-72
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=WLan
fo

Method GET
Description Get Wlan config.
r1

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=WLan
00

table.WLan.eth2.Enable=true
table.WLan.eth2.Encryption=off
M

table.WLan.eth2.KeyFlag=false
EG

table.WLan.eth2.KeyID=0
table.WLan.eth2.KeyType=Hex
Success
A

table.WLan.eth2.Keys[0]=password1
Return
Di

table.WLan.eth2.Keys[1]=password2
table.WLan.eth2.Keys[2]=password3
st

table.WLan.eth2.Keys[3]=password4
rib

table.WLan.eth2.LinkMode=Auto
table.WLan.eth2.SSID=ttt
ut

Comment —
io

 Set WLan config


n

Table 4-73
s.r

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
.o

Method GET
.

Description Set WLan config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&WLan.eth2.Enable=t
Example
rue&WLan.eth2.KeyType=Hex
Success OK

General APIs 65
Return
Comment In below ParamName, interface is name of wireless interface.

Appendix:

ParamName ParamValue type Description


WLan.interface.Enable bool True: Enable WLan on this interface.
Range is {Off, On, WEP64Bits, WEP128Bits,
Da

WLan.interface.Encryption string WPA-PSK-TKIP, WPA-PSK-CCMP}


Encryption mode.
hu

WLan.interface.KeyFlag bool true: key is configured.


aH

Range is [0—3]
WLan.interface.KeyID integer Indicates which key is used.
TT

0: WLan.interface.Keys[0] is used.
WLan.interface.KeyType string Range is {Hex, ASCII]
P

WLan.interface.Keys[0] string For ASCII key type: 64bits encryption key length is 5,
AP

WLan.interface.Keys[1] string 128bits encryption key length is 13, consists of [0—9,


WLan.interface.Keys[2] string a—z, A—Z]
IV

For HEX key type: 64bits encryption key length is 10,


WLan.interface.Keys[3] string 128bits encryption key length is 26, consists of [0—9,
2.

a—z, A—Z]
89

Range is {Auto, Ad-hoc, and Infrastructure}.


Auto – select suitable mode automatically.
fo

Ad-hoc – Device with wireless network adapter can


r1

WLan.interface.LinkMode string connect to each other without Access Point.


Infrastructure – Integrate wire and wireless LAN
00

together to share network resource, access point is


need in this mode.
M

WLan.interface.SSID string SSID.


EG

4.7.7 Scan Wlan Devices


A
Di

Table 4-74
http://<server>/cgi-bin/wlan.cgi?action=scanWlanDevices&<paramName>=<paramVal
st

Syntax
ue>[&<paramName>=<paramValue>…]
rib

Method GET
ut

Description Search Wi-Fi device information.


http://192.168.1.108/cgi-bin/wlan.cgi?action=scanWlanDevices&SSID=xia_yuguo
io

Example
13098 Internet
n

found=1
s.r

wlanDevice[0].ApConnected=0
wlanDevice[0].ApMaxBitRate=54000000
.o

Success wlanDevice[0].ApNetWorkType=255
.

Return wlanDevice[0].AuthMode=7
wlanDevice[0].BSSID=28:2c:b2:5c:de:36
wlanDevice[0].EncrAlgr=3
wlanDevice[0].LinkMode=0

General APIs 66
wlanDevice[0].LinkQuality=31
wlanDevice[0].RSSIQuality=0
wlanDevice[0].SSID=xia_yuguo 13098 Internet
Comment —

Appendix:

ParamName ParamValue type Description


Da

Specified SSID, if not include any SSID, all Wi-Fi information


SSID string
will be searched and displayed.
hu

4.7.8 UPnP
aH

Get UPnP config


TT

Table 4-75
P

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=UPnP
AP

Method GET
Description Get UPnP config.
IV

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=UPnP
2.

Success table.UPnP.Enable=true
89

Return table.UPnP.MapTable[index].Enable=true
table.UPnP.MapTable[index].InnerPort=80
fo

table.UPnP.MapTable[index].OuterPort=8080
table.UPnP.MapTable[index].Protocol=TCP
r1

table.UPnP.MapTable[index].ServiceName=HTTP
Comment index in response is the UPNP map table index, start from 0.
00

 Set UPnP config


M

Table 4-76
EG

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
A

Method GET
Di

Description Set UPnP config.


st

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UPnP.Enable=true&
UPnP.MapTable[0].Protocol=TCP
rib

Success OK
ut

Return
Comment index in below ParamName is UPNP map table index, range is [0-255]
io
n

Appendix:
s.r

ParamName ParamValue type Description


UPnP.Enable bool Enable/Disable UPNP feature.
.o

UPnP.MapTable[index].Enable bool Enable/Disable this UPNP map.


.

Range is [1—65535].
UPnP.MapTable[index].InnerPort integer
Inner port number
Range is [1—65535].
UPnP.MapTable[index].OuterPort integer
Outer port number.

General APIs 67
ParamName ParamValue type Description
UPnP.MapTable[index].Protocol string Range is {TCP, UDP]
UPnP.MapTable[index].ServiceName string User defined UPnP service name.

4.7.9 Get UPnP Status


Table 4-77
Da

Syntax http://<server>/cgi-bin/netApp.cgi?action=getUPnPStatus
Method GET
hu

Description Get UPnP Status.


aH

Example http://192.168.1.108/cgi-bin/netApp.cgi?action=getUPnPStatus
status.InnerAddress=0.0.0.0
TT

status.OuterAddress=0.0.0.0
status.PortMapStatus[0]=Failed
P

Success status.PortMapStatus[1]=Failed
AP

Return status.PortMapStatus[2]=Failed
status.PortMapStatus[3]=Failed
IV

status.Status=Unknown
status.Working=false
2.

Comment —
89

4.7.10 NTP
fo
r1

 Get NTP config


00

Table 4-78
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NTP
M

Method GET
Description Get NTP config
EG

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NTP
A

table.NTP.Address=clock.isc.org
table.NTP.Enable=false
Di

table.NTP.Port=38
st

table.NTP.TimeZone=9
rib

Success table.NTP.UpdatePeriod=31
Return table.NTP.ServerList[0].Enable=true,
ut

table.NTP.ServerList[0].Address=192.168.1.108,
io

table.NTP.ServerList[0].Port=123
table.NTP.Tolerance=5,
n

table.NTP.TimeZoneDesc=Beijing
s.r

Comment —
.o

 Set NTP config


.

Table 4-79
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
Method GET

General APIs 68
Description Set NTP config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NTP.Address=time.tt
Example
t.com&NTP.Enable=true
Success
OK
Return
Comment —
Da

4.7.11 RTSP
hu

 Get RTSP config


aH

Table 4-80
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RTSP
TT

Method GET
Description Get RTSP config.
P

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RTSP
AP

table.RTSP.Enable=true
Success table.RTSP.Port=554
IV

Return table.RTSP.RTP.EndPort=40000
2.

table.RTSP.RTP.StartPort=20000
89

Comment —
 Set RTSP config
fo

Table 4-81
r1

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
00

Method GET
Description Set RTSP config.
M

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RTSP.Enable=true&
EG

Example
RTSP.Port=554
Success
A

OK
Return
Di

Comment —
st

Appendix:
rib

ParamName ParamValue type Description


ut

RTSP.Enable bool Enable/Disable RTSP.


RTSP.Port integer RTSP port.
io

RTSP.RTP.StartPort integer RTP start port.


n

RTSP.RTP.EndPort integer RTP end port.


s.r

4.7.12 Alarm Server


.o
.

 Get alarm server config

Table 4-82
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AlarmServer
Method GET

General APIs 69
Description Get alarm server config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AlarmServer
table.AlarmServer.Address=10.7.8.9
table.AlarmServer.Enable=false
table.AlarmServer.Password=
Success table.AlarmServer.Port=8888
Return table.AlarmServer.Protocol=ttt
Da

table.AlarmServer.ReportTime=02:00:00
table.AlarmServer.ReportWeekDay=2
hu

table.AlarmServer.UserName=admin
aH

Comment —
 Set alarm server config
TT

Table 4-83
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
P

Syntax
Value>[&<paramName>=<paramValue>…]
AP

Method GET
Description Set Alarm Server config.
IV

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmServer.Addres
Example
2.

s=as.ttt.com&AlarmServer.Enable=false
89

Success
OK
Return
fo

Comment —
r1

Appendix:
00

ParamName ParamValue type Description


AlarmServer.Address string Alarm server IP address or name.
M

AlarmServer.Enable bool Enable/Disable Alarm server.


EG

Range is [1—65535].
AlarmServer.Port integer
Port of Alarm server.
A

4.8 Motion Detection


Di
st

4.8.1 Motion Detection Settings


rib
ut

 Get motion detect config


io

Table 4-84
Syntax
n

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
Method GET
s.r

Description Motion detect config of a video channel contains Enable, MotionDetectWindow and
.o

EventHandler.
Example
.

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
Success table.MotionDetect[0].Enable=false
Return table.MotionDetect[0].EventHandler.AlarmOut=1
table.MotionDetect[0].EventHandler.AlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.AlarmOutEnable=true

General APIs 70
table.MotionDetect[0].EventHandler.AlarmOutLatch=10
table.MotionDetect[0].EventHandler.BeepEnable=false
table.MotionDetect[0].EventHandler.Dejitter=5
table.MotionDetect[0].EventHandler.Delay=0
table.MotionDetect[0].EventHandler.ExAlarmOut=1
table.MotionDetect[0].EventHandler.ExAlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.ExAlarmOutEnable=false
Da

table.MotionDetect[0].EventHandler.FlashEnable=false
table.MotionDetect[0].EventHandler.FlashLatch=10
hu

table.MotionDetect[0].EventHandler.LogEnable=true
aH

table.MotionDetect[0].EventHandler.MailEnable=false
table.MotionDetect[0].EventHandler.Matrix=1
table.MotionDetect[0].EventHandler.MatrixChannels[0]=0
TT

table.MotionDetect[0].EventHandler.MatrixEnable=false
P

table.MotionDetect[0].EventHandler.MessageEnable=false
AP

table.MotionDetect[0].EventHandler.PtzLink[0][0]=None
table.MotionDetect[0].EventHandler.PtzLink[0][1]=1
IV

table.MotionDetect[0].EventHandler.PtzLinkEnable=false
table.MotionDetect[0].EventHandler.Record=1
2.

table.MotionDetect[0].EventHandler.RecordChannels[0]=0
89

table.MotionDetect[0].EventHandler.RecordEnable=true
table.MotionDetect[0].EventHandler.RecordLatch=10
fo

table.MotionDetect[0].EventHandler.Snapshot=1
r1

table.MotionDetect[0].EventHandler.SnapshotChannels[0]=0
table.MotionDetect[0].EventHandler.SnapshotEnable=false
00

table.MotionDetect[0].EventHandler.TimeSection[0][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][1]=0 00:00:00-23:59:59
M

table.MotionDetect[0].EventHandler.TimeSection[0][2]=0 00:00:00-23:59:59
EG

table.MotionDetect[0].EventHandler.TimeSection[0][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[0][4]=0 00:00:00-23:59:59
A

table.MotionDetect[0].EventHandler.TimeSection[0][5]=0 00:00:00-23:59:59
Di

table.MotionDetect[0].EventHandler.TimeSection[1][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][1]=0 00:00:00-23:59:59
st

table.MotionDetect[0].EventHandler.TimeSection[1][2]=0 00:00:00-23:59:59
rib

table.MotionDetect[0].EventHandler.TimeSection[1][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[1][4]=0 00:00:00-23:59:59
ut

table.MotionDetect[0].EventHandler.TimeSection[1][5]=0 00:00:00-23:59:59
io

table.MotionDetect[0].EventHandler.TimeSection[2][0]=1 00:00:00-23:59:59
n

table.MotionDetect[0].EventHandler.TimeSection[2][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][2]=0 00:00:00-23:59:59
s.r

table.MotionDetect[0].EventHandler.TimeSection[2][3]=0 00:00:00-23:59:59
.o

table.MotionDetect[0].EventHandler.TimeSection[2][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[2][5]=0 00:00:00-23:59:59
.

table.MotionDetect[0].EventHandler.TimeSection[3][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][3]=0 00:00:00-23:59:59

General APIs 71
table.MotionDetect[0].EventHandler.TimeSection[3][4]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[3][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][0]=1 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[4][4]=0 00:00:00-23:59:59
Da

table.MotionDetect[0].EventHandler.TimeSection[4][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][0]=1 00:00:00-23:59:59
hu

table.MotionDetect[0].EventHandler.TimeSection[5][1]=0 00:00:00-23:59:59
aH

table.MotionDetect[0].EventHandler.TimeSection[5][2]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[5][4]=0 00:00:00-23:59:59
TT

table.MotionDetect[0].EventHandler.TimeSection[5][5]=0 00:00:00-23:59:59
P

table.MotionDetect[0].EventHandler.TimeSection[6][0]=1 00:00:00-23:59:59
AP

table.MotionDetect[0].EventHandler.TimeSection[6][1]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][2]=0 00:00:00-23:59:59
IV

table.MotionDetect[0].EventHandler.TimeSection[6][3]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][4]=0 00:00:00-23:59:59
2.

table.MotionDetect[0].EventHandler.TimeSection[6][5]=0 00:00:00-23:59:59
89

table.MotionDetect[0].EventHandler.TipEnable=false
table.MotionDetect[0].EventHandler.Tour=1
fo

table.MotionDetect[0].EventHandler.TourChannels[0]=0
r1

table.MotionDetect[0].EventHandler.TourEnable=false
table.MotionDetect[0].EventHandler.Voice.AudioFileName=
00

table.MotionDetect[0].EventHandler.VoiceEnable=false
table.MotionDetect[0].MotionDetectWindow[0].Id=0
M

table.MotionDetect[0].MotionDetectWindow[0].Name=Region1
EG

table.MotionDetect[0].MotionDetectWindow[0].Region[0]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[1]=4194303
A

table.MotionDetect[0].MotionDetectWindow[0].Region[2]=4194303
Di

table.MotionDetect[0].MotionDetectWindow[0].Region[3]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[4]=4194303
st

table.MotionDetect[0].MotionDetectWindow[0].Region[5]=4194303
rib

table.MotionDetect[0].MotionDetectWindow[0].Region[6]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[7]=4194303
ut

table.MotionDetect[0].MotionDetectWindow[0].Region[8]=4194303
io

table.MotionDetect[0].MotionDetectWindow[0].Region[9]=4194303
n

table.MotionDetect[0].MotionDetectWindow[0].Region[10]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[11]=4194303
s.r

table.MotionDetect[0].MotionDetectWindow[0].Region[12]=4194303
.o

table.MotionDetect[0].MotionDetectWindow[0].Region[13]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[14]=4194303
.

table.MotionDetect[0].MotionDetectWindow[0].Region[15]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[16]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[17]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Sensitive=60

General APIs 72
table.MotionDetect[0].MotionDetectWindow[0].Threshold=5
table.MotionDetect[0].MotionDetectWindow[0].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[0].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[0].Window[2]=8191
table.MotionDetect[0].MotionDetectWindow[0].Window[3]=8191
table.MotionDetect[0].MotionDetectWindow[1].Id=1
table.MotionDetect[0].MotionDetectWindow[1].Name=Region2
Da

table.MotionDetect[0].MotionDetectWindow[1].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[1]=0
hu

table.MotionDetect[0].MotionDetectWindow[1].Region[2]=0
aH

table.MotionDetect[0].MotionDetectWindow[1].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[5]=0
TT

table.MotionDetect[0].MotionDetectWindow[1].Region[6]=0
P

table.MotionDetect[0].MotionDetectWindow[1].Region[7]=0
AP

table.MotionDetect[0].MotionDetectWindow[1].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[9]=0
IV

table.MotionDetect[0].MotionDetectWindow[1].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[11]=0
2.

table.MotionDetect[0].MotionDetectWindow[1].Region[12]=0
89

table.MotionDetect[0].MotionDetectWindow[1].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[14]=0
fo

table.MotionDetect[0].MotionDetectWindow[1].Region[15]=0
r1

table.MotionDetect[0].MotionDetectWindow[1].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[17]=0
00

table.MotionDetect[0].MotionDetectWindow[1].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[1].Threshold=5
M

table.MotionDetect[0].MotionDetectWindow[1].Window[0]=0
EG

table.MotionDetect[0].MotionDetectWindow[1].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[2]=0
A

table.MotionDetect[0].MotionDetectWindow[1].Window[3]=0
Di

table.MotionDetect[0].MotionDetectWindow[2].Id=2
table.MotionDetect[0].MotionDetectWindow[2].Name=Region3
st

table.MotionDetect[0].MotionDetectWindow[2].Region[0]=0
rib

table.MotionDetect[0].MotionDetectWindow[2].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[2]=0
ut

table.MotionDetect[0].MotionDetectWindow[2].Region[3]=0
io

table.MotionDetect[0].MotionDetectWindow[2].Region[4]=0
n

table.MotionDetect[0].MotionDetectWindow[2].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[6]=0
s.r

table.MotionDetect[0].MotionDetectWindow[2].Region[7]=0
.o

table.MotionDetect[0].MotionDetectWindow[2].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[9]=0
.

table.MotionDetect[0].MotionDetectWindow[2].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[13]=0

General APIs 73
table.MotionDetect[0].MotionDetectWindow[2].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[2].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[2].Threshold=5
table.MotionDetect[0].MotionDetectWindow[2].Window[0]=0
Da

table.MotionDetect[0].MotionDetectWindow[2].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[2]=0
hu

table.MotionDetect[0].MotionDetectWindow[2].Window[3]=0
aH

table.MotionDetect[0].MotionDetectWindow[3].Id=3
table.MotionDetect[0].MotionDetectWindow[3].Name=Region4
table.MotionDetect[0].MotionDetectWindow[3].Region[0]=0
TT

table.MotionDetect[0].MotionDetectWindow[3].Region[1]=0
P

table.MotionDetect[0].MotionDetectWindow[3].Region[2]=0
AP

table.MotionDetect[0].MotionDetectWindow[3].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[4]=0
IV

table.MotionDetect[0].MotionDetectWindow[3].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[6]=0
2.

table.MotionDetect[0].MotionDetectWindow[3].Region[7]=0
89

table.MotionDetect[0].MotionDetectWindow[3].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[9]=0
fo

table.MotionDetect[0].MotionDetectWindow[3].Region[10]=0
r1

table.MotionDetect[0].MotionDetectWindow[3].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[12]=0
00

table.MotionDetect[0].MotionDetectWindow[3].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[14]=0
M

table.MotionDetect[0].MotionDetectWindow[3].Region[15]=0
EG

table.MotionDetect[0].MotionDetectWindow[3].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[17]=0
A

table.MotionDetect[0].MotionDetectWindow[3].Sensitive=60
Di

table.MotionDetect[0].MotionDetectWindow[3].Threshold=5
table.MotionDetect[0].MotionDetectWindow[3].Window[0]=0
st

table.MotionDetect[0].MotionDetectWindow[3].Window[1]=0
rib

table.MotionDetect[0].MotionDetectWindow[3].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[3]=0
ut

table.MotionDetect[0].OsdTwinkleEnable=false
io

table.MotionDetect[0].PirMotionLevel=3
Comment —
n

 Set motion detect config


s.r

Table 4-85
.o

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
.

alue>[&<paramName>=<paramValue>…]
Method GET
Description Set motion detection config.
Example Enable motion detection:

General APIs 74
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Ena
ble=true

Set motion detection regions:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Moti
onDetectWindow[0].Region[0]=1&MotionDetect[0].MotionDetectWindow[0].Region[1]=
1&MotionDetect[0].MotionDetectWindow[0].Region[2]=1&MotionDetect[0].MotionDetec
Da

tWindow[0].Region[3]=1&MotionDetect[0].MotionDetectWindow[0].Region[4]=1&Motion
Detect[0].DetectVersion=V3.0
hu

Success
OK
Return
aH

In table below,
head = MotionDetect[ChannelNo]
TT

ChannelNo: integer, array index starts from 0, which means video channel(equals to
P

video channel index -1, and so 0 means channel 1).


AP

LineNum
Index of region, region is divided into lines and each line has several blocks, a line is
IV

described by a 32 bit integer, a bit for a block.


0=Line 1
2.

Comment 1=Line 2
89


WinNum
fo

Index of detect window, there are 4 detect windows at present. Each window is divided
into 18 lines and 22 blocks per line.
r1
00

Notice: When setting


"MotionDetect[ChannelNo].MotionDetectWindow[WinNum].Region", you need to
M

contain the parameter "MotionDetect[ChannelNo].DetectVersion=V3.0" along.


EG

Appendix:
A

ParamName ParamValue type Description


Di

head.Enable bool Enable/Disable motion detect feature in a channel.


Enable/Disable manual control Ptz, only for Hahua
st

head.PtzManualEnable bool
devices
rib

head.OsdTwinkleEnabl Osd Twinkle Enable


bool
e default : false
ut

head.Row integer motion detect row number


io

head.Col integer motion detect colum number


n

head.Level integer sensitive ,range 1-6


s.r

head.TimeDivide. array<array<strin
TimeSchedule
.o

TimeSchedule g>>
head.TimeDivide.Level integer sensitive in timesection, different with global sensitive.
.

head.DetectVersion string detect version


head.PirMotionEnable bool Customized Pir Motion Enable
head.PirMotionLevel integer Customized Pir Motion sensitive level

General APIs 75
ParamName ParamValue type Description
head.VolumeRatio integer Area occupancy ratio
head.SubRatio integer SubRatio
head.Region array<integer> Region
Setting of EventHandler is described in
head.EventHandler —
SetEventHandler.
Da

head.MotionDetectWin
integer It is the Id of a detect window.
dow [WinNum].Id
hu

head.MotionDetectWin
string It is the name of a detect window.
dow [WinNum].Name
aH

head.MotionDetectWin Range is [0—100].


dow[WinNum].Sensitiv integer Sensitivity of motion detection.
TT

e It presents more sensitive if the value is larger.


head.MotionDetectWin Range is [0—100].
P

dow[WinNum].Threshol integer It presents the threshold value when trigger motion


AP

d detect.
It is similar with head.Region [LineNum].
IV

Currently, a region is divided into 18 lines and 22 blocks


2.

per line.
89

A bit describes a block in the line.


Bit = 1: motion in this block is monitored.
head.MotionDetectWin
fo

Example:
dow[WinNum].Region[ integer
MotionDetect [0].Region [0] = 4194303 (0x3FFFFF): the
r1

LineNum]
22 blocks in channel 0 line 0 is monitored.
MotionDetect [0].Region [1] =0: the 22 blocks in channel
00

0 line 1 is not monitored.


M

MotionDetect [0].Region [17] = 3: the left two blocks in


the last line of channel 0 is monitored.
EG

4.9 Event
A
Di

4.9.1 Event Handler


st
rib

 Get event handler config


ut

Table 4-86
Syntax
io

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=<handlerName>
Method GET
n

Description Get event handler settings.


s.r

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Alarm[0].Eve
Example
.o

ntHandler
handlerName.EventHandler.AlarmOutChannels[0]=1
.

handlerName.EventHandler.AlarmOutChannels[1]=1
Success

Return
handlerName.EventHandler.AlarmOutEnable=false
handlerName.EventHandler.AlarmOutLatch=10

General APIs 76
handlerName.EventHandler.BeepEnable=true
handlerName.EventHandler.Dejitter=0
handlerName.EventHandler.Delay=30
handlerName.EventHandler.LogEnable=true
handlerName.EventHandler.MailEnable=true
handlerName.EventHandler.PtzLink[0][0]=None
handlerName.EventHandler.PtzLink[0][1]=0
Da

handlerName.EventHandler.PtzLink[1][0]=None
handlerName.EventHandler.PtzLink[1][1]=0
hu


aH

handlerName.EventHandler.PtzLinkEnable=false
handlerName.EventHandler.RecordChannels[0]=1
handlerName.EventHandler.RecordChannels[1]=2
TT


P

handlerName.EventHandler.RecordEnable=true
AP

handlerName.EventHandler.RecordLatch=10
handlerName.EventHandler.SnapshotChannels[0]=1
IV

handlerName.EventHandler.SnapshotChannels[1]=1

2.

handlerName.EventHandler.SnapshotEnable=false
89

handlerName.EventHandler.SnapshotPeriod=3
handlerName.EventHandler.SnapshotTimes=0
fo

handlerName.EventHandler.TimeSection[0][0]=1 01:00:00-24:00:00
r1

handlerName.EventHandler.TimeSection[0][1]=1 01:00:00-24:00:00…

00

handlerName.EventHandler.TimeSection[6][5]=1 01:00:00-24:00:00
handlerName.EventHandler.TipEnable=true
M

handlerName.EventHandler.ExAlarmOutEnable=true
EG

handlerName.EventHandler.Enable=true,
handlerName.EventHandler.FilckerLightType=WhiteLight,
A

handlerName.EventHandler.LightLinkType=Filcker,
Di

handlerName.EventHandler.FilckerIntevalTime=5,
handlerName.EventHandler.FilckerTimes=5,
st

handlerName.EventHandler.LightDuration=10,
rib

handlerName.EventHandler.WhiteLightTimeSection=,
handlerName.EventHandler.LightBright=50
ut

handlerName.ExAlarmOutChannels[0] =2
io

handlerName.ExAlarmOutChannels[1]=3

n

Parameters in URL:
s.r

handlerName can be one of below four formats:


.o

Alarm[ChannelNo].EventHandler
Comment
MotionDetect[ChannelNo].EventHandler
.

BlindDetect[ChannelNo].EventHandler
LossDetect[ChannelNo].EventHandler
 Set event handler config

Table 4-87

General APIs 77
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Modify event handler settings.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].EventHandl
Example
er.AlarmOutChannels[0]=1&Alarm[0].EventHandler.AlarmOutEnable=true
Success
Da

OK
Return
Comment In below paramName, Meaning of handlerName is the same with GetEventHandler.
hu

Appendix:
aH

paramName paramValue type Description


TT

ch is alarm out channel index


which starts from 0. Range is {0,
P

1},
handlerName.EventHandler.AlarmOutChann
AP

integer 0 — do not output alarm at alarm


els[ch]
out channel ch
IV

1 — output alarm at alarm out


channel ch
2.

Enable/Disable alarm out


89

handlerName.EventHandler.AlarmOutEnable bool
function.
Range is [10—300].
fo

Unit is seconds, indicates the time


handlerName.EventHandler.AlarmOutLatch Integer
r1

to output alarm after input alarm


is cleared.
00

handlerName.EventHandler.BeepEnable bool Enable/Disable beep.


Range is [0—255].
M

Alarm signal dejitter seconds.


handlerName.EventHandler.Dejitter integer
EG

Alarm signal change during this


period is ignored.
A

Range is [0—300].
Di

handlerName.EventHandler.Delay integer Delay seconds before setting take


effect.
st

handlerName.EventHandler.LogEnable bool Enable/Disable log for alarm.


rib

Enable/Disable mail send for


handlerName.EventHandler.MailEnable bool
ut

alarm.
Range is {None, Preset, Tour,
io

Pattern}
n

This is PTZ action linked with


handlerName.EventHandler.PtzLink[ch][0] string
s.r

events.
ch is PTZ channel index which
.o

starts from 0.
.

General APIs 78
paramName paramValue type Description
This is the parameter of
PtzLink[ch][0],
If PtzLink[ch]][0] is
handlerName.EventHandler.PtzLink[ch][1] integer
Preset: this is preset point.
Tour: this is tour path number.
Pattern: this is pattern number.
Da

handlerName.EventHandler.PtzLinkEnable Bool Enable/Disable PTZ link.


handlerName.EventHandler.RecordChannels array<integer> record channel list
hu

handlerName.EventHandler.RecordEnable bool Enable/Disable record function.


aH

Range is [10—300].
Unit is seconds, indicates the time
handlerName.EventHandler.RecordLatch integer
to record after input alarm is
TT

cleared.
P

handlerName.EventHandler.SnapshotChann
array<integer> snapshot channel list
AP

els
Enable/Disable snapshot
handlerName.EventHandler.SnapshotEnable bool
IV

function.
Range is [0—255].
2.

Frames between snapshots.


89

handlerName.EventHandler.SnapshotPeriod integer
0 means continuously snapshot
for every frame.
fo

Range is [0—65535]
r1

handlerName.EventHandler.SnapshotTimes integer Snapshot times before stop, 0


means don't stop snapshot.
00

It's an effective time period for


eventHanlder everyday.
M

wd (week day) range is [0—6]


EG

(Sunday—Saturday)
ts (time section) range is [0-23],
A

it's index of time section table.


Di

Format: mask
st

hh:mm:ss-hh:mm:ss
rib

Mask: {0,1}, hh: [0—24], mm: [00


handlerName.EventHandler.TimeSection[wd]
String —59], ss: [00—59]
ut

[ts]
Mask 0: this time section is not
io

used.
n

Mask 1: this time section is used.


s.r

Example:
.o

TimeSection[1][0]=1
.

12:00:00-18:00:00
Means EventHandler is effective
between 12:00:00 and 18:00:00
at Monday.

General APIs 79
paramName paramValue type Description
Enable/Disable local message
handlerName.EventHandler.TipEnable bool
box tip.
handlerName.EventHandler.ExAlarmOutEna Enable/Disable extend alarm out
bool
ble ability
handlerName.EventHandler.LightingLink.Ena
bool Enable/Disable LightingLink
ble
Da

handlerName.EventHandler.LightingLink.Filc Filcker Light Type


String
kerLightType range : ”WhiteLight”
hu

handlerName.EventHandler.LightingLink.Ligh
string range : [“Filcker”, “KeepLighting”]
aH

tLinkType
handlerName.EventHandler.LightingLink.Filc Filcker Inteval Time
float
kerIntevalTime unit: 0.1s
TT

handlerName.EventHandler.LightingLink.Filc
integer Filcker Times
P

kerTimes
AP

handlerName.EventHandler.LightingLink.Ligh Light Duration


integer
tDuration unit: s
IV

handlerName.EventHandler.LightingLink.Whi array<array<string
teLightTimeSection >>
2.

handlerName.EventHandler.LightingLink.Ligh
89

integer brightness
tBright
handlerName.ExAlarmOutChannels[ch] integer extend alarm out channels
fo
r1

4.9.2 Alarm Event


00

 Get alarm config


M

Table 4-88
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Alarm
EG

Method GET
A

Description Get alarm config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Alarm
Di

table.Alarm[0].Enable=false
st

table.Alarm[0].EventHandler….(output of EventHandler is described in


rib

GetEventHandler)
Success
table.Alarm[0].Name=Door1
ut

Return
table.Alarm[0].SensorType=NC
io

table.Alarm[1]….

n

Comment —
s.r

 Set alarm config


.o

Table 4-89
.

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVal
Syntax
ue>[&<paramName>=<paramValue>…]
Method GET
Description Set alarm config.

General APIs 80
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].Enable=true
Success
OK
Return
In below ParamName, input is external alarm input channel which starts from 0.
Comment EventHandler defines parameter of relevant actions when alarm or event happens. It's
also used in following sections about events.
Da

Appendix:

ParamName ParamValue type Description


hu

Alarm[input].Enable bool Enable/Disable alarm from a input channel


aH

Setting of EventHandler is described in


Alarm[input].EventHandler —
SetEventHandler.
TT

Alarm[input].Name string Name of alarm input channel.


Range is {NC, NO].
P

Alarm[input].SensorType string NC: normal close


AP

NO: normal open


IV

4.9.3 Alarm Out


2.

 Get alarm out config


89

Table 4-90
fo

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AlarmOut
Method GET
r1

Description Get alarm out config.


00

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AlarmOut
Success table.AlarmOut[alarmOutChannel].Mode=0
M

Return table.AlarmOut[alarmOutChannel].Name=Beep
EG

Parameters in Response:
Comment
alarmOutChannel: the alarm out channel index which starts from 0.
A

 Set alarm out config


Di

Table 4-91
st

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
rib

Method GET
ut

Description Set alarm out config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[0].Mode=0
io

Example
&AlarmOut[0].Name=port1
n

Success
OK
s.r

Return
Comment port in below ParamName is alarm out port index, start form 0.
.o
.

Appendix:

ParamName ParamValue type Description

General APIs 81
ParamName ParamValue type Description
Range is {0, 1, 2}
0: automatically alarm
AlarmOut[port].Mode integer
1: force alarm
2: close alarm
AlarmOut[port].Name string Alarm out port name.
Da

4.9.4 Get Alarm Input Channels


hu

Table 4-92
aH

Syntax http://<server>/cgi-bin/alarm.cgi?action=getInSlots
Method GET
Description Get alarm input channel number.
TT

Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getInSlots
P

Success
result=2
AP

Return
Comment —
IV

4.9.5 Get Alarm Output Channels


2.
89

Table 4-93
Syntax http://<server>/cgi-bin/alarm.cgi?action=getOutSlots
fo

Method GET
r1

Description Get alarm output channel number.


Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getOutSlots
00

Success
result=1
Return
M

Comment —
EG

4.9.6 Get States of Alarm Input Channels


A
Di

Table 4-94
st

Syntax http://<server>/cgi-bin/alarm.cgi?action=getInState
Method GET
rib

Description Get alarm input state for all channels.


ut

Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getInState
Success
io

result=3
Return
n

A bit in the response result indicates a channel alarm states, result 3 means alarm
Comment
s.r

channel 1 and channel 2 have alarm now.


.o

4.9.7 Get States of Alarm Output Channels


.

Table 4-95
Syntax http://<server>/cgi-bin/alarm.cgi?action=getOutState
Method GET

General APIs 82
Description Get alarm output state for all channels.
Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getOutState
Success
result=0
Return
Comment A bit in the response result indicates a channel, result 1 means alarm is present.

4.9.8 Video Blind Event


Da

 Get video blind detect config


hu

Table 4-96
aH

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=BlindDetect
Method GET
TT

Description Get blind detect config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=BlindDetect
P

head.Enable=false
AP

Success
head.EventHandler= (output of EventHandler is described in GetEventHandler)
Return
head.Level=3
IV

Parameters in Response:
2.

head=table.BlindDetect[ChannelNo]
Comment
89

ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
fo

 Set video blind detect config


r1

Table 4-97
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
00

alue>[&<paramName>=<paramValue>…]
Method GET
M

Description Set blind detect config.


EG

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&BlindDetect[0].Enabl
Example
e=true
A

Success
OK
Di

Return
st

Parameters in URL:
In table below,
rib

Comment head=BlindDetect[ChannelNo]
ut

ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
io
n

Appendix:
s.r

ParamName ParamValue type Description


head.Enable bool Enable/Disable blind detect feature.
.o

Setting of EventHandler is described in


.

head.EventHandler —
SetEventHandler.

General APIs 83
ParamName ParamValue type Description
Range is [1—6].
Sensitivity of blind detection.
head.Level integer
1: lowest sensitivity.
6: highest sensitivity.

4.9.9 Video Loss Event


Da

 Get video loss detect config


hu

Table 4-98
aH

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LossDetect
Method GET
TT

Description Get video loss detect config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=LossDetect
P

Success head. Enable=false


AP

Return head. EventHandler= (output of EventHandler is described in GetEventHandler)


Parameters in Response:
IV

head=table.LossDetect [ChannelNo]
Comment
2.

ChannelNo: integer, array index starts from 0, which means video channel (equals to
89

video channel index -1, and so 0 means channel 1).


 Set video loss detect config
fo

Table 4-99
r1

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
00

Method GET
Description Set video loss detection config.
M

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LossDetect[0].Enabl
Example
EG

e=true
Success
A

OK
Return
Di

Parameters in URL:
st

In table below,
Comment head=LossDetect [ChannelNo]
rib

ChannelNo: integer, array index starts from 0, which means video channel(equals to
ut

video channel index -1, and so 0 means channel 1).


io

Appendix:
n

ParamName ParamValue type Description


s.r

head.Enable bool Enable/Disable loss detect feature.


Setting of EventHandler is described in
.o

head.EventHandler —
SetEventHandler.
.

4.9.10 Login Failure Event


 Get login failure event config

General APIs 84
Table 4-100
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LoginFailureAlarm
Method GET
Description Get login failure alarm config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=LoginFailureA
Example
larm
Success head.Enable=false
Da

Return head.EventHandler= (output of EventHandler is described in GetEventHandler)


Parameters in Response:
hu

Comment
head=table.LoginFailureAlarm
aH

 Set login failure alarm config

Table 4-101
TT

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
P

Method GET
AP

Description Set login failure alarm config.


IV

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LoginFailureAlarm.E
Example
nable=true
2.

Success
OK
89

Return
Parameters in URL:
fo

Comment In table below,


head=LoginFailureAlarm
r1

Appendix:
00

ParamName ParamValue type Description


M

Enable/Disable to notify LoginFailure event. Now this


EG

event can be linked with send email and alarm out. The
head.Enable bool
max try login times can be configured in chapter
A

SetGeneralConfig.
Setting of EventHandler is described in
Di

head.EventHandler —
SetEventHandler.
st
rib

4.9.11 Storage Not Exist Event


ut

 Get storage not exist event config


io

Table 4-102
n

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageNotExist
s.r

Method GET
Description Get storage not exist event config.
.o

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageNotE
Example
.

xist
table.StorageNotExist.Enable=false
Success
table.StorageNotExist.EventHandler= (output of EventHandler is described in
Return
GetEventHandler)

General APIs 85
Comment —
 Set storage not exist event config

Table 4-103
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Da

Description Set storage not exist event config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageNotExist.Ena
Example
hu

ble=true
Success
aH

OK
Return
Comment —
TT

Appendix:
P

ParamName ParamValue type Description


AP

StorageNotExist.Enable bool Enable/Disable loss detect feature.


IV

Setting of EventHandler is described in


StorageNotExist.EventHandler —
SetEventHandler.
2.
89

4.9.12 Storage Access Failure Event


fo

 Get storage access failure event config


r1

Table 4-104
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageFailure
00

Method GET
M

Description Get storage failure event config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageFailur
EG

Example
e
table.StorageFailure.Enable=false
A

Success
table.StorageFailure.EventHandler= (output of EventHandler is described in
Di

Return
GetEventHandler)
st

Comment —
rib

 Set storage access failure event config

Table 4-105
ut

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
io

alue>[&<paramName>=<paramValue>…]
n

Method GET
s.r

Description Set storage failure event config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageFailure.Enab
Example
.o

le=true
.

Success
OK
Return
Comment —

Appendix:

General APIs 86
ParamName ParamValue type Description
StorageFailure.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
StorageFailure.EventHandler —
SetEventHandler.

4.9.13 Storage Low Space Event


Da

 Get storage low space event config


hu

Table 4-106
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageLowSpace
aH

Method GET
Description Get storage low space event config.
TT

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageLowS
Example
P

pace
table.StorageLowSpace.Enable=false
AP

Success
table.StorageLowSpace.EventHandler= (output of EventHandler is described in
Return
IV

GetEventHandler)
Comment —
2.

 Set storage low space event config


89

Table 4-107
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
fo

Syntax
alue>[&<paramName>=<paramValue>…]
r1

Method GET
Description Set storage low space event config.
00

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageLowSpace.E
Example
M

nable=true
Success
EG

OK
Return
Comment —
A
Di

Appendix:
st

ParamName ParamValue type Description


rib

StorageLowSpace.Enable bool Enable/Disable loss detect feature.


Setting of EventHandler is described in
ut

StorageLowSpace.EventHandler —
SetEventHandler.
io

4.9.14 Net Abort Event


n
s.r

 Get net abort event config


.o

Table 4-108
.

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NetAbort
Method GET
Description Get net abort event config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NetAbort

General APIs 87
table.NetAbort.Enable=false
Success
table.NetAbort.EventHandler= (output of EventHandler is described in
Return
GetEventHandler)
Comment —
 Set net abort event config

Table 4-109
Da

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
hu

Method GET
Description Set net abort event config.
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetAbort.Enable=tru
Example
e
TT

Success
OK
Return
P

Comment —
AP

Appendix:
IV

ParamName ParamValue type Description


2.

NetAbort.Enable bool Enable/Disable loss detect feature.


89

Setting of EventHandler is described in


NetAbort.EventHandler —
SetEventHandler.
fo

4.9.15 IP Conflict Event


r1
00

 Get IP conflict event config


M

Table 4-110
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=IPConflict
EG

Method GET
Description Get IP conflict event config.
A

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=IPConflict
Di

Success table.IPConflict.Enable=false
st

Return table.IPConflict.EventHandler= (output of EventHandler is described in


rib

GetEventHandler)
Comment —
ut

 Set IP conflict event config


io

Table 4-111
n

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
s.r

alue>[&<paramName>=<paramValue>…]
Method GET
.o

Description Set IP Conflict event config.


.

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&IPConflict.Enable=tr
ue
Success OK
Return
Comment —

General APIs 88
Appendix:

ParamName ParamValue type Description


IPConflict.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
IPConflict.EventHandler —
SetEventHandler.
Da

4.9.16 Get Channels Event Happened


hu

Table 4-112
http://<server>/cgi-bin/eventManager.cgi?action=getEventIndexes&code=<eventCode
aH

Syntax
>
Method GET
TT

Get channels indexes that event of code eventCode happens.


P

Description Not all events support this command. Do not recommend to use it, use Attach command
instead.
AP

http://192.168.1.108/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AlarmL
Example
IV

ocal
channels[0]=0
2.

channels[1]=2
89

Success channels[2]=3
Return …
fo

(This response means event happened on channel 0, channel 2 and channel 3 while
video channel index starts from 0)
r1

Parameters in URL:
00

eventCode includes:
VideoMotion: motion detection event
M

VideoLoss: video loss detection event


EG

VideoBlind: video blind detection event.


Comment
AlarmLocal: alarm detection event.
A

StorageNotExist: storage not exist event.


StorageFailure: storage failure event.
Di

StorageLowSpace: storage low space event.


st

AlarmOutput: alarm output event.


rib

4.9.17 Subscribe to Event Message


ut
io

Table 4-113
http://<server>/cgi-bin/eventManager.cgi?action=attach&codes=[<eventCode>,<event
n

Syntax
Code>,…][&keepalive = 20][&heartbeat=<Heartbeat>]
s.r

Method GET
.o

Description Subscribe to messages that event of code eventCode happens.


http://192.168.1.108/cgi-bin/eventManager.cgi?action=attach&codes=[AlarmLocal%2C
.

VideoMotion%2CVideoLoss%2CVideoBlind]
Example

http://192.168.1.108/cgi-bin/eventManager.cgi?action=attach&codes=[All]&heartbeat=5
Success HTTP Code: 200 OK\r\n

General APIs 89
Return Cache-Control: no-cache\r\n
Pragma: no-cache\r\n
Expires: Thu, 01 Dec 2099 16:00:00 GMT\r\n
Connection: close\r\n
Content-Type: multipart/x-mixed-replace; boundary=<boundary>\r\n
Body:
--<boundary>\r\n
Da

Content-Type: text/plain\r\n
Content-Length: <data length>\r\n
hu

<eventInfo>\r\n\r\n
aH

--<boundary>\r\n
Content-Type: text/plain\r\n
Content-Length: <data length>\r\n
TT

<eventInfo>\r\n\r\n
P

For example:
AP

HTTP Code: 200 OK\r\n


IV

Cache-Control: no-cache\r\n
Pragma: no-cache\r\n
2.

Expires: Thu, 01 Dec 2099 16:00:00 GMT\r\n


89

Connection: close\r\n
Content-Type: multipart/x-mixed-replace; boundary=myboundary\r\n\r\n
fo

Body:
r1

--myboundary\r\n
Content-Type: text/plain\r\n
00

Content-Length: 39\r\n
Code=VideoMotion;action=Start;index=0\r\n\r\n
M

--myboundary\r\n
EG

Content-Type: text/plain\r\n
Content-Length: 38\r\n
A

Code=VideoBlind;action=Start;index=0\r\n\r\n
Di

--myboundary\r\n
Content-Type: text/plain\r\n
st

Content-Length: 9\r\n
rib

Heartbeat\r\n\r\n
--myboundary\r\n
ut


io

eventCode can be any one of the standard codes defined in DHIIF, or "All".
All means all kinds of the eventcode.
n

eventcode include:
s.r

VideoMotion: motion detection event


.o

SmartMotionHuman: human smart motion detection


Comment
SmartMotionVehicle:Vehicle smart motion detection
.

VideoLoss: video loss detection event


VideoBlind: video blind detection event.
AlarmLocal: alarm detection event.
CrossLineDetection: tripwire event

General APIs 90
CrossRegionDetection: intrusion event
LeftDetection: abandoned object detection
TakenAwayDetection: missing object detection
VideoAbnormalDetection: scene change event
FaceDetection: face detect event
AudioMutation: intensity change
AudioAnomaly: input abnormal
Da

VideoUnFocus: defocus detect event


WanderDetection: loitering detection event
hu

RioterDetection: People Gathering event


ParkingDetection: parking detection event
aH

MoveDetection: fast moving event


StorageNotExist: storage not exist event.
TT

StorageFailure: storage failure event.


P

StorageLowSpace: storage low space event.


AlarmOutput: alarm output event.
AP

MDResult: motion detection data reporting event. The motion detect window
IV

contains 18 rows and 22 columns. The event info contains motion detect data with
mask of every row.
2.

HeatImagingTemper: temperature alarm event


89

CrowdDetection: crowd density overrun event


FireWarning: fire warning event
fo

FireWarningInfo: fire warning specific data info


ObjectPlacementDetection: placement object detection
r1

ObjectRemovalDetection: removal object detection


00

In the example, you can see most event info is like "Code=eventcode; action=Start;
index=0", but for some specific events, they will contain an another parameter named
M

"data", the event info is like "Code=eventcode; action=Start; index=0; data=datainfo",


EG

the datainfo's fomat is JSON(JavaScript Object Notation). The detail information about
the specific events and datainfo are listed in the appendix below this table.
A

keepalive: If this param exist, the client must send any data to device by this
Di

connection in cycle. The keepalive is in range


st

of [1,60] second.
rib

For example:
The keeplive data can be the string "keep alive".
ut

Notice: the keepalive parameter is not recommended to use. It is recommended to use


io

the Heartbeat parameter.


Heartbeat: integer, range is [1,60],unit is second.If the URL contains this parameter,
n

and the value is 5, it means every 5 seconds the device should send the heartbeat
s.r

message to the client,the heartbeat message are "Heartbeat".


.o

Note: Heartbeat message must be sent before heartbeat timeout.


.

Appendix A: Coordinate system

General APIs 91
(0,0) 8191,0
X

Y
Da
hu

(0,8191) (8191,8191)
aH

4.9.18 Get Capability of Event Management


TT

Table 4-114
P

Syntax http://<server>/cgi-bin/eventManager.cgi?action=getCaps
AP

Method GET
Description Get event manager capabilities.
IV

Example http://192.168.1.108/cgi-bin/eventManager.cgi?action=getCaps
caps.AlarmOutEnable=true
2.

caps.BeepEnable=true
89

caps.DejitterEnable=true
caps.MMSEnable=true
fo

caps.MailEnable=true
caps.MonitorTourEnable=true
r1

caps.PtzLinkEnable=true
00

caps.RecordEnable=true
caps.SnapshotEnable=true
M

caps.TimeSectionEnable=true
EG

caps.TipEnable=true
caps.RecordCloudEnable=true,
A

caps.SnapshotCloudEnable=false,
Di

caps.SnapshotTimes[0]=3,
Success
caps.SnapshotTimes[1]=10,
st

Return
caps.SupportAlarmBell=false,
rib

caps.SupportAccessControl=false,
caps.SipCallEnable=false,
ut

caps.SupportAlarmServer=false,
io

caps.SupportPtzLinkDelay=false,
n

caps.SupportPSTNAlarmServer=false,
caps.SupportICR=false,
s.r

caps.BeepTime=false,
.o

caps.DejitterRange.Min=0,
caps.DejitterRange.Max=60
.

caps.AlarmOutLatch[0]=1,
caps.AlarmOutLatch[1]=300,
caps.RecordLatch[0]=0,
caps.RecordLatch[1]=300,

General APIs 92
caps.VoiceEnable=true,
caps.VoiceLinkTimeRange[0]=10,
caps.VoiceLinkTimeRange[1]=30,
caps.VoicePlayTimesRange[0]=1,
caps.VoicePlayTimesRange[1]=10,
caps.VoiceLinkFileOptional=true,
caps.LogEnable=true,
Da

caps.SupportLightControl=false,
caps.LinkLightBrightRange[0]=0,
hu

caps.LinkLightBrightRange[1]=100,
caps.SupportVideoMatrix=false,
aH

caps.LinkDetailCameraEnable=false,
caps.SupportDisableLinkage[0]=0
TT

caps.SupportDisableLinkage[1]=0
P

caps.SupportDisableLinkage[2]=0
caps.SupportDisableLinkage[3]=0
AP

Comment —
IV

4.9.19 Net Alarm Event


2.
89

 Get net alarm event config

Table 4-115
fo

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NetAlarm
r1

Method GET
Description Get net alarm event config.
00

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NetAlarm
M

table.NetAlarm[0].Enable=false
table.NetAlarm[0].Name=channel1
EG

Success
NetAlarm[0].SensorType=NO
Return
table.NetAlarm[0].EventHandler= (output of EventHandler is described in
A

GetEventHandler)
Di

Comment —
st

 Set net alarm event config


rib

Table 4-116
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
ut

Syntax
alue>[&<paramName>=<paramValue>…]
io

Method GET
n

Description Set net alarm event config.


s.r

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetAlarm[0].Enable=
Example
true
.o

Success
OK
.

Return
Comment —

Appendix:

General APIs 93
ParamName ParamValue Description
type
NetAlarm[channel].Enable bool Enable/Disable alarm input.
Defence Area Type, it can be { "Intime",
NetAlarm[channel].DefenceAreaType string
"Delay", "Fullday" }
NetAlarm[channel].DisableDelay integer delay time of removal, unit: s
NetAlarm[channel].EnableDelay
Da

integer delay time of protection, unit: s


NetAlarm[channel].Name string alarm channel name
hu

Sensor type, Normally open or normally closed


NetAlarm[channel].SensorType string
it can be {"NO", "NC"}
aH

Setting of EventHandler is described in


NetAlarm[channel].EventHandler —
SetEventHandler.
TT
P

4.9.20 Set Net Alarm State


AP
IV

Table 4-117
http://<server>/cgi-bin/netAlarm.cgi?action=setState&channel=<ChannelNo>&alarm=<A
2.

Syntax
larm>[&name=<Name>&trigger=<Trigger>&desc=<Desc>]
89

Method GET
Description Set the netalarm state.
fo

http://192.168.1.108/cgi-bin/netAlarm.cgi?action=setState&channel=1&alarm=true&nam
Example
r1

e=somke&trigger=SmokingSensor&desc=Zone8
Success
OK
00

Return
Parameters in URL:
M

ChannelNo: integer, alarm channel index which starts from 1


EG

Alarm: bool, the state of the alarm, the value can be true and false, true means the alarm
is start.
A

Name: string, the name of the alarm, optional parameter, the length of this value should
Di

Comment less than 32.


Trigger:string, the trigger of the alarm,for example, it can be Infrared, WaterSensor or
st

Manual and so on.


rib

Optional parameter, the length of this value should less than 32.
Desc: string, the description of the alarm, optional parameter, the length of this value
ut

should less than 128.


io
n

4.9.21 GetSupportedEvents
s.r

Table 4-118
.o

Syntax http://<server>/cgi-bin/eventManager.cgi?action=getExposureEvents
.

Method GET
Description Get the event list which the device supports.
Example http://192.168.1.108/cgi-bin/eventManager.cgi?action=getExposureEvents
Success events[0]=VideoMotion
Return events[1]=AlarmLocal

General APIs 94
events[2]=FaceDetection
events[3]=VideoMotion

Comment —

4.10 PTZ
Da

4.10.1 PTZ Config


hu

 Get PTZ config


aH

Table 4-119
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Ptz
TT

Method GET
P

Description Get PTZ config.


AP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Ptz
table.Ptz[port].Address=8
IV

table.Ptz[port].Attribute[0]=115200
table.Ptz[port].Attribute[1]=8
2.

table.Ptz[port].Attribute[2]=Even
Success
89

table.Ptz[port].Attribute[3]=1
Return
table.Ptz[port].Homing[0]=0
fo

table.Ptz[port].Homing[1]=30
r1

table.Ptz[port].NumberInMatrixs=0
table.Ptz[port].ProtocolName=NONE
00

Parameters in Response:
Comment
port is PTZ port index, start form 0.
M

 Set PTZ config


EG

Table 4-120
A

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
Di

Method GET
st

Description Set PTZ config.


rib

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Ptz[0].Address=192.
168.0.1&Ptz[0].Attribute[0]=9600
ut

Success OK
io

Return
Comment port in below ParamName is PTZ port index, start form 0.
n
s.r

Appendix:
.o

ParamName ParamValue type Description


Range is [0—255].
.

Device address, if there are more than one device


Ptz[port].Address integer
connected to this port, distinguish them by this
address.
Ptz[port].Attribute[0] integer The baud rate. Range is {1200, 2400, 4800, 9600,

General APIs 95
ParamName ParamValue type Description
19200, 38400, 57600, 115200}.
Range is {4, 5, 6, 7, 8}.
Ptz[port].Attribute[1] integer
Data bit.
Range is {Even, Mark, None, Odd, Space}.
Ptz[port].Attribute[2] string
Parity verification mode.
Range is {1, 1.5, 2}.
Da

Ptz[port].Attribute[3] float
Stop bit.
Range is {-1,0—255}
hu

Ptz[port].Homing[0] integer -1: homing is disabled.


aH

[0—255]: preset point number


Range is [0—65535].
No operation timeout, unit is seconds.
TT

Ptz[port].Homing[1] integer
After no operation timeout, PTZ go to preset point
P

set in Ptz[port].Homing[0].
AP

PTZ protocol name depends on PTZ capability.


Ptz[port].ProtocolName string
Refer to GetProtocolList to get the protocol list.
IV

Ptz[port].ControlDelayTime integer PTZ control delay time, unit: second


PTZ control priority,the range is "RS485", "Net".
2.

Ptz[port].ControlPriority string
default : "Net"
89

4.10.2 Get PTZ Protocol List


fo
r1

Table 4-121
Syntax http://<server>/cgi-bin/ptz.cgi?action=getProtocolList[&channel=<ChannelNo>]
00

Method GET
Description Get the protocol list that PTZ can support. Unsupported now.
M

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getProtocolList&channel=1
EG

info.RS[0]=Pelco
Success info.RS[1]=DH-SD1
A

Return info.Coaxial[0]=HD-CVI
Di

info.Coaxial[1]=HD-CVI2.0
st

Response contains all support PTZ protocols of the server.


Comment
ChannelNo: integer, video channel index which starts from 1.
rib

4.10.3 Get PTZ Capability of Current Protocol


ut
io

Table 4-122
n

Syntax http://<server>/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps[&channel=<ChannelNo>]
s.r

Method GET
Description Get PTZ channel protocol capabilities.
.o

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps&channel=1
.

caps.AlarmLen=0
Success caps.AuxMax=8
Return caps.AuxMin=1
caps.CamAddrMax=255

General APIs 96
caps.CamAddrMin=1
caps.Flip=false
caps.Focus=false
caps.Interval=200
caps.Iris=false
caps.Menu=false
caps.MonAddrMax=255
Da

caps.MonAddrMin=0
caps.Name=DH-SD1
hu

caps.Pan=false
caps.PanSpeedMax=255
aH

caps.PanSpeedMin=1
caps.PatternMax=5
TT

caps.PatternMin=1
P

caps.PresetMax=80
caps.PresetMin=1
AP

caps.Tile=false
IV

caps.TileSpeedMax=255
caps.TileSpeedMin=1
2.

caps.TourMax=7
89

caps.TourMin=0
caps.Type=1
fo

caps.Zoom=false
caps.PtzMotionRange.HorizontalAngle[0]=0
r1

caps.PtzMotionRange.HorizontalAngle[1]=360
00

caps.PtzMotionRange.VerticalAngle[0]=-20
caps.PtzMotionRange.VerticalAngle[1]=90
M

caps.ZoomMax=30
EG

caps.ZoomMin=1
Parameters in URL:
Comment
A

ChannelNo: PTZ channel index which starts from 1.


Di

Appendix:
st

Field in response Description


rib

AlarmLen Alarm length in protocol.


AuxMax
ut

Maximum/Minimum number for auxiliary functions.


AuxMin
io

CamAddrMax
Maximum/Minimum channel address.
n

CamAddrMin
Flip True or false, support picture flip or not.
s.r

Focus True or false, support focus or not.


.o

Iris True or false, support Iris adjusts or not.


.

Menu True or false, support internal menu of the PTZ or not.


MonAddrMax
Maximum/Minimum monitor address.
MonAddrMin
Name Name of the operation protocol.
Pan True or false, support pan or not.

General APIs 97
Field in response Description
PanSpeedMax
Maximum/Minimum pan speed.
PanSpeedMin
PatternMax
Maximum/Minimum pattern path number.
PatternMin
PresetMax
Maximum/Minimum preset point number.
PresetMin
Da

Tile True or false, support tilt or not.


Zoom True or false, support zoom or not.
hu

TileSpeedMax
Maximum/Minimum tile speed.
aH

TileSpeedMin
TourMax
Maximum/Minimum tour path number.
TT

TourMin
Type Type of PTZ protocol.
P

Horizontal angle range,[0] for minimum angle,[1] for maximum


AP

PtzMotionRange.HorizontalAngle angle
it only when Pan was true
IV

Vertical angle range,[0] for minimum angle,[1] for maximum angle


PtzMotionRange.VerticalAngle
it only when Tile was true
2.

ZoomMax Maximum/Minimum Zoom.


89

ZoomMin it only when Zoom was true


fo

4.10.4 Get PTZ Status


r1

Table 4-123
00

Syntax http://<server>/cgi-bin/ptz.cgi?action=getStatus[&channel=<ChannelNo>]
M

Method GET
Description Get PTZ status.
EG

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getStatus&channel=1
status.UTC=6538920
A

status.MoveStatus=Idle
Di

Success
status.ZoomStatus=Idle
Return
st

status.PresetID=10
rib

status.Position=120,12,2
Comment ChannelNo: integer, video channel index which starts from 1.
ut

4.10.5 PTZ Control


io
n

 Basic movement
s.r

Table 4-124
.o

http://<server>/cgi-bin/ptz.cgi?action=<action>&channel=<ch>&code=<code>&arg1=<a
Syntax
.

rg1>&arg2=<arg2>&arg3=<arg3>
Method GET
Description PTZ basic movement.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Up&arg1=0&arg2=1
Example
&arg3=0

General APIs 98
http://192.168.1.108/cgi-bin/ptz.cgi?action=stop&channel=1&code=Up&arg1=0&arg2=1&
arg3=0
Success
OK
Return
Parameters in URL:
action is PTZ control command, it can be start or stop.
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
Da

code is PTZ operation, and arg1, arg2, arg3 are arguments of operation.
code and argN values are listed in table below.
hu

The default exposure mode of PTZ is auto-exposure, aperture adjustment (Aperture


aH

larger 、Aperture smaller) would take effects temporarily, PTZ will auto—adjust the
Comment aperture after the auto—exposure recovery time (15 mins)
The default focus mode of PTZ is semi—auto, PTZ control or other operations will trigger
TT

the auto focus


P

Appendix:
AP

Code Code description arg1 arg2 arg3


IV

Vertical speed, range is [1—


Up Tile up 0 0
8]
2.

Vertical speed, range is [1—


Down Tile down 0 0
89

8]
Horizontal speed, range is
Left Pan left 0 0
fo

[1—8]
r1

Horizontal speed, range is


Right Pan right 0 0
[1—8]
00

Vertical speed, range is Horizontal speed, range is


LeftUp Pan left and tile up 0
[1—8] [1—8]
M

Vertical speed, range is Horizontal speed, range is


RightUp Pan right and tile up 0
EG

[1—8] [1—8]
Vertical speed, range is Horizontal speed, range is
A

LeftDown Pan left and tile down 0


[1—8] [1—8]
Di

Vertical speed, range is Horizontal speed, range is


RightDown Pan right and tile down 0
[1—8] [1—8]
st

ZoomWide Zoom out 0 0 0


rib

ZoomTele Zoom in 0 0 0
ut

FocusNear Focus near 0 0 0


FocusFar Focus far 0 0 0
io

IrisLarge Aperture larger 0 0 0


n

IrisSmall Aperture smaller 0 0 0


s.r

 Start the continuous movement


.o

Table 4-125
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Continuously&arg1=<a
.

Syntax
rg1>&arg2=<arg2>&arg3=<arg3>&arg4=<arg4>
Method GET
Description Start the continuous movement.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Continuously&arg1=

General APIs 99
5&arg2=5&arg3=5&arg4=60
Success
OK
Return
Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
arg3 is zoom speed, range is [-100—100];
Comment
arg4 is timeout value,the measurement unit is second, it's an integer greater than 0,the
Da

PTZ will stop moving automatically if timeout value reached and no"stop"command
received. The maximum timeout value is 3600 seconds.
hu

Appendix:
aH

Move description arg1 arg2


Pan left Continuously Less than -4 0
TT

Pan right Continuously Geater than 4 0


P

Tile up Continuously 0 Geater than 4


AP

Tile down Continuously 0 Less than -4


Pan left and tile up
Less than -4 Geater than 4
IV

Continuously
Pan right and tile up
2.

Geater than 4 Geater than 4


Continuously
89

Pan left and tile down


Less than -4 Less than -4
Continuously
fo

Pan right and tile down


Geater than 4 Less than -4
r1

Continuously
00

 Stop the continuous movement


M

Table 4-126
EG

http://<server>/cgi-bin/ptz.cgi?action=stop&channel=<ch>&code=Continuously&arg1=0&
Syntax
arg2=0&arg3=0&arg4=0
A

Method GET
Description Immediately stop the continuous movement.
Di

http://192.168.1.108/cgi-bin/ptz.cgi?action=stop&channel=1&code=Continuously&arg1=
st

Example
0&arg2=0&arg3=0&arg4=0
rib

Success
OK
Return
ut

Parameters in URL:
Comment
io

ch is PTZ channel index which starts from 1. Range is [1 — n].


n

 3D positioning
s.r

Table 4-127
http://<server>/cgi-bin/ptzBase.cgi?action=moveDirectly&channel=<ChannelNo>&start
.o

Syntax
Point[0]=<startX>&startPoint[1]=<startY>&endPoint[0]=<endX>&endPoint[1]=<endY>
.

Method GET
Three-dimensional orientation. Move to the rectangle with screen coordinate [startX,
Description
startY], [endX, endY] .
Example http://192.168.1.108/cgi-bin/ptzBase.cgi?action=moveDirectly&channel=1&startPoint[0]

General APIs 100


=7253&startPoint[1]=2275&endPoint[0]=7893&endPoint[1]=3034
Success
OK
Return
ChannelNo: integer, video channel index which starts from 1.
Comment startX, startY, endX, endY: relative coordinates, range is 0-8192. The two points
[startX, startY] and [endX, endY] makes the destination rectangle.
 PTZ relative movement
Da

Table 4-128
hu

http://<server>/cgi-bin/ptz.cgi?action=moveRelatively&channel=<ch>&arg1=<arg1>&arg2
Syntax
=<arg2>&arg3=<arg3>
aH

Method GET
Description PTZ relative movement.
TT

http://192.168.1.108/cgi-bin/ptz.cgi?action=moveRelatively&channel=1&arg1=1&arg2=1&
Example
arg3=1
P

Success
AP

OK
Return
IV

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
2.

arg1 is relative horizontal coordinate


Comment
89

arg2 is relative vertical coordinate


arg3 is relative zoom coordinate
fo

The normalization of above three values is[-1,1]


 PTZ accurate positioning
r1

Table 4-129
00

http://<server>/cgi-bin/ptz.cgi?action=moveAbsolutely&channel=<ch>&arg1=<arg1>&arg
Syntax
2=<arg2>&arg3=<arg3>
M

Method GET
EG

Description Accurate positioning.


http://192.168.1.108/cgi-bin/ptz.cgi?action=moveAbsolutely&channel=1&arg1=-0.8&arg2=
A

Example
0.3&arg3=0.5
Di

Success
OK
st

Return
Parameters in URL:
rib

ch is PTZ channel index which starts from 1. Range is [1 — n].


ut

arg1 is absolute horizontal coordinate, the normalization value is [-1, 1].


arg1<0: angle = 180.0 * arg1 + 360.0, real range is [180.0, 360.0]
io

arg1>=0: angle = 180.0 * arg1, real range is [0, 180.0]


n

Comment arg2 is absolute vertical coordinate, the normalization value is [-1, 1].
s.r

arg2: angle = -180.0 * arg2, real range is [-180.0, 180.0]


arg3 is absolute zoom coordinate, the normalization value is [0, 1].
.o
.

Actual range subject to equipment, you can get the detail information by protocol
4.10.3(Get PTZ Capability of Current Protocol).

General APIs 101


4.10.6 Preset
 Get preset information

Table 4-130
Syntax http://<server>/cgi-bin/ptz.cgi?action=getPresets[&channel=<ChannelNo>]
Method GET
Da

Description Get preset of PTZ control.


Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getPresets&channel=1
hu

presets[0].Index=1
aH

presets[0].Name=Preset 1
Success presets[0].Type=0
Return presets[0].PresetFunction="VideoBlack"
TT

presets[0].Position=[900, -900, 5]
P


AP

Parameters in URL:
Comment ChannelNo: integer, video channel index which starts from 1.
IV

The size of presets-array is the number of presets.


 Go to preset
2.
89

Table 4-131
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=GotoPreset&arg1=0&a
Syntax
rg2=<index>&arg3=0
fo

Method GET
r1

Description Go to preset.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=GotoPreset&arg1=0&
00

Example
arg2=1&arg3=0
M

Success
OK
Return
EG

Parameters in URL:
A

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


arg2 is number of preset
Di

 Set preset
st

Table 4-132
rib

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPreset&arg1=0&ar
Syntax
ut

g2=<index>&arg3=0
Method GET
io

Description Set preset.


n

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPreset&arg1=0&a
Example
s.r

rg2=2&arg3=0
Success
.o

OK
Return
.

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg2 is preset number
 Set the name for specified preset

General APIs 102


Table 4-133
http://<server>/cgi-bin/ptz.cgi?action=setPreset&channel=<ch>&arg1=<index>&arg2=<
Syntax
name>
Method GET
Description Set the name for specified preset.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=setPreset&channel=1&arg1=2&arg2=2
Success
Da

OK
Return
Parameters in URL:
hu

ch is PTZ channel index which starts from 1. Range is [1 — n].


Comment
aH

arg1 is preset number


arg2 is preset name, could be letter,number or Chinese
Delete specified preset
TT


P

Table 4-134
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=ClearPreset&arg1=0&
AP

Syntax
arg2=<index>&arg3=0
Method GET
IV

Description Delete the specified preset.


2.

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=ClearPreset&arg1=0
Example
89

&arg2=1&arg3=0
Success
OK
fo

Return
Parameters in URL:
r1

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


arg2 is preset number
00
M

4.10.7 Tour
EG

 Start the tour


A

Table 4-135
Di

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StartTour&arg1=<index
Syntax
>&arg2=0&arg3=0
st

Method GET
rib

Description Start the tour.


ut

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StartTour&arg1=1&arg
Example
2=0&arg3=0
io

Success
n

OK
Return
s.r

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
.o

arg1 is the number of tour route


.

 Stop the tour

Table 4-136
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StopTour&arg1=<index
Syntax
>&arg2=0&arg3=0

General APIs 103


Method GET
Description Stop the tour.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StopTour&arg1=1&arg
Example
2=0&arg3=0
Success
OK
Return
Parameters in URL:
Da

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


arg1 is the number of tour route
hu

 Add tour group


aH

Table 4-137
http://<server>/cgi-bin/ptz.cgi?action=setTour&channel=<ch>&arg1=<index>&arg2=<nam
Syntax
TT

e>
Method GET
P

Descriptio Add tour group, including set the tour route and name. Frequently used with add tour
AP

n preset.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=setTour&channel=1&arg1=1&arg2=1
IV

Success
OK
2.

Return
89

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
Comment
fo

arg1 is the number of tour route


arg2 is tour name
r1

 Delete tour group


00

Table 4-138
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=ClearTour&arg1=<inde
M

Syntax
x>&arg2=0&arg3=0
EG

Method GET
Description Delete the tour group with specified number.
A

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=ClearTour&arg1=1&ar
Example
Di

g2=0&arg3=0
st

Success
OK
Return
rib

Parameters in URL:
ut

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


arg1 is the number of tour group
io

 Add tour preset


n

Table 4-139
s.r

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AddTour&arg1=<index
Syntax
.o

1>&arg2=<index2>&arg3=0
Method GET
.

Description Add preset to tour group.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AddTour&arg1=1&arg
Example
2=2&arg3=0
Success OK

General APIs 104


Return
Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
Comment
arg1 is the number of tour route
arg2 is the number of preset
 Delete tour preset
Da

Table 4-140
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=DelTour&arg1=<index1
Syntax
hu

>&arg2=<index2>&arg3=0
Method GET
aH

Description Delete the specified preset from a particular tour group.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=DelTour&arg1=1&arg2
Example
TT

=2&arg3=0
Success
P

OK
Return
AP

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
IV

Comment
arg1 is the number of tour route
2.

arg2 is the number of preset


89

4.10.8 Scan
fo

 Set left boundary


r1

Table 4-141
00

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetLeftLimit&arg1=<ind
Syntax
ex>&arg2=0&arg3=0
M

Method GET
EG

Description Set left boundary.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetLeftLimit&arg1=1&
A

Example
arg2=0&arg3=0
Di

Success
OK
Return
st

Parameters in URL:
rib

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


ut

arg1 is the scan number


 Set right boundary
io
n

Table 4-142
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetRightLimit&arg1=<in
s.r

Syntax
dex>&arg2=0&arg3=0
.o

Method GET
Description Set right boundary.
.

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetRightLimit&arg1=1
Example
&arg2=0&arg3=0
Success
OK
Return

General APIs 105


Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is the scan number
 Start scan

Table 4-143
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoScanOn&arg1=<in
Syntax
Da

dex>&arg2=0&arg3=0
Method GET
hu

Description Start scanning.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoScanOn&arg1=1
aH

Example
&arg2=0&arg3=0
Success
OK
TT

Return
Parameters in URL:
P

Comment ch is PTZ channel index which starts from 1. Range is [1—n].


AP

arg1 is scan number


Stop scan
IV

Table 4-144
2.

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoScanOff&arg1=<in
89

Syntax
dex>&arg2=0&arg3=0
Method GET
fo

Description Stop scanning.


r1

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoScanOff&arg1=1
Example
&arg2=0&arg3=0
00

Success
OK
Return
M

Parameters in URL:
EG

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


arg1 is scan number
A
Di

4.10.9 Pattern
st

 Start pattern record


rib

Table 4-145
ut

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPatternBegin&arg1=
Syntax
io

<index>&arg2=0&arg3=0
Method GET
n

Description Start pattern record.


s.r

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPatternBegin&arg1
Example
.o

=1&arg2=0&arg3=0
Success
.

OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is pattern number

General APIs 106


 Stop pattern record

Table 4-146
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPatternEnd&arg1=<i
Syntax
ndex>&arg2=0&arg3=0
Method GET
Description Stop pattern record.
Da

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPatternEnd&arg1=
Example
1&arg2=0&arg3=0
hu

Success
OK
Return
aH

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
TT

arg1 is pattern number


Start pattern
P


AP

Table 4-147
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StartPattern&arg1=<ind
Syntax
IV

ex>&arg2=0&arg3=0
Method GET
2.

Description Start pattern.


89

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StartPattern&arg1=1&
Example
arg2=0&arg3=0
fo

Success
OK
r1

Return
Parameters in URL:
00

Comment ch is PTZ channel index which starts from 1. Range is [1 — n].


arg1 is pattern number
M

 Stop pattern
EG

Table 4-148
A

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StopPattern&arg1=<ind
Syntax
ex>&arg2=0&arg3=0
Di

Method GET
st

Description Stop pattern.


rib

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StopPattern&arg1=1&
Example
arg2=0&arg3=0
ut

Success
OK
io

Return
n

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
s.r

arg1 is pattern number


.o

4.10.10 Pan
.

 Start pan

Table 4-149

General APIs 107


http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoPanOn&arg1=0&ar
Syntax
g2=0&arg3=0
Method GET
Description Start pan.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoPanOn&arg1=0&
Example
arg2=0&arg3=0
Success
Da

OK
Return
Parameters in URL:
hu

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
aH

 Stop pan

Table 4-150
TT

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoPanOff&arg1=0&ar
Syntax
g2=0&arg3=0
P

Method GET
AP

Description Stop pan.


IV

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoPanOff&arg1=0&
Example
arg2=0&arg3=0
2.

Success
OK
89

Return

Parameters in URL:
fo

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
r1

4.10.11 PTZ Auto Movement


00
M

 Get PTZ auto movement configuration


EG

Table 4-151
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PtzAutoMovement
A

Method GET
Di

Description Get PTZ auto movement configuration.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PtzAutoMove
st

Example
ment
rib

table.PtzAutoMovement[port][Task].Enable = true
table.PtzAutoMovement[port][Task].TimeSection[week][section] = 0 00:00:00-23:59:59
ut


io

table.PtzAutoMovement[port][Task].Function = None
n

table.PtzAutoMovement[port][Task].ScanId = 0
Success
s.r

table.PtzAutoMovement[port][Task].PresetId = 0
Return
table.PtzAutoMovement[port][Task].PatternId = 0
.o

table.PtzAutoMovement[port][Task].TourId = 0
.

table.PtzAutoMovement[port][Task].AutoHoming.Time = 30
table.PtzAutoMovement[port][Task].SnapshotEnable = false
table.PtzAutoMovement[port][Task].SnapshotDelayTime = 30
Parameters in Response:
Comment
port is PTZ port index, start from 0.

General APIs 108


Task is the number of task, start from 0.
week: from 1 to 7.
section: time section, from 0 to 5.
 Set PTZ auto movement

Table 4-152
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
Da

alue>[&<paramName>=<paramValue>…]
Method GET
hu

Description Set PTZ auto movement.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PtzAutoMovement[0]
aH

Example
[0].Function=Preset&PtzAutoMovement[0][0].PresetId=1
Success
OK
TT

Return
Parameters in URL:
P

In table below,
AP

head=PtzAutoMovement[port][task]
Comment port is PTZ port index, start from 0.
IV

task is the number of task, start from 0.


2.

week: from 1 to 7.
section: time section, from 0 to 5.
89

Appendix:
fo

ParamName ParamValue type Description


r1

head.Enable bool Enable/Disable PtzAutoMovement


00

timeSchedule[week][section]=1 10:00:00-11:00:00
head.TimeSection timeSchedule

M

head.Function string Range is {Scan, Preset, Pattern, Tour}.


EG

head.ScanId integer Scan Id, start from 1


head.PresetId integer Preset Id, start from 1
A

head.PatternId integer Pattern Id, start from 1


Di

head.TourId integer Tour Id, start from 1


head.AutoHoming.Time integer Recover time, unit is second.
st

head.SnapshotEnable bool Enable/Disable Snap, when "Fuction" is "Preset".


rib

head.SnapshotDelayTime integer Delay time of snap, when "Fuction" is "Preset".


ut

4.10.12 PTZ Restart


io
n

Table 4-153
s.r

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Restart&arg1=0&arg
Syntax
2=0&arg3=0
.o

Method GET
.

Description PTZ restart.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Restart&arg1=0&ar
Example
g2=0&arg3=0
Success OK

General APIs 109


Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].

4.10.13 PTZ Reset


Table 4-154
Da

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Reset&arg1=0&arg2
Syntax
=0&arg3=0
hu

Method GET
aH

Description PTZ reset.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Reset&arg1=0&arg
Example
2=0&arg3=0
TT

Success
OK
P

Return
AP

Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
IV

4.10.14 OSD Menu


2.
89

 Enter the menu


fo

Table 4-155
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Menu&arg1=0&arg2
r1

Syntax
=0&arg3=0
Method GET
00

Description Enter the menu.


M

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Menu&arg1=0&arg
Example
2=0&arg3=0
EG

Success
OK
A

Return
Parameters in URL:
Di

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
st

 Exit the menu


rib

Table 4-156
ut

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Exit&arg1=0&arg2=0&
Syntax
arg3=0
io

Method GET
n

Description Exit the menu.


s.r

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Exit&arg1=0&arg2=0
Example
&arg3=0
.o

Success
OK
.

Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
 Confirm

General APIs 110


Table 4-157
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Enter&arg1=0&arg2=0
Syntax
&arg3=0
Method GET
Description Confirm the menu.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Enter&arg1=0&arg2=
Example
0&arg3=0
Da

Success
OK
Return
hu

Parameters in URL:
Comment
aH

ch is PTZ channel index which starts from 1. Range is [1 — n].


 Start the basic operation of menu
TT

Table 4-158
http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=<code>&arg1=<arg1
P

Syntax
>&arg2=<arg2>&arg3=<arg3>
AP

Method GET
Description Start the basic operation of menu.
IV

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=MenuUp&arg1=0&
Example
2.

arg2=0&arg3=0
89

Success
OK
Return
fo

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
r1

Comment
code is PTZ operation, and arg1, arg2, arg3 are arguments of operation.
code and argN values are listed in table below.
00

Appendix:
M
EG

Code Code description arg1 arg2 arg3


MenuUp MenuUp 0 0 0
A

MenuDown MenuDown 0 0 0
Di

MenuLeft MenuLeft 0 0 0
st

MenuRight MenuRight 0 0 0
rib

4.11 Record
ut
io

4.11.1 Get Capability of Recording


n

Table 4-159
s.r

Syntax http://<server>/cgi-bin/recordManager.cgi?action=getCaps
.o

Method GET
Description Get record manager capabilities.
.

Example http://192.168.1.108/cgi-bin/recordManager.cgi?action=getCaps
caps.MaxPreRecordTime=30
Success
caps.PacketLengthRange[0]=1
Return
caps.PacketLengthRange[1]=60

General APIs 111


caps.PacketSizeRange[0]=131072
caps.PacketSizeRange[1]=2097152
caps.SupportExtraRecordMode=true
caps.SupportHoliday=true
caps.SupportPacketType[0]=Time
caps.SupportPacketType[1]=Size
caps.SupportResumeTransmit=false
Da

Comment —
hu

4.11.2 Record Config


aH

 Get record config


TT

Table 4-160
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Record
P

Method GET
AP

Description Get record config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Record
IV

table.Record[channel].PreRecord=6
2.

table.Record[channel].TimeSection[weekday][0]=65535 00:00:00-24:00:00
table.Record[channel].TimeSection[weekday][1]=0 02:00:00-24:00:00
89

Success
table.Record[channel].TimeSection[weekday][2]=0 03:00:00-24:00:00
Return
table.Record[channel].TimeSection[weekday][3]=0 04:00:00-24:00:00
fo

table.Record[channel].TimeSection[weekday][4]=0 05:00:00-24:00:00
r1

table.Record[channel].TimeSection[weekday][5]=0 06:00:00-24:00:00
Parameters in Response:
00

channel: integer, array index starts from 0, which means video channel(equals to video
M

Comment channel index -1, and so 0 means channel 1).


weekday: range is [0-6] (Sunday - Saturday).
EG

Record config contains pre record time and record time sections of every day.
A

 Set record config


Di

Table 4-161
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
st

Syntax
alue>[&<paramName>=<paramValue>…]
rib

Method GET
Description Set record config.
ut

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Record[0].TimeSecti
io

on[0][0]=6 00:00:00-23:59:59
n

Example Set record time to every Sunday all day. Record type is motion detection and alarm.
s.r

In this example, "6 00:00:00-23:59:59" means motion detection and alarm record all day
(6 = 4 & 2, alarm is 4, motion detection is 2.).
.o

Success
OK
.

Return
Parameters in URL:
In table below,
Comment
ch: integer, array index starts from 0, which means video channel (equals to video
channel index -1, and so 0 means channel 1).

General APIs 112


wd: week day index
ts: time section index

Appendix:

ParamName ParamValue type Description


Range is [0—300].
Record[ch].PreRecord integer Prerecord seconds, 0 means no prerecord.
Da

ch (Channel number) starts form 0


wd (week day) range is [0—7] ,[0-6]:(Sunday -
hu

Saturday),7:Holiday
aH

ts (time section) range is [0—23], time section


table index.
TT

Format: mask hh:mm:ss-hh:mm:ss


P

Record[ch].TimeSection[wd][ts] string Mask: [0—4294967295], hh: [0—24], mm: [0


AP

—59], ss: [0—59]


Mask indicates record type by bits:
IV

Bit0: regular record


Bit1: motion detection record
2.

Bit2: alarm record


89

Bit3: card record


fo

4.11.3 Record Mode


r1

 Get record mode config


00

Table 4-162
M

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
Method GET
EG

Description Get record mode config.


A

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
Success
Di

table.RecordMode[Channel].Mode=0
Return
st

Parameters in Response:
rib

Comment Channel: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ut

 Set record mode config


io

Table 4-163
n

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
s.r

alue>
Method GET
.o

Description Set record mode config.


.

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RecordMode[0].Mod
Example
e=0
Success
OK
Return

General APIs 113


Parameters in URL:
In table below,
Comment
Channel: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).

Appendix:

ParamName ParamValue type Description


Da

Range is {0, 1, 2 }.
0: automatically record
hu

RecordMode[Channel].Mode integer
1: manually record
aH

2: stop record.

4.11.4 Media Global


TT
P

 Get media global config


AP

Table 4-164
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MediaGlobal
IV

Method GET
2.

Description Get media global config.


89

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MediaGlobal
table.MediaGlobal.OverWrite=true,
fo

table.MediaGlobal.PacketType=0,
table.MediaGlobal.PacketLength=60,
r1

Success
table.MediaGlobal.PacketSize=1024,
Return
table.MediaGlobal.LogRecord=false,
00

table.MediaGlobal.LogEncode=false,
M

table.MediaGlobal.SnapFormatAs=MainFormat
Comment —
EG

 Set media global config


A

Table 4-165
Di

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>
st

Method GET
rib

Description Set media global config.


ut

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MediaGlobal.SnapF
Example
ormatAs=MainFormat
io

Success
OK
n

Return
s.r

Comment —
.o

Appendix:
.

ParamName ParamValue type Description


MediaGlobal.SnapFormatAs string The range is {"MainFormat", "ExtraFormat"}.

General APIs 114


4.11.5 Find Media Files
Step 1 Create a media files finder.

Table 4-166
Syntax http://<server>/cgi-bin/mediaFileFind.cgi?action=factory.create
Method GET
Da

Description Create a media file finder.


Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=factory.create
hu

Success
result=08137
aH

Return
Comment The result is the finder's objectId, needed by the following API.
Step 2 Start to find media files satisfied the conditions with the finder.
TT
P

Table 4-167
http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile&object=<objectId>&condition
AP

.Channel=<ChannelNo>&condition.StartTime=<start>&condition.EndTime=<end>[&c
Syntax
ondition.Dirs[0]=<dir>&condition.Types[0]=<type>&condition.Flags[0]=<flags>&conditi
IV

on.Events[0]=<event>&condition.VideoStream=<stream>]
2.

Method GET
89

Description Check if there are files that satisfy all the conditions.
Find a file in channel 1, in directory "/mnt/dvr/sda0",event type is "AlarmLocal" or
fo

"VideoMotion", file type is "dav", and time between 2014-1-1 12:00:00 and 2015-1-10
12:00:00 , URL is:
r1

Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&conditio
n.Channel=1&condition.Dirs[0] =/mnt/dvr/sda0&condition.Types[0]=dav&condition.Eve
00

nts[0]=AlarmLocal&condition.Events[1]=VideoMotion&condition.StartTime=2014-1-1%2
M

012:00:00&condition.EndTime=2015-1-10%2012:00:00&condition.VideoStream=Main
Success
EG

OK
Return
A
Di
st
rib
ut
io
n
s.r
.o
.

General APIs 115


Start to find a file with the above condition. If files exist, return OK, else return Error.
Parameters in URL:
objecteId: The object Id is the finder created before. You must create a finder before
finding files.
ChannelNo: integer, video channel index which starts from 1.
start / end: the start/end time when recording.
dir : in which directories you want to find the file. It is an array. The index starts from 0.
Da

The range of dir is {"/mnt/dvr/sda0", "/mnt/dvr/sda1"}. This condition can be omitted. If


omitted, find files in all the directories.
hu

Comment type : which types of the file you want to find. It is an array. The index starts from 0. The
range of type is {"dav", "jpg", "mp4"}. If omitted, find files with all the types.
aH

flags : which flags of the file you want to find. It is an array. The index starts from 0. The
range of flag is {"Timing", "Manual", "Marker", "Event", "Mosaic", "Cutout"}. If omitted,
TT

find files with all the flags.


P

event : by which event the record file is triggered. It is an array. The index starts from 0.
The range of event is {"AlarmLocal", "VideoMotion", "VideoLoss", "VideoBlind",
AP

"Traffic*"}. This condition can be omitted. If omitted, find files of all the events.
IV

stream : which video stream type you want to find. The range of stream is {"Main",
"Extra1", "Extra2", "Extra3"}. If omitted, find files with all the stream types.
2.

Step 3 Get the media file information found by the finder.


89

Table 4-168
http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=<objectId>&cou
fo

Syntax
nt=<fileCount>
r1

Method GET
Description Find the next files no more than fileCount.
00

http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&cou
Example
M

nt=100
found=1
EG

items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
A

items[0].EndTime=2011-1-1 13:00:00
Di

Success items[0].Type=dav
st

Return items[0].Events[0]=AlarmLocal
rib

items[0].VideoStream=Main
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
ut

items[0].Length=790
items[0].Duration=3600
io

Comment The maximum value of fileCount is 100.


n
s.r

Appendix:

Field in Description
.o

Response
.

found Count of found file, found is 0 if no file is found.


Internal video channel index starts from 0, equals to API findFile input
Channel
condition.Channel -1.
StartTime Start time.

General APIs 116


Field in Description
Response
EndTime End time.
Type File type.
Events Event type.
VideoStream Video stream type.
FilePath File path.
Da

CutLength File length that cut between StartTime and EndTime.


Length File length of the whole file.
hu

Duration Duration time.


aH

Step 4 Close the finder.

Table 4-169
TT

Syntax http://<server>/cgi-bin/mediaFileFind.cgi?action=close&object=<objectId>
P

Method GET
Description Stop finding.
AP

Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=close&object=08137
IV

Success
OK
Return
2.

Comment —
89

Step 5 Destroy the finder.

Table 4-170
fo

Syntax http://<server>/cgi-bin/mediaFileFind.cgi?action=destroy&object=<objectId>
r1

Method GET
Description Destroy the media file finder.
00

Example http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=destroy&object=08137
M

Success
OK
Return
EG

Comment —
A

4.11.6 Find media files with FaceDetection info


Di
st

Step 1 Create a media files finder.


rib

This API is the same as the API in "4.11.5 Find Media Files".
Step 2 Start to find media files satisfied the common conditions and FaceDetection condition
ut

with the finder.


io

Table 4-171
n

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
s.r

Start to find media files satisfied the common conditions and FaceDetection conditions
Description
.o

with the finder.


.

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
object int R The finder object id
condition object R The search conditions

General APIs 117


The video channel to search, video channel index start from
+Channel int R
1, use -1 to search all video channel.
+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
+EndTime string R End time to search, ex: "2010-06-25 12:05:00"
+Types array<string> O Search file types, should be "jpg"
Search flags, can be : "Timing", "Manual", "Marker", "Event",
+Flags array<string> O "Mosaic", "Cutout"
Da

should include “Event”


+Events array<string> R Search event list, must be one string : "FaceDetection"
hu

Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
aH

string length is 259.


+DB object R DB filter object
TT

++FaceDetecti
object R DB filter for FaceDetection
onRecordFilter
P

Picture type, if omit, means search all type.


AP

+++ImageType string O "GlobalSence" : means big picture of the full sence,


"Small" : means small picture of the people face.
IV

+++Sex string O Sex, it can be "Man", "Woman", if omit, search all


+++Age array<int> O Age range, ex:[25, 40]
2.

+++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear


89

+++Mask int O Mask Status, 0: all, 1: not wearing mask, 2: wearing mask
+++Beard int O Beard Status, 0: all, 1: no beard, 2: has beard
fo

[ Response Params ] ( OK )
r1

[ Example ]
GET
00

http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
M

annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%201
2:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=FaceDetect
EG

Request
ion&condition.DB.FaceDetectionRecordFilter.ImageType=GlobalSence&condition.DB.Face
DetectionRecordFilter.Sex=Man&condition.DB.FaceDetectionRecordFilter.Age[0]=25&cond
A

ition.DB.FaceDetectionRecordFilter.Age[1]=40&condition.DB.FaceDetectionRecordFilter.Gl
Di

asses=1
st

Respons
OK
e
rib

Step 3 Get the media file information found by the finder


ut

Table 4-172
io

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
n

Method GET
Description Get the media file information found by the finder.
s.r

[ Request Params ] ( key=value format at URL )


.o

Name Type R/O Param Description


.

object int R The finder object id


count int R Record num to get, should less than 100.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
found int R Record num that found.

General APIs 118


items array<object> R Result record items.
+Channel int R The video channel index start from 0,
+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
+EndTime string R End time to search, ex: "2010-06-25 12:05:00"
+Type string R File type, should be: "jpg"
+Events array<string> R Events with this record
+FilePath string R File path, string max length is 259
Da

+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file
hu

+SummaryNew array<object> R DB record object


aH

++Key string R DB record name, should be "FaceDetectionRecord"


++Value object R DB record value
TT

+++ImageType string O Picture type. It can be: "GlobalSence" , "Small"


+++TimeStamp object O Picture timestamp
P

++++UTC int O UTC seconds


AP

++++UTCMS int O UTC miliseconds


+++Sex string O Sex, it can be "Man", "Woman", "Unknown"
IV

+++Age int O Age


2.

+++Glasses int O Glasses Status, 0: unknown, 1: not wear, 2: wear


Mask Status, 0: unknown, 1: not wearing mask, 2: wearing
89

+++Mask int O
mask
+++Beard int O Beard Status, 0: unknown, 1: no beard, 2: has beard
fo

[ Example ]
r1

GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
00

00
M

found=100
items[0].Channel=1
EG

items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
A

items[0].Type=jpg
Di

items[0].Events[0]=FaceDetection
st

items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
rib

items[0].CutLength=79000
Respons items[0].SummaryNew[0].Key=FaceDetectionRecord
ut

e items[0].SummaryNew[0].Value.ImageType=GlobalSence
items[0].SummaryNew[0].Value.TimeStamp.UTC=134652732
io

items[0].SummaryNew[0].Value.TimeStamp.UTCMS=134
n

items[0].SummaryNew[0].Value.Sex=Man
s.r

items[0].SummaryNew[0].Value.Age=30
items[0].SummaryNew[0].Value.Glasses=1
.o

items[0].SummaryNew[0].Value.Mask=2
.

items[0].SummaryNew[0].Value.Beard=1

Step 4 Close the finder.
This API is the same as the API in "4.11.5 Find Media Files".

General APIs 119


Step 5 Destroy the finder.
This API is the same as the API in "4.11.5 Find Media Files".

4.11.7 Find media files with FaceRecognition info


Step 1 Create a media files finder.
This API is the same as the API in "4.11.5 Find Media Files".
Da

Step 2 Start to find media files satisfied the common conditions and FaceRecognition
conditions with the finder.
hu

Table 4-173
aH

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
TT

Description Start to find media files satisfied the common conditions and FaceRecognition conditions
with the finder.
P

[ Request Params ] ( key=value format at URL )


AP

Name Type R/O Param Description


object int R The finder object id
IV

condition object R The search conditions


2.

+Channel int R The video channel to search, video channel index start from
1, use -1 to search all video channel.
89

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


Ignored, use StartTime in DB param
fo

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


r1

Ignored, use EndTime in DB param


+Types array<string> O Search file types, should be "jpg"
00

+Flags array<string> O Search flags. It can be: "Timing", "Manual", "Marker", "Event",
M

"Mosaic", "Cutout"
should include “Event”.
EG

+Events array<string> R Search event list, must be one string: "FaceRecognition"


A

Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
Di

+DB object R DB filter object


st

++FaceRecogn object R DB filter for FaceRecognition


rib

itionRecordFilt
er
ut

+++MachineAd string O Machine address


io

dress
+++StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
n

+++EndTime string R End time to search, ex: "2010-06-25 12:05:00"


s.r

+++Person object O Search condition of history person and the similar face group
.o

person candidates
++++Name string O Person's name, max string length is 15
.

++++Sex string O Sex, can be "Male", "Female", if omit, search all


++++Birthday string O Birthday, max string length is 11, ex: 1990-5-1
++++Country string O Country, ISO 3166, string length should be 2
++++Province string O Province, max string length is 63

General APIs 120


++++City string O City, max string length is 63
++++Certificate string O Certificate Type. It can be: "IC', "Passport", "Military",
Type "Unknown"
++++ID string O Person ID of CertificateType, max string length is 31
++++GroupID string O The identity of the Face Group that this Person in. max string
length is 63
++++Age array<int> O Age range, ex:[25, 40]
Da

++++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear


++++Mask int O Mask Status, 0: all, 1: not wearing mask, 2: wearing mask
hu

++++Beard int O Beard Status, 0: all, 1: no beard, 2: has beard


aH

+++GroupID array<string> O GroupID list


+++SimilaryRa array<int> O Similary Range, ex: [40, 100]
TT

nge
[ Response Params ] ( OK )
P

[ Example ]
AP

Request GET
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
IV

annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%201
2:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=FaceRecog
2.

nition&condition.DB.FaceRecognitionRecordFilter.RegType=RecSuccess&condition.DB.Fa
89

ceRecognitionRecordFilter.StartTime=2014-1-1%2012:00:00&condition.DB.FaceRecognitio
nRecordFilter.EndTime=2015-1-10%2012:00:00&condition.DB.FaceRecognitionRecordFilte
fo

r.Person.Sex=Male&condition.DB.FaceRecognitionRecordFilter.Person.Country=CN&condi
r1

tion.DB.FaceRecognitionRecordFilter.Person.Age[0]=25&condition.DB.FaceRecognitionRe
cordFilter.Person.Age[1]=40&condition.DB.FaceRecognitionRecordFilter.Person.Glasses=1
00

&condition.DB.FaceRecognitionRecordFilter.GroupID[0]=10001&condition.DB.FaceRecogn
itionRecordFilter.GroupID[1]=10003&condition.DB.FaceRecognitionRecordFilter.GroupID[2]
M

=10005&condition.DB.FaceRecognitionRecordFilter.SimilaryRange[0]=40&condition.DB.Fa
EG

ceRecognitionRecordFilter.SimilaryRange[1]=100
Respons OK
A

e
Di

Step 3 Get the media file information found by the finder


st

Table 4-174
rib

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
ut

Description Get the media file information found by the finder


io

[ Request Params ] ( key=value format at URL )


n

Name Type R/O Param Description


object int R The finder object id
s.r

count int R Record num to get, should less than 100.


.o

[ Response Params ] ( key=value format )


.

Name Type R/O Param Description


found int R Record num that found.
items array<object> R Result record items.
+Channel int R The video channel index start from 0,
+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"

General APIs 121


+EndTime string R End time to search, ex: "2010-06-25 12:05:00"
+Type string R File type, should be: "jpg"
+Events array<string> R Events with this record
+FilePath string R File path, string max length is 259
+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file
+SummaryNew array<object> R DB record object
Da

++Key string R DB record name, should be "FaceRecognitionRecord"


++Value object R DB record value
hu

Recognition result, 0 means recognition failed, no candidates.


+++RecResult int O
aH

1 means recognition success, has candidates.


+++MachineAd
string O Machine address, string max length is 259
TT

dress
+++IsGlobalSc
P

bool O Is the global scene picture or not


ene
AP

+++ImageInfo object O Big picture info


++++Length int O The length of the picture
IV

++++FilePath string O The file path of the picture, max string length is 259
+++Object object O The target face info
2.

++++Sex string O Sex, it can be "Man", "Woman", "Unknown"


89

++++Age int O Age


++++Glasses int O Glasses Status, 0: unknown, 1: not wear, 2: wear
fo

++++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye
r1

++++Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth
Mask status, 0: not detected, 1: not wearing mask, 2: wearing
00

++++Mask int O
mask
M

++++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard


+++Candidates array<object> O The info of candidates face from face group.
EG

++++Similarity int O Similarity


A

++++Person object O person info


+++++Name string O Person Name, max string length is 63
Di

+++++Sex string O Sex, it can be "Male", "Female", "Unknown"


st

+++++Birthday string O The person's birthday, ex: "1980-01-01"


rib

Country name, length must be 2, value should be according


+++++Country string O
to ISO3166
ut

+++++Province string O Province name, max string length is 63


io

+++++City string O City name, max string length is 63


+++++Certificat Certificate Type. It can be: "IC', "Passport", "Military",
n

string O
eType "Unknown"
s.r

+++++ID string O Person ID of CertificateType, max string length is 31


.o

+++++Feature
int O Feature State, 0:Unknown, 1:Failed, 2:OK
State
.

[ Example ]
GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
00

General APIs 122


found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=FaceRecognition
items[0].FilePath =/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
Da

items[0].Length =790
items[0].SummaryNew[0].Key=FaceRecognitionRecord
hu

items[0].SummaryNew[0].Value.RecResult=1
items[0].SummaryNew[0].Value.MachineAddress=BinJiang
aH

items[0].SummaryNew[0].Value.IsGlobalScene=true
items[0].SummaryNew[0].Value.ImageInfo.Length=123
TT

items[0].SummaryNew[0].Value.ImageInfo.FilePath=/tmp/1.jpg
P

Respons items[0].SummaryNew[0].Value.Object.Sex=Man
e items[0].SummaryNew[0].Value.Object.Age=40
AP

items[0].SummaryNew[0].Value.Object.Glasses=1
IV

items[0].SummaryNew[0].Value.Object.Eye=2
items[0].SummaryNew[0].Value.Object.Mouth=1
2.

items[0].SummaryNew[0].Value.Candidates[0].Similarity=50
89

items[0].SummaryNew[0].Value.Candidates[0].Person.Name=ZhangSan
items[0].SummaryNew[0].Value.Candidates[0].Person.Birthday=1980-01-01
fo

items[0].SummaryNew[0].Value.Candidates[0].Person.Sex=Male
items[0].SummaryNew[0].Value.Candidates[0].Person.Country=CN
r1

items[0].SummaryNew[0].Value.Candidates[0].Person.Province=ZheJiang
00

items[0].SummaryNew[0].Value.Candidates[0].Person.City=HangZhou
items[0].SummaryNew[0].Value.Candidates[0].Person.CertificateType=IC
M

items[0].SummaryNew[0].Value.Candidates[0].Person.ID=1234567890
EG

items[0].SummaryNew[0].Value.Candidates[0].Person.FeatureState=0

A

Step 4 Close the finder.


This API is the same as the API in "4.11.5 Find Media Files".
Di

Step 5 Destroy the finder.


st

This API is the same as the API in "4.11.5 Find Media Files".
rib

4.11.8 Find media files with HumanTrait info


ut
io

Step 1 Create a media files finder.


This API is the same as the API in "4.11.5 Find Media Files".
n

Step 2 Start to find media files satisfied the common conditions and HumanTrait conditions
s.r

with the finder


.o

Table 4-175
.

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
Start to find media files satisfied the common conditions and HumanTrait conditions with
Description
the finder.

General APIs 123


[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
object int R The finder object id
condition object R The search conditions
The video channel to search, video channel index start from
+Channel int R
1, use -1 to search all video channel.
+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"
Da

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


+Types array<string> O Search file types, should be "jpg"
hu

Search flags. It can be: "Timing", "Manual", "Marker", "Event",


aH

+Flags array<string> O "Mosaic", "Cutout"


should include “Event”
TT

+Events array<string> R Search event list, must be one string: "HumanTrait"


Search directory list, if omit, search all. Each dir path max
P

+Dirs array<string> O
string length is 259.
AP

+DB object R DB filter object


++HumanTrait
IV

object R DB filter for HumanTrait


RecordFilter
+++HumanAttri
2.

object R Human attributes


butes
89

Coat color, refer to CoatColor in 16.1.3.5 [Event] HumanTrait


++++CoatColor array<string> O
for available values, max array size is 4
fo

Coat type, refer to CoatType in 16.1.3.5 [Event] HumanTrait


++++CoatType array<int> O
r1

for available values, max array size is 2


++++Trousers Trousers color, refer to TrousersColor in 16.1.3.5 [Event]
00

array<string> O
Color HumanTrait for available values, max array size is 4
M

++++TrousersT Trousers type, refer to TrousersType in 16.1.3.5 [Event]


array<int> O
ype HumanTrait for available values, max array size is 2
EG

++++HasHat int O Has hat or not, 0: all, 1: not has hat, 2: has hat
++++HasBag int O Has bag or not, 0: all, 1: not has bag, 2: has bag
A

++++Sex string O Sex, can be "Man", "Woman", if omit, search all


Di

++++Age array<int> O Age range, ex:[25, 40]


st

Hair style, 0: all, 1: long hair, 2: short hair, 3: ponytail, 4: updo,


++++HairStyle int O
rib

5: hiddened
[ Response Params ] ( OK )
ut

[ Example ]
GET
io

http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
n

annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%201
s.r

2:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=HumanTrai
t&condition.DB.HumanTraitRecordFilter.HumanAttributes.CoatColor[0]=White&condition.D
.o

Request
B.HumanTraitRecordFilter.HumanAttributes.CoatColor[1]=Yellow&condition.DB.HumanTrait
.

RecordFilter.HumanAttributes.CoatType=1&condition.DB.HumanTraitRecordFilter.HumanAt
tributes.HasHat=2&condition.DB.HumanTraitRecordFilter.HumanAttributes.Sex=Man&cond
ition.DB.HumanTraitRecordFilter.HumanAttributes.Age[0]=30&condition.DB.HumanTraitRe
cordFilter.HumanAttributes.Age[1]=50&condition.DB.HumanTraitRecordFilter.HumanAttribu

General APIs 124


tes.HairStyle=1
Respons
OK
e
Step 3 Get the media file information found by the finder

Table 4-176
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Da

Method GET
Descripti
Get the media file information found by the finder
hu

on
[ Request Params ] ( key=value format at URL )
aH

Name Type R/O Param Description


object int R The finder object id
TT

count int R Record num to get, should less than 100.


P

[ Response Params ] ( key=value format )


Name Type R/O Param Description
AP

found int R Record num that found.


IV

items array<object> R Result record items.


+Channel int R The video channel index start from 0,
2.

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


89

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


+Type string R File type, should be: "jpg"
fo

+Events array<string> R Events with this record


+FilePath string R File path, string max length is 259
r1

+CutLength int R File length that cut between start time and end time
00

+Length int O File length of the whole file


+SummaryNew object R Face info
M

++Key string R DB record name, should be "HumanTraitRecord"


EG

++Value object R DB record value


+++HumanAttri
A

object O Human attributes


butes
Di

Coat color, refer to CoatColor in 16.1.3.5 [Event] HumanTrait


++++CoatColor string O
for available values,
st

Coat type, refer to CoatType in 16.1.3.5 [Event] HumanTrait


rib

++++CoatType int O
for available values,
++++Trousers Trousers color, refer to TrousersColor in 16.1.3.5 [Event]
ut

string O
Color HumanTrait for available values,
io

++++TrousersT Trousers type, refer to TrousersType in 16.1.3.5 [Event]


int O
n

ype HumanTrait for available values,


s.r

++++HasHat int O Has hat or not, 0: unknown, 1: not has hat, 2: has hat
++++HasBag int O Has bag or not, 0: unknown, 1: not has bag, 2: has bag
.o

++++Sex string O Sex, can be "Man", "Woman", "Unknown"


.

++++Age int O Age


Hair style, 0: unknown, 1: long hair, 2: short hair, 3: ponytail,
++++HairStyle int O
4: updo, 5: hiddened

General APIs 125


++++HasUmbr Has umbrella or not, 0: unknown, 1: not has umbrella, 2: has
int O
ella umbrella
Bag type, 0: unknown, 1: handbag, 2: shoulder bag, 3:
++++Bag int O
knapsack, 4: draw-bar box
++++Cap int O Cap style, 0: unknown, 1: normal cap, 2: helmet
+++FaceAttribu
object O Face attributes
tes
Da

++++Sex string O Sex, can be "Man", "Woman", "Unknown"


++++Age int O Age
hu

Mask status, 0: not detected, 1: not wearing mask, 2: wearing


++++Mask int O
aH

mask
++++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard
TT

Glasses Status, 0: unknown, 1: not wearing, 2: normal


++++Glass Int O
Glasses, 3: sun glasses, 4: black frame glasses
P

Emotion info. It can be: "Unknown", "Smile", "Anger",


AP

++++Emotion string O "Sadness", "Disgust", "Fear", "Surprise", "Neutral", "Laugh",


"Happy", "Confused", "Scream", "Lookaside"
IV

+++FacePath string O Face picture path, max string length is 259


+++FaceScene
2.

string O Face scene picture path, max string length is 259


Path
89

+++HumanPat
string O Human picture path, max string length is 259
h
fo

+++HumanSce
string O Human scene picture path, max string length is 259
r1

nePath
[ Example ]
00

GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
M

00
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

General APIs 126


found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=HumanTrait
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
Da

items[0].Length=790
items[0].SummaryNew.Key=HumanTraitRecord
hu

items[0].SummaryNew.Value.HumanAttributes.CoatColor=White
items[0].SummaryNew.Value.HumanAttributes.CoatType=1
aH

items[0].SummaryNew.Value.HumanAttributes.TrousersColor=Black
items[0].SummaryNew.Value.HumanAttributes.TrousersType=1
TT

items[0].SummaryNew.Value.HumanAttributes.HasHat=2
P

Respons items[0].SummaryNew.Value.HumanAttributes.HasBag=1
e items[0].SummaryNew.Value.HumanAttributes.Sex=Man
AP

items[0].SummaryNew.Value.HumanAttributes.Age=30
IV

items[0].SummaryNew.Value.HumanAttributes.HairStyle=2
items[0].SummaryNew.Value.HumanAttributes.HasUmbrella=1
2.

items[0].SummaryNew.Value.HumanAttributes.Bag=0
89

items[0].SummaryNew.Value.HumanAttributes.Cap=2
items[0].SummaryNew.Value.FaceAttributes.Sex=Man
fo

items[0].SummaryNew.Value.FaceAttributes.Age=35
items[0].SummaryNew.Value.FaceAttributes.Mask=0
r1

items[0].SummaryNew.Value.FaceAttributes.Beard=1
00

items[0].SummaryNew.Value.FaceAttributes.Glass=2
items[0].SummaryNew.Value.FaceAttributes.Emotion=Smile
M

items[0].SummaryNew.Value.FacePath=/mnt/2010/8/11/dav/15:40:50.jpg
EG

items[0].SummaryNew.Value.FaceScenePath=/mnt/2010/8/11/dav/15:40:51.jpg

A

Step 4 Close the finder.


This API is the same as the API in "4.11.5 Find Media Files".
Di

Step 5 Destroy the finder.


st

This API is the same as the API in "4.11.5 Find Media Files".
rib

4.11.9 Find media files with TrafficCar info


ut
io

Step 1 Create a media files finder.


This API is the same as the API in "4.11.5 Find Media Files".
n

Step 2 Start to find media files satisfied the common conditions and TrafficCar conditions with
s.r

the finder
.o

Table 4-177
.

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
Start to find media files satisfied the common conditions and TrafficCar conditions with
Description
the finder.

General APIs 127


Note: some request params can use compare condition, it's value is an array, first item is
a string of compare condition type, and the following items are compare values.
Compare condition type can be:
"==": means equal, followed with one param, if param type is string, then param value
can contain some “*” to match any string.
"||": means equal one of the params, followed with one or more params.
"<>": means inside range, followed by two integer param,
Da

"><": means outside range, followed by two integer param,


[ Request Params ] ( key=value format at URL )
hu

Name Type R/O Param Description


aH

object int R The finder object id


condition object R The search conditions
The video channel to search, video channel index start from
TT

+Channel int R
1, use -1 to search all video channel.
P

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


AP

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


+Types array<string> O Search file types
IV

Search flags. It can be: "Timing", "Manual", "Marker", "Event",


+Flags array<string> O
"Mosaic", "Cutout"
2.

Search event list


89

+Events array<string> O
Ignored, use Event under DB param.
Search directory list, if omit, search all. Each dir path max
fo

+Dirs array<string> O
string length is 259.
r1

+DB object R DB object


++TrafficCar object R DB filter for TrafficCar
00

+++PlateNumb <compare PlateNumber condition, use compare condition format, ex:


O
er condition> [ "==", "*888" ]
M

<compare
EG

+++Event O Event condition, ex: [ "||", "TrafficGate", "Alarm*" ]


condition>
<compare
A

+++Speed O Speed condition, ex: [ "<>", 40, 80 ]


condition>
Di

<compare Plate type condition, use compare condition format, ex: ["==",
+++PlateType O
st

condition> "Armed"],
<compare Plate color condition, use compare condition format, ex: ["==",
rib

+++PlateColor O
condition> "Blue"],
ut

+++VehicleCol <compare Vehicle color condition, use compare condition format, ex:
O
or condition> ["==", "White"],
io

[ Response Params ] ( OK )
n

[ Example ]
s.r

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
.o

0%2012:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.DB.TrafficCar.
.

Request PlateNumber[0]=%3d%3d&condition.DB.TrafficCar.PlateNumber[1]=%2a888&condition.D
B.TrafficCar.Speed[0]=%3c%3e&condition.DB.TrafficCar.Speed[1]=40&condition.DB.Traffi
cCar.Speed[2]=80&condition.DB.TrafficCar.VehicleColor[0]=%3d%3d&condition.DB.Traffic
Car.VehicleColor[1]=White

General APIs 128


Response OK
Step 3 Get the media file information found by the finder

Table 4-178
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Descripti
Get the media file information found by the finder
Da

on
[ Request Params ] ( key=value format at URL )
hu

Name Type R/O Param Description


object int R The finder object id
aH

count int R Record num to get, should less than 100.


[ Response Params ] ( key=value format )
TT

Name Type R/O Param Description


P

found int R Record num that found.


items array<object> R Result record items.
AP

+Channel int R The video channel index start from 0,


IV

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


+EndTime string R End time to search, ex: "2010-06-25 12:05:00"
2.

+Type string R File type, should be: "jpg"


89

+Events array<string> R Events with this record


+FilePath string R File path, string max length is 259
fo

+CutLength int R File length that cut between start time and end time
r1

+Length int O File length of the whole file


+Summary object R DB record info
00

++TrafficCar object R TrafficCar record info


+++PlateNumb
M

string R Car plate number


er
EG

+++PlateType string O Plate type,


+++PlateColor string O Plate color, ex: "Yellow", "Blue", … etc
A

+++VehicleCol
string O Vehicle color, ex: "Yellow", "Blue", … etc
Di

or
+++Country string O Country info. max string length is 19
st

+++Speed int O Vehicle speed, unit is km/hour


rib

+++Event string O The event info, ex: “TrafficJunction”


ut

[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&co
io

Request
unt=100
n
s.r
.o
.

General APIs 129


found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=TrafficJunction
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
Da

Respons items[0].Length=790
e items[0].Summary.TrafficCar.PlateNumber=A08888
hu

items[0].Summary.TrafficCar.PlateType=Unknown
items[0].Summary.TrafficCar.PlateColor=Blue
aH

items[0].Summary.TrafficCar.VehicleColor=White
items[0].Summary.TrafficCar.Country=China
TT

items[0].Summary.TrafficCar.Speed=70
P

items[0].Summary.TrafficCar.Event=TrafficJunction

AP

Step 4 Close the finder.


IV

This API is the same as the API in "4.11.5 Find Media Files".
Step 5 Destroy the finder.
2.

This API is the same as the API in "4.11.5 Find Media Files".
89

4.11.10 Find media files with IVS info


fo

Step 1 Create a media files finder.


r1

This API is the same as the API in "4.11.5 Find Media Files".
00

Step 2 Start to find media files satisfied the common conditions and IVS conditions with the
finder
M

Table 4-179
EG

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
A

Start to find media files satisfied the common conditions and IVS conditions with the
Di

Description
finder.
st

[ Request Params ] ( key=value format at URL )


rib

Name Type R/O Param Description


object int R The finder object id
ut

condition object R The search conditions


The video channel to search, video channel index start from
io

+Channel int R
1, use -1 to search all video channel.
n

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


s.r

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


+Types array<string> O Search file types
.o

Search flags. It can be: "Timing", "Manual", "Marker", "Event",


.

+Flags array<string> O
"Mosaic", "Cutout"
+Events array<string> O Search event list,
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.

General APIs 130


+DB object R DB object
++IVS object R DB filter for IVS
IVS rule condition. It can be: "CrossLineDetection" , "Cro
ssRegionDetection" , "LeftDetection" , "WanderDetection
"
+++Rule string O
"MoveDetection" , "RioterDetection" , "CrossFenceDetectio
n" , "TakenAwayDetection" , "PasteDetection" , "Preservati
Da

on" , "StayDetection" , "TailDetection"


IVS action. It can be: "Appear" , "Disappear" , "Inside" ,
hu

+++Action string O
"Cross"
aH

IVS object type, item in array can be: "Unknown" , "Human" ,


+++ObjectType array<string> O
"Vehicle" , "NonMotor"
[ Response Params ] ( OK )
TT

[ Example ]
P

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
AP

ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
Request 0%2012:00:00&condition.Types[0]=jpg&condition.DB.IVS.Rule=CrossLineDetection&cond
IV

ition.DB.IVS.Action=Cross&condition.DB.IVS.ObjectType[0]=Human&condition.DB.IVS.Ob
jectType[1]=NonMotor
2.

Response OK
89

Step 3 Get the media file information found by the finder


fo

Table 4-180
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
r1

Method GET
Description Get the media file information found by the finder
00

[ Request Params ] ( key=value format at URL )


M

Name Type R/O Param Description


EG

object int R The finder object id


count int R Record num to get, should less than 100.
A

[ Response Params ] ( key=value format )


Name Type R/O Param Description
Di

found int R Record num that found.


st

items array<object> R Result record items.


rib

+Channel int R The video channel index start from 0,


+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
ut

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


io

+Type string R File type, should be: "jpg"


n

+Events array<string> R Events with this record


s.r

+FilePath string R File path, string max length is 259


+CutLength int R File length that cut between start time and end time
.o

+Length int O File length of the whole file


.

+Summary object R DB record info


++IVS object R IVS record info
+++Rule string R IVS rule, see above for valid value
+++Action string O IVS action, see above for valid value

General APIs 131


+++ObjectType string O IVS object type, see above for valid value
[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&
Request
count=100
found=100
items[0].Channel=1
items[0].StartTime=2011-1-1 12:00:00
Da

items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
hu

items[0].Events[0]=CrossLineDetection
Response
aH

items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].Length=790
items[0].Summary.IVS.Rule=CrossLineDetection
TT

items[0].Summary.IVS.Action=Cross
P

items[0].Summary.IVS.ObjectType=Human
AP


Step 4 Close the finder.
IV

This API is the same as the API in "4.11.5 Find Media Files".
Step 5 Destroy the finder.
2.

This API is the same as the API in "4.11.5 Find Media Files".
89

4.11.11 Find media files with NonMotor info


fo

Step 1 Create a media files finder.


r1

This API is the same as the API in "4.11.5 Find Media Files".
00

Step 2 Start to find media files satisfied the common conditions and NonMotor conditions with
the finder
M

Table 4-181
EG

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
A

Start to find media files satisfied the common conditions and NonMotor conditions with
Di

Description
the finder.
st

[ Request Params ] ( key=value format at URL )


rib

Name Type R/O Param Description


object int R The finder object id
ut

condition object R The search conditions


io

The video channel to search, video channel index start from


+Channel int R
1, use -1 to search all video channel.
n

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


s.r

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


.o

+Types array<string> O Search file types


Search flags. It can be: "Timing", "Manual", "Marker", "Event",
.

+Flags array<string> O
"Mosaic", "Cutout"
+Events array<string> O Search event list,
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.

General APIs 132


+DB object R DB object
++NonMotorRe
object R DB filter for NonMotor
cordFilter
+++NumOfCycl
int O Number of people that cycling, value can be 1 ~ 3
ing
NonMotor color, can be "White" "Orange" "Pink" "Black"
"Red" "Yellow" "Gray" "Blue" "Green" "Purple" "Brown"
Da

"Sliver" "Darkviolet" "Maroon" "Dimgray" "Whitesmoke"


+++Color string O
"Darkorange" "Mistyrose" "Tomato" "Olive" "Gold"
hu

"Darkolivegreen" "Chartreuse" "Greenyellow" "Forestgreen"


aH

"Seagreen" "Deepskyblue" "Cyan" "Other"


NonMotor type, can be : "Non-Motor" "Bicycle" "Tricycle"
"Motorcycle" "DualTriWheelMotorcycle" "LightMotorcycle"
TT

+++Category string O "EmbassyMotorcycle" "MarginalMotorcycle"


P

"AreaoutMotorcycle" "ForeignMotorcycle" "TrialMotorcycle"


AP

"CoachMotorcycle"
+++Helmet int O Helmet status, 0 : unknown, 1 : without helmet, 2 : with helmet
IV

[ Response Params ] ( OK )
[ Example ]
2.

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
89

ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
Request 0%2012:00:00&condition.Types[0]=jpg&condition.DB.NonMotorRecordFilter.NumOfCyclin
fo

g=2&condition.DB.NonMotorRecordFilter.Color=White&condition.DB.NonMotorRecordFilt
r1

er.Category=Bicycle&condition.DB.NonMotorRecordFilter.Helmet=1
Response OK
00

Step 3 Get the media file information found by the finder


M

Table 4-182
URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
EG

Method GET
A

Description Get the media file information found by the finder


[ Request Params ] ( key=value format at URL )
Di

Name Type R/O Param Description


st

object int R The finder object id


rib

count int R Record num to get, should less than 100.


[ Response Params ] ( key=value format )
ut

Name Type R/O Param Description


io

found int R Record num that found.


n

items array<object> R Result record items.


+Channel int R The video channel index start from 0,
s.r

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


.o

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


.

+Type string R File type, should be: "jpg"


+Events array<string> R Events with this record
+FilePath string R File path, string max length is 259
+CutLength int R File length that cut between start time and end time
+Length int O File length of the whole file

General APIs 133


+SummaryNew object R NonMotor info
++Key string R DB record name, should be "NonMotorRecordFilter"
++Value object R DB record value
+++NumOfCycl
int O Number of people that cycling, value can be 1 ~ 3
ing
NonMotor color, can be "White" "Orange" "Pink" "Black"
"Red" "Yellow" "Gray" "Blue" "Green" "Purple" "Brown"
Da

"Sliver" "Darkviolet" "Maroon" "Dimgray" "Whitesmoke"


+++Color string O
"Darkorange" "Mistyrose" "Tomato" "Olive" "Gold"
hu

"Darkolivegreen" "Chartreuse" "Greenyellow" "Forestgreen"


aH

"Seagreen" "Deepskyblue" "Cyan" "Other"


NonMotor type, can be : "Non-Motor" "Bicycle" "Tricycle"
"Motorcycle" "DualTriWheelMotorcycle" "LightMotorcycle"
TT

+++Category string O "EmbassyMotorcycle" "MarginalMotorcycle"


P

"AreaoutMotorcycle" "ForeignMotorcycle" "TrialMotorcycle"


AP

"CoachMotorcycle"
+++Helmet int O Helmet status, 0 : unknown, 1 : without helmet, 2 : with helmet
IV

[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&
2.

Request
count=100
89

found=100
items[0].Channel=1
fo

items[0].StartTime=2011-1-1 12:00:00
r1

items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
00

items[0].Events[0]=NonMotorDetect
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
M

Response
items[0].Length=790
EG

items[0].SummaryNew.Key=NonMotorRecordFilter
items[0].SummaryNew.Value.NumOfCycling=2
A

items[0].SummaryNew.Value.Color=White
Di

items[0].SummaryNew.Value.Category=Bicycle
items[0].SummaryNew.Value.Helmet=1
st


rib

Step 4 Close the finder.


This API is the same as the API in "4.11.5 Find Media Files".
ut

Step 5 Destroy the finder.


io

This API is the same as the API in "4.11.5 Find Media Files".
n

4.11.12 Download Media File with the File Name


s.r
.o

Table 4-183
.

Syntax http://<server>/cgi-bin/RPC_Loadfile/<Filename>
Method GET
Description Download a file by filename. To get filename by chapter file finding.
http://192.168.1.108/cgi-bin/RPC_Loadfile/mnt/sd/2015-01-08/001/dav/19/19.57.12-19.
Example
58.25[M][0@0][0].dav

General APIs 134


HTTP Code: 200 OK
Content-Type: Application/octet-stream
Success Content-Length: <fileLength>
Return Body:
<data>
<data>
Parameters in URL:
Comment
Da

Filename: name of media files which would be downloaded.


hu

4.11.13 Download Media File between Times


aH

Table 4-184
http://<server>/cgi-bin/loadfile.cgi?action=startLoad&channel=<ChannelNo>&startTim
TT

Syntax
e=<starttime>&endTime=<endtime>[&subtype=<typeNo>]
P

Method GET
AP

Description Download the media data between start time and end time.
http://192.168.1.108/cgi-bin/loadfile.cgi?action=startLoad&channel=1&startTime=2012-
Example
IV

10-8%2013:00:01&endTime=2012-10-8%2014:00:01&subtype=0
HTTP Code: 200 OK
2.

Content-Type: Application/octet-stream
89

Success Content-Length:<fileLength>
Return Body:
fo

<data>
r1

<data>
Parameters in URL:
00

ChannelNo: integer, video channel index which starts from 1.


typeNo: the stream type, default 0 if not specified.
M

0-Main Stream
Comment
EG

1-Extra Stream 1
2-Extra Stream 2
A

starttime & endtime: video start time and end time. Time format: yyyy-mm-dd
Di

hh:mm:ss
st

4.11.14 Encrypted Download Media File with the File Name


rib

Table 4-185
ut

http://<server>/cgi-bin/RecordStreamInterleaved.cgi?action=attachStream&path=<File
Syntax
io

name>[&password=<password>]
n

Method GET
s.r

Description Encrypted Download a file by filename. To get filename by chapter file finding.
http://172.29.2.241/cgi-bin/RecordStreamInterleaved.cgi?action=attachStream&path=/
Example
.o

mnt/sd/2019-07-01/001/dav/12/12.36.16-12.36.26[F][0@0][0].dav
.

General APIs 135


HTTP Code: 200 OK
Content-Type: Application/octet-stream
Success Content-Length: <fileLength>
Return Body:
<data>
<data>
Parameters in URL:
Da

Filename: name of media files which would be downloaded.


Comment
password: password for encrypting media file data. if not set password, then use the
hu

preset password
aH

4.12 User management


TT

4.12.1 Get Information of a Particular User


P
AP

Table 4-186
Syntax http://<server>/cgi-bin/userManager.cgi?action=getUserInfo&name=<userName>
IV

Method GET
2.

Description Get user information with name userName.


Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getUserInfo&name=admin
89

user.Name=admin
user.Memo=admin 's account
fo

Success user.Group=admin
r1

Return user.Reserved=true
user.Sharable=true
00

user. AuthList=<authList>
M

Comment —
EG

4.12.2 Get Information of All Users


A

Table 4-187
Di

Syntax http://<server>/cgi-bin/userManager.cgi?action=getUserInfoAll
st

Method GET
rib

Description Get information of all users.


Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getUserInfoAll
ut

users[0].Group=admin
io

users[0].Id=1
users[0].Memo=admin 's account
n

users[0].Name=admin
s.r

Success
users[0].Reserved=true
Return
.o

users[0].Sharable=true
users[0]. AuthList=<authList>
.

users[1].Group=admin

Comment —

General APIs 136


4.12.3 Get Information of All Active Users
Table 4-188
Syntax http://<server>/cgi-bin/userManager.cgi?action=getActiveUserInfoAll
Method GET
Description Get active users.
Da

Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getActiveUserInfoAll
users[0].name=admin
hu

users[0].ip=10.43.2.16
Success
users[0].group=admin
aH

Return
users[0].clienttype=web3.0
users[0].logintime=2011-11-08 09:51:03
TT

Comment —
P

4.12.4 Get Information of a Particular Group


AP
IV

Table 4-189
Syntax http://<server>/cgi-bin/userManager.cgi?action=getGroupInfo&name=<groupName>
2.

Method GET
89

Description Get group setting with name groupName.


Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getGroupInfo&name=admin
fo

group.Name=admin
Success
group.Memo=administrator group
r1

Return
group.AuthorityList=<authList>
Parameters in URL:
00

The device has one or two default user groups: "admin"or "admin"and "user". The
M

"admin"group has all the authorities of operating the device. The "user"group only has
Comment
monitoring and replaying authorities.
EG

groupName: name of the group.


A

If the group named groupName does not exist, the device returns Error.
Di

4.12.5 Get Information of All Groups


st
rib

Table 4-190
Syntax http://<server>/cgi-bin/userManager.cgi?action=getGroupInfoAll
ut

Method GET
io

Description Get information of all groups.


Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getGroupInfoAll
n

group[0].Id=1
s.r

group[0].Name=admin
.o

group[0].Memo=administrator group
Success group[0].AuthorityList=<authList>
.

Return group[0].AuthorityDetail.Bypass[0]=1
group[0].AuthorityDetail.Bypass[1]=2
group[0].AuthorityDetail.Bypass[2]=3

General APIs 137


group[0].AuthorityDetail.AccessControl[0]=1
group[0].AuthorityDetail.AccessControl[1]=3
group[0].AuthorityDetail.AccessControl[2]=5

group[1].Id=1
group[1].Name=user
group[1].Memo=user group
Da

group[1].AuthorityList=<authList>
group[1]….
hu


Comment
aH

4.12.6 Add a New User


TT
P

Table 4-191
AP

http://<server>/cgi-bin/userManager.cgi?action=addUser&user.Name=<userName>&u
Syntax ser.Password=<userPassword>&user.Group=<userGroup>&user.Sharable=<userSh
IV

arable>[&user.Memo=<userMemo>&user.Reserved=<userReserved>]
Method GET
2.

Description Add a user.


89

http://192.168.1.108/cgi-bin/userManager.cgi?action=addUser&user.Name=George&us
Example
er.Password=123456&user.Group=user&user.Sharable=true&user.Reserved=false
fo

Success
OK
r1

Return
Parameters in URL:
00

userGroup: string, the range is "admin"and "user". In different group, the user has
Comment different authorities.
M

userSharable: bool, true means allow multi-point login.


EG

userReserved: bool, true means this user can't be deleted.


A

4.12.7 Delete a User


Di

Table 4-192
st

Syntax http://<server>/cgi-bin/userManager.cgi?action=deleteUser&name=<userName>
rib

Method GET
Description Delete user with name username.
ut

Example http://192.168.1.108/cgi-bin/userManager.cgi?action=deleteUser&name=George
io

Success
OK
n

Return
s.r

Comment —
.o

4.12.8 Modify User Information


.

Table 4-193
http://<server>/cgi-bin/userManager.cgi?action=modifyUser&name=<UserName>&user
Syntax
.Memo=<userMemo>&user.Group=<userGroup>&user.Reserved=<userReserved>&us

General APIs 138


er.Sharable=<userSharable>
Method GET
Description Modify user info.
http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyUser&name=George&user
Example
.Group=admin
Success
OK
Return
Da

Comment User is identified by <UserName>, other params are the same with AddUser.
hu

4.12.9 Modify User's Password


aH

Table 4-194
TT

http://<server>/cgi-bin/userManager.cgi?action=modifyPassword&name=<username>
Syntax
&pwd=<newPwd>&pwdOld=<oldPwd>
P

Method GET
AP

Description Modify user password.


http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyPassword&name=George
IV

Example
&pwd=abcdef&pwdOld=123456
Success
2.

OK
Return
89

Comment Old password oldPwd should be supplied, new password is newPwd.


fo

4.12.10 Manager Modify Common User's Password


r1

Table 4-195
00

http://<server>/cgi-bin/userManager.cgi?action=modifyPasswordByManager&userNam
Syntax e=<username>&pwd=<newPwd>&managerName=<managerName>&managerPwd=
M

<managerPwd>&accountType=<accountType>
EG

Method GET
Description Manager Modify common user's password.
A

http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyPasswordByManager&use
Di

Example rName=Geoge&pwd=123456&managerName=admin&managerPwd=abc123&account
st

Type=0
Success
rib

OK
Return
ut

the name of common user to be modified is username


new password is newPwd
io

Comment manager name is only admin


n

manager password is managerPwd, that is password of admin


s.r

accountType support 0 is Dahua account, 1 is Onvif account


.o
.

General APIs 139


4.13 Log

4.13.1 Find Logs


1. Whether or not found logs satisfied the conditions
Da

Table 4-196
http://<server>/cgi-bin/log.cgi?action=startFind&condition.StartTime=<start>&condition
Syntax
hu

.EndTime=<end>[&condition.Type=<type>]
Method GET
aH

Description Start to find log.


Find log between 2011-1-1 12:00:00 and 2011-1-10 12:00:00, URL is:
TT

Example http://192.168.1.108/cgi-bin/log.cgi?action=startFind&condition.StartTime=2011-1-1%2
012:00:00&condition.EndTime=2011-1-10%2012:00:00
P

Success token=1
AP

Return count=100
Parameters in URL:
IV

start/end: the start/end time of log. Format is: yyyy-mm-dd hh:mm:ss.


2.

In response, there is a token for further log finding process. If token is greater than 0,
Comment logs are found; otherwise no logs are found.
89

Type: log type. The range is { "System", "Config", "Event", "Storage", "Account", "Data",
"File", "CourseRecord" }.
fo

count: The logcount for the search condition.


r1

2. Get the particular number of logs


00

Table 4-197
Syntax http://<server>/cgi-bin/log.cgi?action=doFind&token=<TokenValue>&count=<logCount>
M

Method GET
EG

Description Find log with token TokenValue and count logCount.


Example http://192.168.1.108/cgi-bin/log.cgi?action=doFind&token=1&count=100
A

found=2
Di

items[0].RecNo=789
items[0].Time=2011-05-20 11:59:10
st

items[0].Type=ClearLog
rib

items[0].User=admin
Success items[1].Detail.Compression=H.264->MJPG
ut

Return items[1].Detail.Data=Encode
io

items[1].RecNo=790
n

items[1].Time=2011-05-20 11:59:21
s.r

items[1].Type=SaveConfig
items[1].User=System
.o


.

Parameters in URL:
The TokenValue is got by startFind in the above section, and logCount is the count of
Comment
logs for this query.
The maximum value of logCount is 100.

General APIs 140


Appendix:

Field in Description
Response
found Count of found log, found is 0 if no log is found.
User User name.
Type Log type.
Da

Time Time of this log.


RecNo Log number.
hu

Detail Log details.


3. Stop query logs
aH

Table 4-198
TT

Syntax http://<server>/cgi-bin/log.cgi?action=stopFind&token=<TokenValue>
Method GET
P

Description Stop query log by token TokenValue.


AP

Example http://192.168.1.108/cgi-bin/log.cgi?action=stopFind&token=1
Success
IV

OK
Return
Parameters in URL:
2.

Comment
The TokenValue is got by startFind in above section
89

4.13.2 Clear All the Logs


fo
r1

Table 4-199
00

Syntax http://<server>/cgi-bin/log.cgi?action=clear
M

Method GET
Description Clear all the logs.
EG

Example http://192.168.1.108/cgi-bin/log.cgi?action=clear
Success
A

OK
Return
Di

Comment —
st

4.13.3 Backup Logs


rib
ut

Table 4-200
http://<server>/cgi-bin/Log.backup?action=All&condition.StartTime=<startTime>&cond
io

Syntax
ition.EndTime=<endTime>
n

Method GET
s.r

Download the log information between the start time and the end time as a file named
Description
Log.Backup default.
.o

http://192.168.1.108/cgi-bin/Log.backup?action=All&condition.StartTime=2014-8-25%2
.

Example
000:02:32&condition.EndTime=2020-8-25%2001:02:32
HTTP/1.1 200 OK
Success
CONTENT-LENGTH: 743087
Return
CONNECTION: close

General APIs 141


Content-type: application/binarytet-stream; charset=utf-8

&w_User: default
&Time: 2014-09-01 15:20:45
&Type: VideoLoss
&Content: EventType: VideoLoss
channel: <8>
Da

StartTime: 2014-09-01 15:20:45


hu


Parameters in URL:
aH

startTime/endTime: the start/end time when log info built. 24 hour Format, as:
yyyy-mm-dd hh:mm:ss.
TT

Comment
For example:
P

2014-8-25 00:02:32
AP

2020-8-25 01:02:32
IV

4.13.4 Seek Find Logs


2.
89

http://<server>/cgi-bin/log.cgi?action=doSeekFind&token=<TokenValue>&offset=<offsetVal
Syntax
ue>&count=<logCount>
fo

Method GET
r1

Descripti
Find log with token TokenValue, offset offsetValue and count logCount.
on
00

http://192.168.1.108/cgi-bin/log.cgi?action=doSeekFind&token=46878&offset=200&count=2
Example
00
M

found=2
EG

items[0].RecNo=789
items[0].Time=2011-05-20 11:59:10
A

items[0].Type=ClearLog
Di

items[0].User=admin
items[0].Detail.Compression=H.264->MJPG
st

items[0].Detail.Data=Encode
rib

Success
items[1].RecNo=790
Return
items[1].Time=2011-05-20 11:59:21
ut

items[1].Type=SaveConfig
io

items[1].User=System
n

items[1].Detail.Compression=H.264->MJPG
s.r

items[1].Detail.Data=Encode
.o


.

Parameters in URL:
Comme The TokenValue is got by startFind in the above section, and logCount is the count of logs
nt for this query.offsetValue is the number which count from the first matched.
The maximum value of logCount is 100.

General APIs 142


4.14 Upgrader

4.14.1 Strat to Upgrade


Table 4-201
Syntax http://<server>/cgi-bin/upgrader.cgi?action=uploadFirmware
Da

Method POST
Use this message to upload the firmware, and when the device receiving all the data
hu

Description successfully, it will start to upgrade the device, and then use the getState method to get
aH

the state.
POST /cgi-bin/upgrader.cgi?action=uploadFirmware HTTP/1.1
Host: 192.168.1.108
TT

Connection: keep-alive
P

Content-Type: multipart/form-data; boundary=---------------------------8655433224198


AP

Content-Length: xxxxxxxxx
IV

Example -----------------------------8655433224198
Content-Disposition:form-data;name="upgrade"; filename= "xxxxxx.bin"
2.

Content-Type: application/octet-stream
89

Firmware data….
fo
r1

-----------------------------8655433224198--
Success
OK
00

Return
Comment —
M
EG

4.14.2 Get Upgrade State


A

Table 4-202
Di

Syntax http://<server>/cgi-bin/upgrader.cgi?action=getState
Method GET
st

Use this message to upload the firmware, and when the device receiving all the data
rib

Description successfully, it will start to upgrade the device, and then use the getState method to get
the state.
ut

Example http://192.168.1.108/cgi-bin/upgrader.cgi?action=getState
io

Success state.State=Upgrading
n

Return state.Progress=45
s.r

Parameters in Response:
State: the state of the upgrade, it can be Preparing, Downloading, DownloadFailed,
Comment
.o

Upgrading, Invalid, Failed, Succeeded, Cancelled, and NotEnoughMemory.


.

Progress: the progress of the upgrade.

General APIs 143


4.14.3 Set upgrader url
Table 4-203
Syntax http://<server>/cgi-bin/upgrader.cgi?action=updateFirmwareByUrl
Method GET
Description Set upgrader url
Da

Example http://192.168.1.108//cgi-bin/upgrader.cgi?action=updateFirmwareByUrl&Url=https://aa
a/bbb/ccc/license.bin
hu

Success OK
Return
aH

Comment url with Upgrade packet address


TT

4.15 Wiper
P

4.15.1 Move Continuously


AP
IV

Table 4-204
http://<server>/cgi-bin/rainBrush.cgi?action=moveContinuously&interval=<Second>[&c
2.

Syntax
hannel=<ChannelNo>]
89

Method GET
Description Control the wiper to move continuously.
fo

Example http://192.168.1.108/cgi-bin/rainBrush.cgi?action=moveContinuously&interval=5
r1

Success
OK
Return
00

Second: integer, rain brush movement time interval which start from 1.
Comment
ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
M
EG

4.15.2 Stop Move


A

Table 4-205
Di

Syntax http://<server>/cgi-bin/rainBrush.cgi?action=stopMove[&channel=<ChannelNo>]
st

Method GET
Description Control the wiper to stop moving.
rib

Example http://192.168.1.108/cgi-bin/rainBrush.cgi?action=stopMove
ut

Success
OK
Return
io

Comment ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.
n
s.r

4.15.3 Move Once


.o

Table 4-206
.

Syntax http://<server>/cgi-bin/rainBrush.cgi?action=moveOnce[&channel=<ChannelNo>]
Method GET
Description Control the wiper to move once.
Example http://192.168.1.108/cgi-bin/rainBrush.cgi?action=moveOnce

General APIs 144


Success
OK
Return
Comment ChannelNo: integer, video channel index which starts from 1, default 1 if not specified.

4.16 Security
Da

4.16.1 Set User Login Authentication Policy


hu

Table 4-207
aH

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
TT

Method GET
P

Description Set User Login Authenticate Policy


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LoginAuthCtrl.PriSvr
AP

Example
Policy=2
IV

Success
OK
Return
2.

LoginAuthCtrl.PriSvrPolicy : DVRIP login policy setting for Dahua Private Protocol.


89

Comment 1 - safe mode, only support digest authentication. (Recommended.);


2 - compatible mode for traditional devices;
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

General APIs 145


5 Camera APIs
5.1 Image
Da

5.1.1 Brightness, Contrast and Saturation


hu
aH

 Get brightness, contrast and saturation

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
TT

Method GET
P

Description Get brightness, contrast and saturation


AP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
Success head.Name=Day,
IV

Return head.Brightness=50,
head.Contrast=50,
2.

head.Saturation=50,
89

head.Hue=50,
head.Gamma=50,
fo

head.ChromaSuppress=50,
head.Style=Standard,
r1

head.TimeSection=1 00:00:00-24:00:00
00

Comment Parameters in URL:


paramName and paramValue are as table below.
M

In table below,
EG

head = table.VideoInSharpness [ChannelNo] [ConfigNo]


ChannelNo: integer, array index starts from 0, which means video channel (equals to
A

video channel index -1, and so 0 means channel 1).


Di

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.
st
rib

 Set brightness, contrast and saturation


ut

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
io

Method SET
n

Description Set brightness, contrast and saturation


s.r

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoColor[0][0].Brig
Example
htness=50
.o

Success
.

OK
Return
Parameters in URL:
Comment paramName and paramValue are as table below.
In table below,

Camera APIs 146


head = table.VideoInSharpness [ChannelNo] [ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:
Da

ParamName ParamValue type Description


head.Brightness integer Brightness, range is [0—100]
hu

head.Contrast integer Contrast, range is [0—100]


aH

head.Saturation integer Saturation, range is [0—100]

5.1.2 Sharpness
TT
P

 Get sharpness
AP

Table 5-1
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInSharpness
IV

Method GET
2.

Description Get sharpness


89

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInSharp
Example
ness
fo

Success head.Level=4
Return head.Sharpness=8
r1

Parameters in URL:
paramName and paramValue are as table below.
00

In table below,
M

head = table.VideoInSharpness [ChannelNo] [ConfigNo]


Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
EG

video channel index -1, and so 0 means channel 1).


A

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.
Di

Set sharpness
st


rib

Table 5-2
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
ut

Syntax
alue>[&<paramName>=<paramValue>…]
io

Method SET
Description Set sharpness
n

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInSharpness[0]
s.r

Example
[0].Level=10&VideoInSharpness[0][0].Mode=1&VideoInSharpness[0][0].Sharpness=0
.o

Success
OK
Return
.

Parameters in URL:
paramName and paramValue are as table below.
Comment
In table below,
head = VideoInSharpness [ChannelNo] [ConfigNo]

Camera APIs 147


ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:

ParamName ParamValue type Description


Da

head.Sharpness integer Range is 0—100


head.Level integer Range is 0—100
hu

5.1.3 Flip, Mirror and Rotate90


aH

Get flip, mirror and Rotate90


TT

Table 5-3
P

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoImageControl
AP

Method GET
Description Get flip, mirror and Rotate90
IV

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoImageC
Example
2.

ontrol
89

head.Flip=true
Success
head.Mirror=false
Return
fo

head.Rotate90=0
Parameters in Response:
r1

head = table.VideoImageControl [ChannelNo]


ChannelNo: integer, array index starts from 0, which means video channel (equals to
00

Comment
video channel index -1, and so 0 means channel 1).
M

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.
EG

 Set flip, mirror and Rotate90


A

Table 5-4
Di

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
st

alue>[&<paramName>=<paramValue>…]
rib

Method SET
Description Set flip, mirror and Rotate90
ut

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoImageControl[
Example
io

0].Flip=true
Success
n

OK
Return
s.r

Parameters in URL:
.o

head = VideoImageControl [ChannelNo]


ChannelNo: integer, array index starts from 0, which means video channel (equals to
.

Comment
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:

Camera APIs 148


ParamName ParamValue type Description
true: enable video flip function
head.Flip bool
false: disable video flip function
true: enable video mirror function
head.Mirror bool
false: disable video mirror function
Range is {0,1,2}
Video rotation:
Da

head.Rotate90 integer 0: No rotate


1: clockwise rotate 90°
hu

2: anticlockwise rotate 90°


aH

5.2 Exposure
TT
P

5.2.1 Exposure Config


AP
IV

 Get exposure

Table 5-5
2.

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInExposure
89

Method GET
Description Get exposure
fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInExpos
Example
r1

ure
head.AntiFlicker=0
00

head.Gain=50
head.GainMax=50
M

head.GainMin=0
EG

Success
head.Iris=50
Return
head.IrisAuto=false
A

head.Mode=0
Di

head.Value1=40
st

head.Value2=40
Parameters in Response:
rib

head = table.VideoInExposure[ChannelNo][ConfigNo]
ut

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
io

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
n

night, and 2 means config for normal scene.


s.r

 Set exposure
.o

Table 5-6
.

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set exposure

Camera APIs 149


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInExposure[0][
Example
0].Iris=50
Success
OK
Return
Parameters in URL:
head = VideoInExposure[ChannelNo][ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Da

Comment
video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
hu

night, and 2 means config for normal scene.


aH

Appendix:

ParamName ParamValue type Description


TT

Range is {0,1,2}
P

AntiFlicker mode:
AP

head.AntiFlicker integer 0: Outdoor


1: 50 Hz AntiFlicker
IV

2: 60 Hz AntiFlicker
Range is [0—100]
2.

head.Gain integer If GainAuto is true, it's upper limit of auto gain,


89

else it's the fixed gain adjust value.


Range is 0–100; the value must be greater than
head.GainMax integer
fo

GainMin.
r1

Range is 0–100; the value must be smaller than


head.GainMin integer
GainMax.
00

head.Iris integer Manual Iris setting. Range is 0–100.


Enable Iris automatically.
M

true: IrisAuto
head.IrisAuto bool
EG

false: No IrisAuto
A

0: "Auto" by default
Di

1: Low noise
2: Anti-smear
st

4: Manual (range)
rib

head.Mode integer 5: Aperture priority


6: Manual (fixed)
ut

7: Gain priority
io

8: Shutter priority
n

9: Flash light matching mode


s.r

Range is [0-1000], unit is millisecond


If ExposureSpeed is 0(AutoExposure enable), it's
head.Value1 float
.o

lower limit of AutoExposure time, otherwise it's


.

time of manualExposure
Range is [0-1000], unit is millisecond
head.Value2 float Upper limit of AutoExposure time, should be
bigger than ExposureValue1

Camera APIs 150


5.3 Backlight

5.3.1 Backlight Config


 Get backlight
Da

Table 5-7
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInBacklight
hu

Method GET
Description Get backlight
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInBackli
Example
ght
TT

head.GlareInhibition=50
Success
head.Mode=Off
P

Return
head.WideDynamicRange=50
AP

Parameters in Response:
head = table.VideoInBacklight[ChannelNo][ConfigNo]
IV

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
2.

video channel index -1, and so 0 means channel 1).


ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
89

night, and 2 means config for normal scene.


fo

 Set backlight
r1

Table 5-8
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
00

Syntax
alue>[&<paramName>=<paramValue>…]
M

Method SET
Description Set backlight
EG

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInBacklight[0][
Example
A

0].GlareInhibition=50
Success
Di

OK
Return
st

Parameters in URL:
rib

head = VideoInBacklight[ChannelNo][ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
ut

video channel index -1, and so 0 means channel 1).


io

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.
n
s.r

Appendix:
.o

ParamName ParamValue type Description


head.GlareInhibition integer Range is 1–100.
.

Off: Switched off


Backlight: Backlight compensation
head.Mode char[32]
GlareInhibition: HLC
WideDynamic: WDR

Camera APIs 151


ParamName ParamValue type Description
SSA: Scene adaptation
head.WideDynamicRange integer Range is 1–100.

5.4 White Balance


Da

5.4.1 White Balance Config


hu

 Get white balance


aH

Table 5-9
TT

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInWhiteBalan
Syntax
ce
P

Method GET
AP

Description Get white balance


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInWhite
IV

Example
Balance
head.GainBlue=50
2.

Success
head.GainRed=50
89

Return
head.Mode=Auto
Parameters in Response:
fo

head = table.VideoInWhiteBalance[ChannelNo][ColorConfigNo]
r1

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
00

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.
M
EG

 Set white balance

Table 5-10
A

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
Di

alue>[&<paramName>=<paramValue>…]
st

Method SET
Description Set white balance
rib

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInWhiteBalanc
Example
ut

e[0][0].GainBlue=50
Success
io

OK
Return
n

Parameters in URL:
s.r

head = VideoInWhiteBalance[ChannelNo][ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
.o

Comment
video channel index -1, and so 0 means channel 1).
.

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
night, and 2 means config for normal scene.

Appendix:

Camera APIs 152


ParamName ParamValue type Description
Range is [0—100]
head.GainBlue integer Gain for blue value, Value is effective when
WhiteBalance is "Custom."
Range is [0—100]
head.GainRed integer Gain for red value, Value is effective when
WhiteBalance is "Custom."
Da

Auto; Indoor; Outdoor; ATW; Manual; Sodium;


head.Mode char[][32]
Natural; StreetLamp; ManualDatum
hu
aH

5.5 Day-Night
TT

5.5.1 Day-Night Config


P
AP

 Get day-night
IV

Table 5-11
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInDayNight
2.

Method GET
89

Description Get day-night


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInDayNight
fo

head.Delay=10
r1

Success head.Mode=Brightness
Return head.Sensitivity=2
00

head.Type=Mechanism
M

head = table.VideoInDayNight[ChannelNo][ConfigNo]:
ChannelNo: integer, array index starts from 0, which means video channel (equals to
EG

Comment video channel index -1, and so 0 means channel 1).


ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for night,
A

and 2 means config for normal scene.


Di

 Set Day-Night
st
rib

Table 5-12
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
ut

alue>[&<paramName>=<paramValue>…]
io

Method SET
Description Set day-night
n

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInDayNight[0][
s.r

Example
0].Mode=BlackWhite
.o

Success
OK
Return
.

Parameters in URL:
Comment ParamName and paramValue are as table below. In table below,
head = VideoInDayNight[ChannelNo][ConfigNo]
Appendix:

Camera APIs 153


ParamName ParamValue type Description
The range is {"Electron", "Mechanism", "NightICR",
head.Type string
"Auto" }, the way of ICR switching.
The range is {"Color", "Brightness", "BlackWhite,
"Photoresistor", "Gain"}.
"Color": Always "color"
head.Mode string "Brightness": Day/Night Auto
Da

"BlackWhite": Always black-and-white


"Photoresistor": Switch according to photoresistor,
hu

"Gain": Switch according to gain


aH

head.Sensitivity integer Range is [1-3]. Sensitivity of switching mode


Range is [2-10].
head.Delay integer
Delay seconds when switching mode.
TT
P

5.6 Zoom and Focus


AP

To get the capability set of video input, refer to 4.5.12. For instance, you can use the following URL:
IV

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCaps&channel=1
If ElectricFocus or SyncFocus of the return value is true, use 5.6.1 ~ 5.6.4; Otherwise, use 5.6.5 ~ 5.6.6 .
2.
89

5.6.1 Adjust Focus


fo

Table 5-13
r1

http://<server>/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=<zoomNo>[&cha
Syntax
nnel=<ChannelNo>]
00

Method GET
Description Ajust magnification and the focus.
M

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.5&zoom=
Example
EG

-0.5
Success
A

OK
Return
Di

Parameters in URL:
focusNo : float, the range is between 0 and 1; -1 means reset to position 0.
st

Comment
zoomNo : float, the range is between 0 and 1; -1 means reset to position 0.
rib

ChannelNo: integer, video channel index which starts from 1.


ut

5.6.2 Adjust Focus Continuously


io
n

Table 5-14
s.r

http://<server>/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus=<fo
Syntax
cusNo>&zoom=<zoomNo>[&channel=<ChannelNo>]
.o

Method GET
.

Description Adjust magnification and the focus continuously.

Camera APIs 154


If we want to adjust focus, the API like this:
http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus
=0.02&zoom=-1
Example
and when the motor is moving, we send below command to let it stop:
http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus
=0&zoom=-1
Success
OK
Da

Return
Parameters in URL:
hu

focusNo: float, the range is -1 < focus < 1; 0 means stop.


aH

zoomNo: float, the range is -1 < zoom < 1; 0 means stop.


ChannelNo: integer, video channel index which starts from 1.
TT

The value means the moving speed of motor lens, positive value means move forwards,
Comment
P

negative value means move backwards.


AP

This command is used to drive the lens move continuously, until it reaches end.
When the motor is moving, you can send this command again with "focus" or "zoom"
IV

parameter as 0 to stop it immediately.


In this command, when you adjust the focus parameter, the zoom parameter should be
2.

-1, and the focus parameter should be -1 when adjust the zoom parameter.
89

5.6.3 Auto Focus


fo
r1

Table 5-15
Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=autoFocus[&channel=<ChannelNo>]
00

Method GET
Description Auto focus.
M

Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=autoFocus
EG

Success
OK
Return
A

Parameters in URL:
Comment
Di

ChannelNo: integer, video channel index which starts from 1.


st

5.6.4 Get Focus Status


rib
ut

Table 5-16
http://<server>/cgi-bin/devVideoInput.cgi?action=getFocusStatus[&channel=<Channel
io

Syntax
No>]
n

Method GET
s.r

Description Get device focus status.


Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getFocusStatus
.o

status.Focus=0.5
Success
.

status.Zoom=0.5
Return
status.Status=Normal
Parameters in URL:
Comment ChannelNo: integer, video channel index which starts from 1.
Parameters in Response:

Camera APIs 155


The range of status.Status is "Normal" and "Autofocus". This command must be
continual executed until status.Status is "Normal".

5.6.5 Zoom Config


 Get zoom
Da

Table 5-17
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoom
hu

Method GET
Description Get zoom
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoo
Example
m
TT

head.DigitalZoom=true
Success Return
head.Speed=7
P

Parameters in URL:
AP

head = table.VideoInZoom[ChannelNo][ConfigNo]
Comment ChannelNo: integer, array index starts from 0, which means video channel (equals to
IV

video channel index -1, and so 0 means channel 1).


2.

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means


89

 Set zoom
fo

Table 5-18
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
r1

Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
00

Description Set zoom


M

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInZoom[0][0].D
Example
igitalZoom=false&VideoInZoom[0][0].Speed=8
EG

Success
OK
A

Return
Parameters in URL:
Di

head = VideoInZoom[ChannelNo][ConfigNo]
st

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
rib

video channel index -1, and so 0 means channel 1).


ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
ut

night, and 2 means config for normal scene.


io

Appendix:
n

ParamName ParamValue type Description


s.r

true: Enable Digital Zoom


head.DigitalZoom integer
.o

false: Disable Digital Zoom


integer Range is 0—100
.

head.Speed

5.6.6 Focus Config


 Get focus

Camera APIs 156


Table 5-19
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInFocus
Method GET
Description Get focus
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInFocu
Example
s
head.Name=Day,
Da

head.Mode=0,
head.Sensitivity=1,
hu

Success head.FocusLimitSelectMode=Manual,
aH

Return head.FocusLimit=2000,
head.FocusFarLimit=5000,
head.AutoFocusTrace=0,
TT

head.IRCorrection=0
P

Comment —
AP

 Set focus
IV

Table 5-20
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
2.

alue>[&<paramName>=<paramValue>…]
89

Method SET
Description Set focus
fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInFocus[0][0].F
Example
ocusLimit=1000
r1

Success
OK
Return
00

Parameters in URL:
M

paramName and paramValue are as table below.


In table below,
EG

head = VideoInFocus [ChannelNo] [ConfigNo]


Comment
A

ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Di

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
st

night, and 2 means config for normal scene.


rib

Appendix:
ut

ParamName ParamValue type Description


io

2—Auto focus, 3—Half auto focus, 4—Manual


head.Mode integer
focus
n

head.Name string Scene name


s.r

100, 1000, 2000, 3000, 5000.


.o

If xxxx1 is included in the queue, replace 1 with 0,


and add + sign at the end; for instance, 200001
.

head.FocusLimit integer
will be displayed as 200000mm+.
Get the "FocusLimit" capacity to determine the
value range.
head.FocusFarLimit integer Customized requirement. Remote focus limit

Camera APIs 157


ParamName ParamValue type Description
recommendation, unit: mm
focus trace
head.AutoFocusTrace integer
0 for off , 1 for on
IR Correction
0: don’t correct
head.IRCorrection integer
1: correct manually
Da

2: auto correct
Range is 0,1,2
hu

head.Sensitivity integer
0—high, 1—default, 2—low
aH

head.FocusLimitSelectMode string Manual or Auto.

5.7 Lighting
TT
P

5.7.1 Lighting Config


AP

Get lighting
IV

Table 5-21
2.

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Lighting
89

Method GET
Description Get lighting
fo

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Lighting
r1

head.Correction=50
head.FarLight[0].Angle=0
00

head.FarLight[0].Light=0
Success head.Mode=ZoomPrio
M

Return head.NearLight[0].Angle=0
EG

head.NearLight[0].Light=0
head.MiddleLight[0].Angle=50
A

head.MiddleLight[0].Light=50
Di

head = table.Lighting[ChannelNo][ConfigNo]:
st

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment video channel index -1, and so 0 means channel 1).
rib

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for night,
ut

and 2 means config for normal scene.


io

 Set lighting
n

Table 5-22
s.r

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
.o

Method GET
.

Description Set lighting


Turn on light:
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].FarLig
ht[0].Light=10&Lighting[0][0].NearLight[0].Light=90&Lighting[0][0].Mode=Manual

Camera APIs 158


Shift the light to ZoomPrio mode:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].Correct
ion=50&Lighting[0][0].Mode=ZoomPrio
Success
OK
Return
Parameters in URL:
Da

paramName and paramValue are as table below.


In table below,
hu

Comment head = Lighting[ChannelNo][ConfigNo]


aH

Some lighting equipment has the following restriction:


Lighting[0][0].FarLight[0].Light + Lighting[0][0].NearLight[0].Light+ Lighting[0][0].
MiddleLight [0]. Light <=100.
TT

Appendix:
P
AP

ParamName ParamValue type Description


Light mode.
IV

The range is {"Manual", "Auto", "Off",


"ZoomPrio"}.
2.

head.Mode string
The following are special for composite lamps.
89

The range is { "Timing" , "SmartLight" ,


"ExclusiveManual" }
fo

Light compensation.
r1

head.Correction integer The range is [0—100], effective in ZoomPrio


mode.
00

Range is [0—100].
head.FarLight[Index].Light integer
The luminance of far light.
M

Range is [0—100].
head.MiddleLight[Index].Light integer
EG

The luminance of middle light.


Range is [0—100].
A

head.NearLight[Index].Light integer
The luminance of near light.
Di

5.8 Video in Options


st
rib

5.8.1 Video in Options Config


ut
io

It’s not recommended to use the CGI command from “ video in options ” ; It’s now recommended to
use the commands in 5.1 – 5.7.
n

 Get video in options


s.r

Table 5-23
.o

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions
.

Method GET
Get video in options config, such as Backlight, ExposureSpeed, DayNightColor,
Description
DayOptions, NightOptions, and NormalOptions.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptio
Example
ns

Camera APIs 159


head.Backlight=0
head.DayNightColor=false
head.ExposureSpeed=0
head.ExposureValue1=0.100000
head.ExposureValue2=80.000000
head.ExternalSync=0
head.ExternalSyncPhase=0
Da

head.FlashControl.Mode=0
head.FlashControl.Pole=0
hu

head.FlashControl.Value=0
aH

head.FlashControl.PreValue=0
head.Flip=false
head.Gain=50
TT

head.GainAuto=true
P

head.IrisAuto=false
AP

head.Mirror=false
head.NightOptions.AntiFlicker=0
IV

head.NightOptions.Backlight=0
head.NightOptions.BacklightRegion[0]=3096
2.

head.NightOptions.BacklightRegion[1]=3096
89

head.NightOptions.BacklightRegion[2]=5096
head.NightOptions.BacklightRegion[3]=5096
fo

head.NightOptions.BrightnessThreshold=50
Success
r1

head.NightOptions.DayNightColor=2
Return
head.NightOptions.ExposureMode=0
00

head.NightOptions.ExposureSpeed=0
head.NightOptions.ExposureValue1=0
M

head.NightOptions.ExposureValue2=40
EG

head.NightOptions.ExternalSyncPhase=125
head.NightOptions.Flip=false
A

head.NightOptions.Gain=50
Di

head.NightOptions.GainAuto=true
head.NightOptions.GainBlue=50
st

head.NightOptions.GainGreen=50
rib

head.NightOptions.GainMax=50
head.NightOptions.GainMin=0
ut

head.NightOptions.GainRed=50
io

head.NightOptions.GlareInhibition=0
n

head.NightOptions.IrisAuto=true
head.NightOptions.Mirror=false
s.r

head.NightOptions.Profile=3
.o

head.NightOptions.ReferenceLevel=50
head.NightOptions.Rotate90=0
.

head.NightOptions.SunriseHour=0
head.NightOptions.SunriseMinute=0
head.NightOptions.SunriseSecond=0
head.NightOptions.SunsetHour=23

Camera APIs 160


head.NightOptions.SunsetMinute=59
head.NightOptions.SunsetSecond=59
head.NightOptions.SwitchMode=4
head.NightOptions.WhiteBalance=Auto
head.NightOptions.WideDynamicRange=0
head.NightOptions.WideDynamicRangeMode=0
head.NormalOptions.AntiFlicker=0
Da

head.NormalOptions.Backlight=0
head.NormalOptions.BacklightRegion[0]=3096
hu

head.NormalOptions.BacklightRegion[1]=3096
aH

head.NormalOptions.BacklightRegion[2]=5096
head.NormalOptions.BacklightRegion[3]=5096
head.NormalOptions.BrightnessThreshold=50
TT

head.NormalOptions.DayNightColor=1
P

head.NormalOptions.ExposureMode=0
AP

head.NormalOptions.ExposureSpeed=0
head.NormalOptions.ExposureValue1=0
IV

head.NormalOptions.ExposureValue2=40
head.NormalOptions.ExternalSyncPhase=125
2.

head.NormalOptions.Flip=false
89

head.NormalOptions.Gain=50
head.NormalOptions.GainAuto=true
fo

head.NormalOptions.GainBlue=50
r1

head.NormalOptions.GainGreen=50
head.NormalOptions.GainMax=50
00

head.NormalOptions.GainMin=0
head.NormalOptions.GainRed=50
M

head.NormalOptions.GlareInhibition=0
EG

head.NormalOptions.IrisAuto=true
head.NormalOptions.Mirror=false
A

head.NormalOptions.Profile=0
Di

head.NormalOptions.ReferenceLevel=50
head.NormalOptions.Rotate90=0
st

head.NormalOptions.SunriseHour=0
rib

head.NormalOptions.SunriseMinute=0
head.NormalOptions.SunriseSecond=0
ut

head.NormalOptions.SunsetHour=23
io

head.NormalOptions.SunsetMinute=59
n

head.NormalOptions.SunsetSecond=59
head.NormalOptions.SwitchMode=0
s.r

head.ReferenceLevel=50
.o

head.ReferenceLevelEnable=false
head.Rotate90=0
.

head.SignalFormat=BT656
head.WhiteBalance=Disable
Parameters in Response:
Comment
head = table.VideoInOptions[ChannelNo]

Camera APIs 161


ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set video in options

Table 5-24
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Da

Method GET
Set video in options config, such as Backlight, ExposureSpeed, DayNightColor,
Description
hu

DayOptions, NightOptions, and NormalOptions.


Set Auto Exposure:
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=0&VideoInOptions[0].ExposureSpeed=0
TT

Set Low Noise:


P

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
AP

xposureMode=1&VideoInOptions[0].ExposureSpeed=0&VideoInOptions[0].GainMin=0
&VideoInOptions[0].GainMax=60
IV
2.

Set Low Motion Blur:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
89

xposureMode=2&VideoInOptions[0].ExposureSpeed=0&VideoInOptions[0].GainMin=0
&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=0&VideoInOptio
fo

ns[0].ExposureValue2=20
r1

Set Manual:
00

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
M

xposureMode=4&VideoInOptions[0].ExposureSpeed=32&VideoInOptions[0].GainMin=
Example 0&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=40&VideoInOp
EG

tions[0].ExposureValue2=40
A

Set SmartIRExposure:
Di

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].S
st

martIRExposure=true
rib

Set Video Rotate:


ut

Filp:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].Fli
io

p=true
n

Mirror:
s.r

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].Mi
rror=true
.o

Or turn 90°:
.

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].R
otate90=1

Set White Balance:

Camera APIs 162


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
hiteBalance=Night
Or
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
hiteBalance=Custom&VideoInOptions[0].GainRed=50&VideoInOptions[0].GainBlue=50
&VideoInOptions[0].GainGreen=50
(Sometimes you should set mode first before set GainRed or GainBlue:
Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
hiteBalance=Custom )
hu

Success
OK
Return
aH

Parameters in URL:
In table below, head = VideoInOptions[ChannelNo]
TT

Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
P

video channel index -1, and so 0 means channel 1).


AP

Appendix:
IV

ParamName ParamValue type Description


Range is [0—n]
2.

n depends on capability in GetVideoInputCaps


89

0: backlight closed.
head.Backlight integer
1: backlight grade 1
fo

...
r1

n - backlight grade n
Range is {0,1,2}
00

0: always multicolor
head.DayNightColor integer
1: autoswitch along with brightness,
M

2: always monochrome
EG

Range is {0,1,2, 4}
0: AutoExposure
A

head.ExposureMode integer 1: Gain first


Di

2: Exposure first
4: Manual.
st

Range is [0 — n+1]
rib

n depends on capability in GetVideoInputCaps


0: AutoExposure
ut

head.ExposureSpeed integer 1-n-1: manual Exposure grade


io

n: AutoExposure with time limit.


n

n+1: manualExposure with user-defined time


(n is supported maximum exposure grade )
s.r

Range is [0.1—80], unit is millisecond


.o

If ExposureSpeed is 0(AutoExposure enable), it's


head.ExposureValue1 float
.

lower limit of AutoExposure time, otherwise it's


time of manualExposure
Range is [0.1-80], unit is millisecond
head.ExposureValue2 float Upper limit of AutoExposure time, should be bigger
than ExposureValue1

Camera APIs 163


ParamName ParamValue type Description
Range is {0,1}
External Synchronous
head.ExternalSync integer
0: Internal Synchronization
1: External Synchronous
Range is [0°—360°]
head.ExternalSyncPhase foat
External Synchronous Signal Phase
Da

head.SmartIRExposure bool true: enable, false: disable


Range is {0,1,2}
hu

0: forbid flash
head.FlashControl.Mode integer
aH

1: always flash
2: auto flash
Range is {0,1, 2, 3}
TT

Trigger mode:
P

0: low level
head.FlashControl.Pole integer
AP

1: high level
2: rising-edge
IV

3: falling-edge
Range is [0—15]
2.

Flashlight time-unit:
89

0: 0us,
1: 64us,
integer
fo

head.FlashControl.Value
2: 128us,
r1

3: 192us

00

15 - 960us
Range is [0—100]
M

head.FlashControl.PreValue integer It is threshold of brightness value: if brightness is


EG

less than this value, flash light will begin to work.


true: enable video flip function
bool
A

head.Flip
false: disable video flip function
Di

Range is [0—100]
head.Gain integer If GainAuto is true, it's upper limit of auto gain, else
st

it's the fixed gain adjust value.


rib

Range is [0—100]
integer Gain for blue value, Value is effective when
ut

head.GainBlue
WhiteBalance is "Custom."
io

Range is [0—100]
n

head.GainRed integer Gain for red value, Value is effective when


s.r

WhiteBalance is "Custom."
Range is [0—100]
.o

head.GainGreen integer Gain for green value, Value is effective when


.

WhiteBalance is "Custom."
true: GainAuto
head.GainAuto bool
false: No GainAuto
true: IrisAuto
head.IrisAuto bool
false: No IrisAuto

Camera APIs 164


ParamName ParamValue type Description
true: enable video mirror function
head.Mirror bool
false: disable video mirror function
White balance Mode.
Range is {Disable, Auto, Custom, Sunny, Cloudy,
Home, Office, Night}
Some IPC supports common modes: "Disable",
Da

head.WhiteBalance String "Auto", "Sunny", "Night", "Outdoor", "Custom"


Sometimes the device support other advanced
hu

modes: "CustomColorTemperature", "Indoor",


aH

"ATW", "Manual", "AutoOutdoor", "ManualDatum"


and so on.
Range is [0—100]
TT

head.ReferenceLevel integer The expected average brightness level of video


P

frames.
AP

Range is {0,1,2}
Video rotation:
IV

head.Rotate90 integer 0: No rotate


1: clockwise rotate 90°
2.

2: anticlockwise rotate 90°


89

Range is {Inside, BT656, 720p, 1080p, 1080i,


head.SignalFormat String 1080sF}
fo

Input Signal Mode


r1

Range is {0,1,2}
AntiFlicker mode:
00

head.AntiFlicker integer 0: Outdoor


1: 50 Hz AntiFlicker
M

2: 60 Hz AntiFlicker
EG

Range is [0—100]
head.GlareInhibition integer GlareInhibition:
A

0: Close GlareInhibition.
Di

NightOptions contain a set of parameters used


when brightness is not enough.
st

head.NightOptions.Brightnes Range is [0—100]


rib

integer
sThreshold when brightness is less than the
BrightnessThreshold, parameters change to
ut

Nightoptions.
io

true: IrisAuto
head.NightOptions.IrisAuto bool
n

false: No IrisAuto
s.r

head.NightOptions.SunriseH Range is [00—23]


integer
our Sunrise hour.
.o

head.NightOptions.SunriseMi Range is [00—59]


integer
.

nute Sunrise minute


head.NightOptions.SunriseS Range is [00—59]
integer
econd Sunrise second
head.NightOptions.SunsetHo Sunset time. Its range is same with sunrise time,
integer
ur and it should be after sunrise time.

Camera APIs 165


ParamName ParamValue type Description
head.NightOptions.SunsetMi NightOptions are used if time is after sunset time
integer
nute and before sunrise time.
head.NightOptions.SunsetSe
integer
cond
Range is {0,1,2}
0: NoSwitch, always use day options.
Da

1: Switch depends on brightness.


head.NightOptions.SwitchMo
integer 2: Switch depends on time, switch to NightOptions
hu

de
when time is after sunset time and before sunrise.
aH

3: NoSwitch, always use NightOptions.


4: No switch, always use NormalOptions.
Range is {0,1,2,3}
TT

0: use temporary day options.


P

head.NightOptions.Profile integer 1: use temporary NightOptions.


AP

2: use temporary NormalOptions.


3: depends on head.NightOptions.SwitchMode
IV

head.NightOptions.Exposure
integer
Speed
2.

head.NightOptions.Exposure
float
89

Value1
head.NightOptions.Exposure
float
fo

Value2
r1

head.NightOptions.Gain integer
head.NightOptions.GainAuto bool
00

head.NightOptions.GainBlue integer
head.NightOptions.GainGree
M

integer
n
EG

head.NightOptions.GainRed integer
head.NightOptions.WhiteBal Range is the same as relevant items of day
A

String
ance options in this table.
Di

head.NightOptions.Referenc Example:
integer
eLevel Value range of head.NightOptions.ExposureSpeed
st

head.NightOptions.ExternalS is the same with head. ExposureSpeed.


rib

float
yncPhase
ut

head.NightOptions.AntiFlicke
integer
r
io

head.NightOptions.Backlight integer
n

head.NightOptions.DayNight
integer
s.r

Color
head.NightOptions.Exposure
.o

integer
Mode
.

head.NightOptions.GlareInhi
integer
bition
head.NightOptions.Mirror integer
head.NightOptions.Flip integer

Camera APIs 166


ParamName ParamValue type Description
head.NightOptions.Rotate90 integer
head.NomalOptions.Brightne
integer
ssThreshold
head.NormalOptions.IrisAuto bool
head.NormalOptions.Sunrise
integer
Hour
Da

head.NormalOptions.Sunrise
integer
Minute
hu

head.NormalOptions.Sunrise
integer
aH

Second
head.NormalOptions.Sunset
integer
TT

Hour
head.NormalOptions.Sunset
integer
P

Minute
AP

head.NormalOptions.Sunset
integer
Second
IV

head.NormalOptions.Exposu
integer
reSpeed
2.

head.NormalOptions.Exposu
89

float
reValue1
head.NormalOptions.Exposu
fo

float
reValue2 NomalOptions contain a set of parameters similar
r1

head.NormalOptions.Gain integer with NightOptions.


head.NormalOptions.GainAu Range is the same as relevant items of
00

bool
to NightOptions in this table.
M

head.NormalOptions.GainBlu
integer
e
EG

head.NormalOptions.GainGr
integer
een
A

head.NormalOptions.GainRe
integer
Di

d
st

head.NormalOptions.WhiteB
String
alance
rib

head.NormalOptions.Referen
integer
ut

ceLevel
head.NormalOptions.Externa
io

float
lSyncPhase
n

head.NormalOptions.AntiFlic
integer
s.r

ker
head.NormalOptions.Backlig
.o

integer
ht
.

head.NormalOptions.DayNig
integer
htColor
head.NormalOptions.Exposu
integer
reMode

Camera APIs 167


ParamName ParamValue type Description
head.NormalOptions.GlareIn
integer
hibition
head.NormalOptions.Mirror integer
head.NormalOptions.Flip integer
head.NormalOptions.Rotate9
integer
0
Da
hu
aH
TT
P
AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Camera APIs 168


6 Storage APIs
6.1 Storage Devices
Da

6.1.1 Get Hard Disk Information


hu

Table 6-1
aH

Syntax http://<server>/cgi-bin/storageDevice.cgi?action=factory.getPortInfo
Method GET
TT

Description Get the storage device port info.


Example http://192.168.1.108/cgi-bin/storageDevice.cgi?action=factory.getPortInfo
P

info.Total=2
AP

info.Plug=1
Success info.Mask=1
IV

Return info.Bad=0
2.

info.IDE=1
info.Esata=4
89

Comment —
fo

6.1.2 Get All the Names of Storage Devices


r1

Table 6-2
00

Syntax http://<server>/cgi-bin/storageDevice.cgi?action=factory.getCollect
M

Method GET
Description Get all the names of storage devices.
EG

Example http://192.168.1.108/cgi-bin/storageDevice.cgi?action=factory.getCollect
A

list[0]="/dev/sda0"
Success
list[1]="/dev/sda1"
Di

Return
list[2]="/dev/sg1"
st

Comment —
rib

6.1.3 Get Storage Device Information


ut
io

Table 6-3
Syntax http://<server>/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
n

Method GET
s.r

Description Get all the storage device information.


.o

Example http://192.168.1.108/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
list.info0].Detail[0].IsError=false
.

list.info[0].Detail[0].Pointer=27023434
Success
list.info[0].Detail[0].TotalBytes=0
Return
list.info[0].Detail[0].Type=ReadWrite
list.info[0].Detail[0].Path="/mnt/dvr/sda0"

Storage APIs 169


list.info[0].Detail[0].UsedBytes=0
list.info[0].Name="/dev/sda"
list.info[0].State=Success
list.info[0].TotalDays=64
list.info[0].FreeDays=32
Comment —
Da

6.1.4 Get Storage Capability


hu

Table 6-4
aH

Syntax http://<server>/cgi-bin/storage.cgi?action=getCaps
Method GET
Description
TT

Get storage capabilities.


Example http://192.168.1.108/cgi-bin/storage.cgi?action=getCaps
P

Success caps.RedundantDisk.Support=false
AP

Return caps.SupportRemoteLimit=true
Comment —
IV

6.1.5 Format Camera SD-Card


2.
89

Table 6-5
http://<server>/cgi-bin/storageDevice.cgi?action=setDevice&type=FormatPatition&path=<p
fo

Syntax
ath> [&<paramName>=<paramValue>…]
r1

Method GET
Descriptio
Format camera SD card.
00

n
[ Request Params ] (key=value format at URL )
M

Name Type R/O Param Description


EG

type string R operation


path string O disk part path
A

formattype Array<object> O disk part information


Di

+fs string R File system type


st

http://192.168.1.108/cgi-bin/storageDevice.cgi?action=setDevice&type=FormatPatition&pa
Example
th= /dev/sda&formattype[0].fs=fat32
rib

Success
OK
ut

Return
If set successfully, return true, else return false.
io

Comment path : The stringValue is got from cgi API "Get storage device information"
n

(/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo). stringValue is list[0].Name.


s.r
.o

6.2 NAS
.

6.2.1 NAS Information


 Get NAS config

Storage APIs 170


Table 6-6
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NAS
Method GET
Description Get all the directories on the NAS server.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NAS
table.NAS[0].Name="FTP1"
table.NAS[0].Enable=true
Da

table.NAS[0].Protocol="FTP"
Success table.NAS[0].Address="www.ttt.com"
hu

Return table.NAS[0].Port=21
aH

table.NAS[0].UserName="anonymity"
table.NAS[0].Password="none"
table.NAS[0].Directory="share"
TT

Comment —
P

 Set NAS config


AP

Table 6-7
IV

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
2.

Method GET
89

Description Set NAS config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NAS[0].Name=nas0
Example
fo

1&NAS[0].Enable=true
Success
r1

OK
Return
00

Parameters in URL:
In table below,
Comment
M

Head=NAS[index]
EG

index: The index of the NAS Server

Appendix:
A

ParamName ParamValue type Description


Di

Head.Name string NAS name.


st

Head.Enable bool Enable/Disable the NAS.


rib

The range is {"FTP", "SFTP", "SMB", "NFS", "Cloud",


Head.Protocol string
"ISCSI" }
ut

Head.Address string The IP address or host name.


io

Head.Port integer NAS port.


n

Head.UserName string NAS username.


Head.Password string NAS password.
s.r

Head.Directory string Directory name.


.o
.

Storage APIs 171


6.3 Storage Point

6.3.1 Record Storage Point


 Get record storage point config
Da

Table 6-8
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RecordStoragePoi
Syntax
hu

nt
Method GET
aH

Description Get record storage point config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RecordStora
Example
TT

gePoint
table.RecordStoragePoint [0].TimingRecord.Local=1
P

table.RecordStoragePoint [0].TimingRecord.Redundant=Redundant
AP

table.RecordStoragePoint [0].TimingRecord.Remote=FTP
Success
table.RecordStoragePoint [0].TimingRecord.AutoSync=false
IV

Return
table.RecordStoragePoint [0].TimingRecord.AutoSyncRange=0
2.

table.RecordStoragePoint [0].TimingRecord.LocalForEmergency=false
table.RecordStoragePoint [0].TimingRecord.CompressBefore=15
89

Comment —
Set record storage point config
fo


r1

Table 6-9
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
00

alue>[&<paramName>=<paramValue>…]
Method GET
M

Description Set record storage point config.


EG

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RecordStoragePoint[
Example
0].TimingRecord.Local=local
A

Success
OK
Di

Return
st

Parameters in URL:
In table below,
rib

ch: integer, array index starts from 0, which means video channel(equals to video
Comment
ut

channel index -1, and so 0 means channel 1).


recType: The range is {"TimingRecord", "VideoDetectRecord", "AlarmRecord",
io

"EventRecord", "TimingSnapShot", "VideoDetectSnapShot", "AlarmSnapShot",


n

"EventSnapShot"}
s.r

Appendix:
.o

ParamName ParamValue type Description


.

Local directory number, count from 1.


For some reason,
RecordStoragePoint[ch].[recType].Local integer/boolean The front-end devices use Boolean
type. True for SD card, false for no SD
card.

Storage APIs 172


ParamName ParamValue type Description
RecordStoragePoint[ch].[recType].Redu
string Redundant directory name.
ndant
RecordStoragePoint[ch].[recType].Remo
string Remote directory name.
te
When remote directory recovers, auto
RecordStoragePoint[ch].[recType].Auto
bool synchronize local directory to remote
Da

Sync
directory or not.
From the remote directory recovering
hu

time, how long the data needs to be


RecordStoragePoint[ch].[recType].Auto
aH

integer synchronized. The unit is hour. If it is


SyncRange
0, all the data needs to be
TT

synchronized.
When the remote directory is
RecordStoragePoint[ch].[recType].Local
P

bool unusable, save the data the local


ForEmergency
AP

directory or not.
RecordStoragePoint[ch].[recType].Comp The days' data which will be
IV

integer
ressBefore compressed.
2.

6.3.2 Storage Group


89

 Get storage group config


fo

Table 6-10
r1

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageGroup
Method GET
00

Description Get storage group config.


M

http://192.168.1.168/cgi-bin/configManager.cgi?action=getConfig&name=StorageGrou
Example
p
EG

table.StorageGroup[0].Channels[0].MaxPictures=0
A

table.StorageGroup[0].FileHoldTime=0
table.StorageGroup[0].Memo=For Reading & Writing Files
Di

table.StorageGroup[0].Name=ReadWrite
st

table.StorageGroup[0].OverWrite=true
rib

table.StorageGroup[0].PicturePathRule=%y-%M-%d/%c/jpg/%h/%m/%s[%E][%O@%S
][%R].jpg
ut

table.StorageGroup[0].RecordPathRule=%y-%M-%d/%c/dav/%h/%h.%m.%s-%h.%m.
io

Success %s[%E][%O@%S][%R].dav
Return table.StorageGroup[1].Channels[0].MaxPictures=0
n

table.StorageGroup[1].FileHoldTime=0
s.r

table.StorageGroup[1].Memo=For FTP Files


table.StorageGroup[1].Name=Remote
.o

table.StorageGroup[1].OverWrite=true
.

table.StorageGroup[1].PicturePathRule=%y-%M-%d/%c/jpg/%h/%m/%s[%E][%O@%S
][%R].jpg
table.StorageGroup[1].RecordPathRule=%y-%M-%d/%c/dav/%h/%h.%m.%s-%h.%m.
%s[%E][%O@%S][%R].dav

Storage APIs 173


Comment —
 Set storage group config

Table 6-11
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Da

Description Set storage group config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageGroup[0].Na
Example
hu

me=main
Success
aH

OK
Return
Parameters in URL:
TT

In table below,
Comment
P

Index = Storage Group index


ch: integer, array index starts from 0, which means video channel (equals to video
AP

channel index -1, and so 0 means channel 1).


IV

Appendix:
2.

ParamName ParamValue type Description


89

StorageGroup[Index].Name string Storage group name.


StorageGroup[Index].Memo string Storage group memo.
fo

StorageGroup[Index].FileHoldTime integer How many days the file will hold.


Over write or not when there is not enough
r1

StorageGroup[Index].OverWrite bool
storage.
00

The max pictures beyond which the old


StorageGroup[Index].Channels[ch].
Integer pictures will be over written. If it is 0, the old
MaxPictures
M

pictures will be not over written.


EG

StorageGroup[Index].Channels[ch].
string The channel path.
Path
A

6.4 SDEncrypt
Di
st

6.4.1 Encrypt SD Card


rib
ut

Table 6-12
http://<server>/cgi-bin/SDEncrypt.cgi?action=encrypt&deviceName=<deviceName>&p
io

Syntax
assword=<password>
n

Method GET
s.r

Description SD encryption operation.


http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=encrypt&deviceName=/dev/mmc0&
.o

Example
password=123456
.

Success
OK
Return
If set successfully, return true, else return false.
Comment
deviceName: The stringValue is got from cgi API Get storage device information

Storage APIs 174


(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The stringValue Card is Encrypted

6.4.2 Decrypt SD Card


Table 6-13
http://<server>/cgi-bin/SDEncrypt.cgi?action=decrypt&deviceName=<deviceName>&p
Da

Syntax
assword=<password>
Method GET
hu

Description SD decrypt operation.


aH

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=decrypt&deviceName=/dev/mmc0&
Example
password=123456
Success
TT

OK
Return
P

If set successfully, return true, else return false.


AP

deviceName: The stringValue is got from cgi API Get storage device information
Comment
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
IV

password: The stringValue ard is Encrypted


2.

6.4.3 Clear SD Card Password


89

Table 6-14
fo

http://<server>/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=<deviceNa
Syntax
r1

me>&password=<password>
Method GET
00

Description SD clear password operation.


http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=/dev/
M

Example
mmc0&password=123456
EG

Success
OK
Return
A

If set successfully, return true, else return false.


Di

deviceName: The stringValue is got from cgi API Get storage device information
Comment
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
st

password: The stringValue ard is Encrypted


rib

6.4.4 Modify SD Card Password


ut
io

Table 6-15
n

http://<server>/cgi-bin/SDEncrypt.cgi?action=modifyPassword&deviceName=<device
Syntax
s.r

Name>&password=<password>&oldPassword=<oldPassword>
Method GET
.o

Description SD change password operation.


.

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=/dev/
Example
mmc0&password=123456&oldPassword=admin123
Success
OK
Return

Storage APIs 175


If set successfully, return true, else return false.
deviceName: The stringValue is got from cgi API Get storage device information
Comment (cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The new stringValue Card is Encrypted
oldPassword: The old stringValue Card is Encrypted

6.4.5 Get SD Card Operate Error Policy


Da

Table 6-16
hu

http://<server>/cgi-bin/SDEncrypt.cgi?action=getOperateErrorPolicy&deviceName=<de
Syntax
aH

viceName>&operate=<operate>
Method GET
TT

When decrypt, clearPassword, modifyPassword failed, get the error info, leftTimes and
Description
left time.
P

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=getOperateErrorPolicy&deviceNam
Example
AP

e=/dev/mmc0&operate=decrypt
Success policy.leftTimes=5
IV

Return policy.lockSeconds=30
If set successfully, return true, else return false.
2.

deviceName: the stringValue is got from cgi API Get storage device information
89

(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
Comment
Operate: operate type, can be: decrypt, modifyPassword and clearPassword
fo

leftTimes : remain operate times, max is 5


r1

lockSeconds : lock operate time, unit is seconds, max is 30


00

6.4.6 Storage Health Alarm Settings


M

 Get StorageHealthAlarm config


EG

Table 6-17
A

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageHealthAlar
Syntax
m
Di

Method GET
st

Description Get SD health info alarm config.


rib

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageHealthAlar
Example
m
ut

table.StorageHealthAlarm.Enable=true
io

Success table.StorageHealthAlarm.LowerLimit=10
Return table.StorageHealthAlarm.EventHandler= (output of EventHandler is described in
n

GetEventHandler)
s.r

Comment —
.o

 Set StorageHealthAlarm config


.

Table 6-18
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET

Storage APIs 176


Description Set SD health info alarm config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageHealthAlarm.
Example
Enable=true
Success
OK
Return
Comment —
Da
hu
aH
TT
P
AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Storage APIs 177


7 Display APIs
7.1 GUI
Da

7.1.1 GUISet
hu

 Get GUISet config


aH

Table 7-1
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=GUISet
TT

Method GET
P

Description Get the GUI settings. Every video out screen has a group setting.
AP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=GUISet
table.GUISet[index].WindowAlpha=128
IV

table.GUISet[index].TimeTitleEnable=true
table.GUISet[index].TimeTitlePos[0]=0
2.

table.GUISet[index].TimeTitlePos[1]=0
89

table.GUISet[index].TimeTitlePos[2]=8191
table.GUISet[index].TimeTitlePos[3]=8191
fo

table.GUISet[index].MenuShowOption=0
Success
r1

table.GUISet[index].MenuAutoHideTime=10
Return table.GUISet[index].AutoLogout=10
00

table.GUISet[index].ChannelTitleShowEnable=true
table.GUISet[index].ChannelTitlePos[0]=0
M

table.GUISet[index].ChannelTitlePos[1]=0
EG

table.GUISet[index].ChannelTitlePos[2]=8191
table.GUISet[index].ChannelTitlePos[3]=8191
A

table.GUISet[index].AutoGuideEnable=true
Di


Parameters in Response :
st

Comment
index: the array index which starts from 0.
rib

 Set GUISet config


ut

Table 7-2
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
io

Syntax
alue>[&<paramName>=<paramValue>…]
n

Method GET
s.r

Description Set the GUI settings. Every video out screen has a group setting.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&GUISet[0].WindowAl
.o

Example
pha=192&GUISet[0].TimeTitleEnable=false&GUISet[0].MenuShowOption=1
.

Success
OK
Return

Display APIs 178


Parameters in URL:
The paramName and paramValue are in the table below.
Comment
in table below,
index : the array index which starts from 0.

Appendix:

ParamName ParamValue type Description


Da

Diaphaneity of the window


GUISet[index].WindowAlpha integer
background.
hu

GUISet[index].TimeTitleEnable bool Show the time title or not.


aH

GUISet[index].TimeTitlePos[0] integer
GUISet[index].TimeTitlePos[1] integer
The position of the time title.
TT

GUISet[index].TimeTitlePos[2] integer
GUISet[index].TimeTitlePos[3] integer
P

0: Show the directory.


AP

GUISet[index].MenuShowOption integer 1: Hide the directory.


2: Timing-hide the directory.
IV

How many seconds to hide the


GUISet[index].MenuAutoHideTime integer
directory.
2.

How many minutes to auto logout.


89

GUISet[index].AutoLogout integer The range is [0-120]. 0 expresses not


logout.
fo

GUISet[index].ChannelTitleShowEnable bool Show the channel title or not.


r1

GUISet[index].ChannelTitlePos[0] integer
GUISet[index].ChannelTitlePos[1] integer
00

The position of the channel title.


GUISet[index].ChannelTitlePos[2] integer
GUISet[index].ChannelTitlePos[3]
M

integer
GUISet[index].AutoGuideEnable bool Auto guide or not when startup.
EG

7.2 Split Screen


A
Di

7.2.1 Split Screen Mode


st
rib

 Get split screen mode


ut

Table 7-3
Syntax http://<server>/cgi-bin/split.cgi?action=getMode&channel=<ChannelNo>
io

Method GET
n

Description Get the split screen mode.


s.r

Example http://192.168.1.108/cgi-bin/split.cgi?action=getMode&channel=1
Success mode=split1
.o

Return group=4
.

Parameters in URL:
Comment
ChannelNo: the display screen No. Start from 1 and <= 2.
 Set split screen mode

Display APIs 179


Table 7-4
http://<server>/cgi-bin/split.cgi?action=setMode&channel=<ChannelNo>&mode=<mo
Syntax
de>&group=<group>
Method GET
Description Set the split screen mode.
http://192.168.1.108/cgi-bin/split.cgi?action=setMode&channel=1&mode=split4&group
Example
=1
Da

Success
OK
Return
hu

Parameters in URL:
aH

ChannelNo: the display screen No. Start from 1.


mode:enum{split1,split2,split4,split6,split8,split9,split12,split16,split20,split25,split36,sp
lit64,split144,pip1,pip3, "Free", "CompositeSplit1" / "FitDisplayUnit1", "CompositeSplit1"
TT

Comment
/ "FitDisplayUnit4"};
P

group: the No. of a group which contains certain number channels. For example, if 16
AP

video channels display in split4 Mode which contains 4 video channels on Screen, then
there are 4 groups and each group contains 4 video channels.
IV

7.3 Moniter Tour


2.
89

7.3.1 Moniter Tour


fo

 Get moniter tour config


r1

Table 7-5
00

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MonitorTour
Method GET
M

Description Get monitor tour config.


EG

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MonitorTour
table.MonitorTour[ch].Enable=128
A

table.MonitorTour[ch].Interval=true
Success
Di

table.MonitorTour[ch].Mask.Split1=0,1,5
Return
st

table.MonitorTour[ch].Mask.Split8=0,1,5
table.MonitorTour[ch].Collections=Favortite1, Favortite2…
rib

Comment —
Set moniter tour config
ut


io

Table 7-6
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
n

Syntax
alue>[&<paramName>=<paramValue>…]
s.r

Method GET
.o

Description Set monitor tour config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MonitorTour[0].Enabl
.

Example
e=true
Success
OK.
Return
Comment Parameters in URL:

Display APIs 180


The paramName and paramValue are in the table below.

Appendix:

ParamName ParamValue type Description


MonitorTour[ch].Enable bool MonitorTour or not.
MonitorTour[ch].Interval integer MonitorTour interval.
MonitorTour[ch].Mask.Split1 — Channel array for split1
Da

MonitorTour[ch].Mask.Split8 — Channel array for split8


MonitorTour[ch].Collections —
hu

Split collections
aH

7.3.2 Enable Tour


TT

Table 7-7
http://<server>/cgi-bin/split.cgi?action=enableTour&channel=<ChannelNo>&enable=<fl
Syntax
P

ag>
AP

Method GET
Description Enable tour in every video channel on a screen or not.
IV

Example http://192.168.1.108/cgi-bin/split.cgi?action=enableTour&channel=1&enable=true
Success
2.

OK
Return
89

ChannelNo: the display screen No. Start from 1 and <= 2.


Comment
flag : true or false
fo
r1

7.3.3 Monitor Collection


00

 Get monitor collection config


M

Table 7-8
EG

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MonitorCollection
Method GET
A

Description Get monitor collection config.


Di

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MonitorCollec
Example
tion
st

table.MonitorCollection.collectionname. Mode=Split1
rib

table.MonitorCollection.collectionname.Windows[winno].Enable= true
table.MonitorCollection.collectionname.Windows[winno].Device=device1
ut

Success table.MonitorCollection.collectionname.Windows[winno].VideoChannel=5
io

Return table.MonitorCollection.collectionname.Windows[winno].VideoStream=Main
n

table.MonitorCollection.collectionname.Windows[winno].AudioChannel=5
table.MonitorCollection.collectionname.Windows[winno].AudioStream=Main
s.r


.o

Parameters in Response :
Comment winno : integer, the array index which equals to the window index in a screen and starts
.

from 0.
 Set monitor collection config

Table 7-9

Display APIs 181


http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set monitor collection config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MonitorCollection.Fa
Example vorite1.Mode=split4&MonitorCollection.Favorite1.Windows[1].Enable=true&MonitorColl
ection.Favorite1.Windows[1].VideoChannel=2
Da

Success
OK
Return
hu

Parameters in URL:
aH

The paramName and paramValue are in the table below.


In table below:
Comment
TT

Collect=MonitorCollection.collectionname.
collectionname: can be any name.
P

winno: integer, the array index which equals to the window index in a screen and starts
AP

from 0.

Appendix:
IV

ParamName ParamValue type Description


2.

The range is the same as


89

Collect.Mode string
SetSplitMode.
Collect.Windows[winno].Enable bool Enable the window or not.
fo

Collect.Windows[winno].Device string The device Id.


r1

Collect.Windows[winno].VideoChannel integer The video channel.


The range is {"Main", "Extra1",
Collect.Windows[winno].VideoStream string
00

"Extra2", "Extra3", "Auto"}.


Collect.Windows[winno].AudioChannel integer The audio channel.
M

The range is {"Main", "Extra1",


EG

Collect.Windows[winno].AudioStream string
"Extra2", "Extra3", "Auto"}.
A
Di
st
rib
ut
io
n
s.r
.o
.

Display APIs 182


8 Video Analyse APIs
8.1 Video Analyse
Da

8.1.1 Get Video Analyse Capability


hu
aH

Table 8-1
Syntax http://<server>/cgi-bin/devVideoAnalyse.cgi?action=getcaps&channel=<ChannelNo>
Method GET
TT

Description Get video analyse capabilities.


P

Example http://192.168.1.108/cgi-bin/devVideoAnalyse.cgi?action=getcaps&channel=1
AP

caps.CalibrateBoxs[0]=2
caps.CalibrateBoxs[1]=3
IV

caps.ComplexSizeFilter=false
caps.MaxCelibateAreas=10
2.

caps.MaxExcludeRegions=0
89

caps.MaxInternalOptions=512
caps.MaxModules=1
fo

caps.SupportGlobalDeviceParam=1
caps.MaxPointOfLine=20
r1

caps.MaxPointOfRegion=20
00

caps.MaxRules=10
caps.MaxStaffs=4
M

caps.SpecifiedObjectFilter=true
EG

caps.SupportedRules[0]=CrossLineDetection
caps.SupportedRules[1]=CrossRegionDetection
A

Success caps.SupportedRules[2]=LeftDetection
Di

Return caps.SupportedRules[3]=TakenAwayDetection
caps.SupportedScene[0]=Normal
st

caps.SupportedScene[1]=FaceDetection
rib

caps.SupportedScene[2]=VideoDiagnosis
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.HorizontalSt
ut

affs[0]=0
io

caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.HorizontalSt
n

affs[1]=0
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.VerticalStaffs
s.r

[0]=0
.o

caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.VerticalStaffs
[1]=0
.

caps.SupportedScenes.StereoNumber.SupportedRules.ManNumDetection.SupportLoc
alDataStore=false
caps.SupportedScenes.NumberStat.CameraType=1
caps.SupportedScenes.NumberStat.SupportedRules.NumberStat.MaxRules=8

Video Analyse APIs 183


caps.SupportedScenes.StereoBehavior.OnlyFindLastEvtList[0]="ManStandDetection"
Parameters in URL:
Comment
ChannelNo: integer, video channel index which starts from 1.

Appendix

ParamName ParamValue type Description


caps.SupportedScenes.Stere
Da

event type list in which last ones are supported to


oBehavior.OnlyFindLastEvtLi array<string>
be inquired.
st
hu
aH

8.1.2 Video Analyse Global


TT
P

 Get video analyse global config


AP

Table 8-2
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseGlob
IV

Syntax
al
2.

Method GET
89

Description Get video analyse global config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyse
Example
fo

Global
head.Scene.Type=Normal
r1

head.Scene.PtzPresetId=1
head.Scene.Depth=Far
00

head.Scene.Detail.CameraAngle=30
M

head.Scene.Detail.CameraDistance=10.000000
Success
head.Scene.Detail.CameraHeight=6.200000
EG

Return
head.TimePeriod.Day[0]=8:00:00
A

head.TimePeriod.Day[1]=20:00:00
head.TimePeriod.Night[0]=20:00:00
Di

head.TimePeriod.Night[1]=8:00:00
st


rib

Parameters in Response :
head =table.VideoAnalyseGlobal[ChannelNo]
Comment
ut

ChannelNo: integer, array index starts from 0, which means video channel(equals to
io

video channel index -1, and so 0 means channel 1).


 Set video analyse global config
n
s.r

Table 8-3
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
.o

alue>[&<paramName>=<paramValue>...]
.

Method GET
Description Set video analyse global config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoAnalyseGlobal[
Example
0].Scene.Type=Normal&VideoAnalyseGlobal[0].Scene.PtzPresetId=1

Video Analyse APIs 184


Success
OK
Return
Parameters in URL:
paramName and paramValue are as table below.
In table below, head =VideoAnalyseGlobal[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Da

ParamName start with head.Scene.Detail depends on head.Scene.Type.


hu

Appendix
aH

ParamName ParamValue type Description


Scene class, the range is { "", "Normal", "Indoor",
"ATM", "Traffic", "FaceRecognition",
TT

"FaceDetection", "Prison", "NumberStat",


head.Scene.Type string
P

"HeatMap", "VideoDiagnosis", "VehicleAnalyse",


AP

"TrafficPatrol", "CourseRecord", "Vehicle" ,


"ObjectDetect", "VehicleCompare"}
IV

Range is 0 — 255, 0 means that the scene is


head.Scene.PtzPresetId integer
unassociated with PTZ.
2.

Picture distance feature, the range is { "Normal",


head.Scene.Depth string
89

"Far", "Middle", "Near" }


Detail config of a scene. For example, when
fo

Scene.Type is "Normal", it's detail includes


head.Scene.Detail.Value string
r1

CameraAngle, CameraDistance, CameraHeight,


etc.
00

head.TimePeriod.Day[0] string The start time of Day, it's format is hh:mm:ss


head.TimePeriod.Day[1] string The end time of Day
M

head.TimePeriod.Night[0] string The start time of Night, it's format is hh:mm:ss


EG

head.TimePeriod.Night[1] string The end time of Night


A

8.1.3 Video Analyse Rule


Di

Get video analyse rule


st


rib

Table 8-4
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseRule
ut

Method GET
io

Description Get video analyse rules config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyse
n

Example
Rule
s.r

head.Name= line1
.o

head.Type=CrossLineDetection
Success head.VideoAnalyseRule[0][0].Enable =true
.

Return head.VideoAnalyseRule[0][0].EventHandler= (output of EventHandler is described in


GetEventHandler)

Comment Parameters in Response :

Video Analyse APIs 185


head =table.VideoAnalyseRule[ChannelNo] [RuleNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
RuleNo =rule index.
 Set video analyse rule

Table 8-5
Da

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
hu

Method GET
Description Set video analyse rules config.
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoAnalyseRule[0]
Example
[0].Name=myAnalyseRule1&VideoAnalyseRule[0][0].Type=CrossLineDetection
TT

Success
OK
Return
P

Parameters in URL:
AP

paramName and paramValue are as table below.


In table below, head =VideoAnalyseRule[ChannelNo] [RuleNo]
IV

ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
2.

video channel index -1, and so 0 means channel 1).


RuleNo =rule index.
89

ParamName start with head.Config is only effective with {"CrossLineDetection",


"CrossRegionDetection", "LeftDetection", "TakenAwayDetection"}.
fo
r1

Appendix

ParamName ParamValue type Description


00

head.Name string Rule name, it must be unique.


M

The range is {"CrossLineDetection",


"CrossRegionDetection", "LeftDetection",
EG

"TakenAwayDetection",
A

"VideoAbnormalDetection", "FaceDetection",
head.Type string "AudioMutation", "AudioAnomaly",
Di

"VideoUnFocus", "WanderDetection",
st

"RioterDetection", "ParkingDetection",
rib

"MoveDetection", "NumberStat", "HeatMap",


"FaceAttribute" }.
ut

head.Enable bool Enable/Disable this rule.


io

Setting of EventHandler is described in


head.EventHandler —
SetEventHandler.
n

head.Config.DetectLine[0][0] integer The start point of DetectLine 0;


s.r

head.Config.DetectLine[0][1] integer The end point of DetectLine 0;


.o

head.Config.DetectLine[1][0] integer The start point of DetectLine 1;


head.Config.DetectLine[1][1] integer The end point of DetectLine 1;
.

The range is {"LeftToRight", "RightToLeft",


head.Config.Direction string
"Both"}.
head.Config.SizeFilter.MaxSi Maximum width. The width of the object must not
integer
ze[0] be beyond maximum width.

Video Analyse APIs 186


ParamName ParamValue type Description
Adapt to {"CrossLineDetection",
"CrossRegionDetection", "LeftDetection",
"TakenAwayDetection", "FaceDetection",
"WanderDetection", "RioterDetection",
"ParkingDetection", "MoveDetection"}.
head.Config.SizeFilter.MaxSi Maximum height. The height of the object must
Da

integer
ze[1] not be beyond maximum height.
head.Config.SizeFilter.MinSi Minimum width. The width of the object must not
hu

integer
ze[0] be less than minimum width.
aH

head.Config.SizeFilter.MinSi Minimum height. The height of the object must


integer
ze[1] not be beyond minimum height.
The start point of DetectRegion 0;
TT

Adapt to {"CrossRegionDetection",
head.Config.DetectRegion[0]
P

integer "LeftDetection", "TakenAwayDetection",


[0]
AP

"WanderDetection", "RioterDetection",
"ParkingDetection", "MoveDetection"}.
IV

head.Config.DetectRegion[0]
integer The end point of DetectRegion 0;
[1]
2.

head.Config.DetectRegion[1]
integer The start point of DetectRegion 1;
89

[0]
head.Config.DetectRegion[1]
integer The end point of DetectRegion 1;
fo

[1]
r1

head.Config.DetectRegion[2]
integer The start point of DetectRegion 2;
[0]
00

head.Config.DetectRegion[2]
integer The start point of DetectRegion 2;
[1]
M

Range is 1 — 600, adapt to {"LeftDetection",


EG

"TakenAwayDetection", "WanderDetection"}.
head.Config.MinDuration integer
Range is 10-300, adapt to {"RioterDetection"}.
A

Range is 6-300, adapt to {"ParkingDetection"}.


Di

Range is 1 — 10, adapt to {"RioterDetection",


head.Config.Sensitivity integer
"MoveDetection"}.
st

Range is 0 — 100000000, adapt to


rib

head.Config.EnterThreshold integer
{"NumberStat"}.
ut

Range is 0 — 100000000, adapt to


head.Config.ExitThreshold integer
{"NumberStat"}.
io

Range is 0 — 100000000, adapt to


integer
n

head.Config.InsideThreshold
{"NumberStat"}.
s.r
.o

8.1.4 Get Last Event Info


.

 Get Last Event Info

Table 8-6
Syntax http://<server>/cgi-bin/devVideoAnalyse.cgi?action=getLastEventInfo&channel=<Chan

Video Analyse APIs 187


nelNo>&ClassName=<ClassNameStr>&EventName=<EventNameStr>
Method GET
Description Get last event info
http://192.168.1.108/cgi-bin/devVideoAnalyse.cgi?action=getLastEventInfo&channel=1
Example
&ClassName=StereoBehavior&EventName=ManStandDetection
State=1
Success
EventInfo.Code=ManStandDetection
Da

Return
EventInfo.Action=Start
Parameters in Response :
hu

ChannelNo: integer, array index starts from 0, which means video channel (equals to
aH

Comment video channel index -1, and so 0 means channel 1).


ClassNameStr: str, means Class name.
EventNameStr: str, means Event name.
TT
P

8.1.5 [Config] GlobalDeviceParam


AP

 Get Global Device Param


IV

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=GlobalDevicePara
Syntax
m
2.

Method GET
89

Description Get Global Device Param


[ Request Params ] (key=value format at URL )
fo

Name Type R/O Param Description


r1

[ Response Params ] (key=value format )


Name Type R/O Param Description
00

table object R
+LocateHeight Float R Device locate Height
M

[ Example ]
EG

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=
Request
GlobalDeviceParam
A

Response table.GlobalDeviceParam.LocateHeight=10.5
Di
st

 Set Global Device Param


http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
rib

Syntax
Value>[&<paramName>=<paramValue>…]
ut

Method GET
Description Set Global Device Param
io

[ Request Params ] (key=value format at URL )


n

Name Type R/O Param Description


s.r

GlobalDeviceP
object R Global Device Param
aram
.o

+LocateHeight float R Device locate Height


.

[ Response Params ] (OK at Body )


Name Type R/O Param Description
[ Example ]

Video Analyse APIs 188


http://<server>/cgi-bin/configManager.cgi?action=setConfig&
Request
GlobalDeviceParam.LocateHeight = 10.5
Response Ok

8.1.6 getTemplateRule
Da

 Gets all intelligent rule configuration templates and default values under
the specified category
hu
aH

Request URL http://<server>/cgi-bin/VideoInAnalyse.cgi?action=getTemplateRule


Method GET
Request Params ( key=value format in URL )
TT

Name Type R/O Description Example


P

Class Char[32] R the same meaning with "Normal"


AP

Type in config
VideoAnalyseGlobal
IV

"Normal"
"Traffic"
2.

"TrafficPatrol"
89

"FaceDetection"(shared
by face detect and face
fo

recognition)
in added, Web can use
r1

“ALL” for all rules.


00

Channel integer R video channel, which 1


starts from 1.
M

示例
EG

http://<server>/cgi-bin/VideoInAnalyse.cgi?action=getTemplateRule&Channel=1&Class=Normal
A

Response Params ( key=value format in body )


Di

Name Type R/O Description Example


Rule object R rule info
st

+Normal object R business class


rib

++CrossRegio object R cross region templet


nDetection
ut

++CrossLineD object R default config of


io

etection crossline
n

format as the same as


each object in the
s.r

second dimension of
.o

VideoAnalyseRule
+++Config object R detail of rule config
.

++++SizeFilter object R
+++++MinSize int[2] R [0, 0]
+++++MaxSiz int[2] R [8191, 8191]
e

Video Analyse APIs 189


++++DetectLin object[] R
e
++++Direction char[] R "Both"
+++PtzPresetI integer R Preset number 0
d
+++ObjectTyp char[][] R type of detect object ["Unknown"]
es
Da

+++Type char[64] R rule type "CrossLineDetection"


+++Class char[16] R business plan class "Normal"
hu

+++Enable bool R enable the rule false


+++Id integer R rule id 0
aH

示例
Rule.Normal.CrossLineDetection.Id=0
TT

Rule.Normal.CrossLineDetection.Enable=false
P

Rule.Normal.CrossLineDetection.Class=Normal
AP

Rule.Normal.CrossLineDetection.Type=CrossLineDetection
Rule.Normal.CrossLineDetection.ObjectTypes[0]=Unknown
IV

Rule.Normal.CrossLineDetection.PtzPresetId=0
Rule.Normal.Config.Direction=Both
2.

Rule.Normal.Config.SizeFilter.MaxSize[0]=[8191, 8191]
89

Rule.Normal.Config.SizeFilter.MinSize[0]=[0, 0]

fo
r1

8.2 Number of People


00
M

8.2.1 Video Widget Number Status


EG

 Get video widget number status


A
Di

Table 8-7
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidgetNumb
st

Syntax
erStat
rib

Method GET
Description Get OSD config when display number status information of people.
ut

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Example
io

NumberStat
n

head.EncodeBlend=true
head.ShowEnterNum=true
s.r

Success
head.ShowExitNum=true
Return
.o

head.TextAlign=0
.


Parameters in Response :
head =table.VideoWidgetNumberStat[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).

Video Analyse APIs 190


 Set video widget number status

Table 8-8
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set OSD config when display number status information of people.
Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidgetNumber
Example
Stat[0].EncodeBlend=true&VideoWidgetNumberStat[0].ShowEnterNum=true
hu

Success
OK
Return
aH

Parameters in URL:
paramName and paramValue are as table below.
TT

In table below,
Comment
head =VideoWidgetNumberStat[ChannelNo]
P

ChannelNo: integer, array index starts from 0, which means video channel(equals to
AP

video channel index -1, and so 0 means channel 1).


IV

Appendix
2.

ParamName ParamValue type Description


89

head.EncodeBlend bool Enable/Disable


fo

head.ShowEnterNum bool Enable/Disable


head.ShowExitNum bool Enable/Disable
r1

head.TextAlign integer 0 for left, 2 for right


00

8.2.2 Get Heat Map Information


M
EG

Table 8-9
http://<server>/cgi-bin/heatMap.cgi?action=getPicByTime&channel=<ChannelNo>&St
Syntax
A

artTime=<start>&EndTime=<end>[&PtzPresetId=<PtzPresetId>]
Di

Method GET
Description Get binary data of heat map.
st

http://192.168.1.108/cgi-bin/heatMap.cgi?action=getPicByTime&channel=1&StartTime
rib

Example
=2015-08-20%2000:00:00&EndTime=2015-08-21%2023:59:59
Content-Type: application/binarytet-stream
ut

Success
Content-Length:<heatMap size>
Return
io

<HeatMap data>
n

Parameters in URL:
s.r

ChannelNo: integer, video channel index which starts from 1.


start/end: the start/end time of Heat Map info. 24 hour Format, as: yyyy-mm-dd
.o

hh:mm:ss.
.

Comment PtzPresetId: the ptz preset index which starts from 1.

Parameters in Response:
heatMap size: width*height + 16.
HeatMap data: format as table below.

Video Analyse APIs 191


Appendix: HeatMap Data Format
0 1 2 3 4 … 15 16 17 18 …
Width Height Reserved Data: every byte symbolize a pixel

8.2.3 Get People Heat Map Information


Da

Table 8-10
URL http://<server>/cgi-bin/videoStatServer.cgi?action=getHeatMap
hu

Method GET
aH

Description Get People Heat Map Information


[ Request Params ] ( key=value format in URL )
TT

Name Type R/O Param Description


channel int O Video channel index which starts from 1, default is 1.
P

PlanID int O The plan id, only valid for dome camera.
AP

StartTime string R The start time, ex: "2010-05-12 20:00:00"


EndTime string R The end time, ex: "2010-05-12 22:00:00"
IV

The heat map type, it can be:


2.

“AverageStayTime” : average stay time heat map


HeatMapType string R
“HumanStatistics” : human statistics heat map
89

“HumanTrack” : human track heat map


[ Response Params ] ( binary data )
fo

[ Example ]
r1

GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getHeatMap&channel=1&
Request PlanID=2&StartTime=2010-05-12%2020:00:00&EndTime=2010-05-12%2022:00:00&He
00

atMapType=AverageStayTime
M

HTTP/1.1 200 OK
Server: Device/1.0
EG

Content-Type: application/octet-stream
Response
Content-Length: <length>
A
Di

<heat map binary data>


st

Appendix A: The heat map binary data format when HeatMapType is AverageStayTime.
rib

octet 0 1 2 3 4~7 8~11 12~15


vers cha pres reserv
value total data length totol lines lines in this packet
ut

ion nnel et ed
16~31
io

octet
n

reserved
value
s.r

octet 32~35 36~39 40~43 44~44+4*(N-1)


.o
.

value line number data num in this line data 1 data N

44+4*(N-1)+1~
octet …… …… ……
44+4*(N-1)+4

Video Analyse APIs 192


value next line number data num in next line data 1 data N

Note: If “lines in this packet” is 0, then all data has been sent, and connection will be closed.
Appendix B: The heat map binary data format when HeatMapType is HumanStatistics.
octet 0 1 2 3 4~7 8~11 12~15
vers cha pres reserv
value total data length total lines lines in this packet
ion nnel et ed
Da

octet 16~31
hu

value reserved
aH

octet 32~35 36~39 40~43 44~44+4*(N-1)

value line number data num in this line data 1 data N


TT

44+4*(N-1)+1~
P

octet …… …… ……
44+4*(N-1)+4
AP

value next line number data num in next line data 1 data N
IV

Note: If “lines in this packet” is 0, then all data has been sent, and connection will be closed.
Appendix C: The heat map binary data format when HeatMapType is HumanTrack.
2.

octet 0 1 2 3 4~7 8~11 12~15


89

versi chann pres reser


value total data length total tracks tracks in this packet
on el et ved
fo

octet 16~31
r1

value reserved
00

octet 32~35 36~39 40~43 44~44+4*(N-1)


M

track point num in


value Object ID track point 1 track point N
EG

this object
44+4*(N-1)+1~
A

octet …… …… ……
44+4*(N-1)+4
Di

track point num in


value next object ID track point 1 track point N
st

next object
Note: If “tracks in this packet” is 0, then all data has been sent, and connection will be closed.
rib

8.2.4 Subscribe People Realtime Trace Information


ut
io

Table 8-11
n

URL http://<server>/cgi-bin/videoStatServer.cgi?action=attachRealTraceProc
s.r

Method GET
Description Subscribe the people realtime trace information.
.o

[ Request Params ] ( key=value format in URL )


.

Name Type R/O Param Description


channel int O Video channel index which starts from 1, default is 1.

Video Analyse APIs 193


Send heartbeat interval, range is [1, 60],unit is second. If the
URL contains this parameter, and the value is 5, it means every
heartbeat int O 5 seconds the device should send the heartbeat message to
the client, the heartbeat meaage are "Heartbeat". If this
parameter is not present, its default value is 60.
[ Response Params ] (multipart binary data)
[ Example ]
Da

GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=attachRealTraceProc&cha
Request
nnel=1&heartbeat=5
hu

HTTP/1.1 200 OK
aH

Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed
TT
P

--<boundary>
AP

Content-Type: application/octet-stream
Content-Length: <length>
IV

<realtime trace binary data>


2.

--<boundary>
Response
89

Content-Type: text/plain
Content-Length: 11
fo

Heartbeat
r1

-<boundary>
00

Content-Type: application/octet-stream
Content-Length: <length>
M
EG

<realtime trace binary data>


--<boundary>
A


Di

Appendix A: The realtime trace binary data format.


octet 0 1 2 3 4~7 8~11 12~15
st

chan pres reser object num in this


rib

value version total data length reserved


nel et ved packet
ut

octet 16~31
io

value reserved
n
s.r

octet 32~35 36~37 38~39 40~43 44~47


.o

object object current


value object ID 1 reserved
coord x, coord y time in utc
.

octet 48~51 52~53 54~55 56~57 58~61

object object current


value object ID 2 reserved
coord x coord y time in utc

Video Analyse APIs 194


8.2.5 Get People Histroy Trace Information
Table 8-12
URL http://<server>/cgi-bin/videoStatServer.cgi?action=getHistoryTrace
Method GET
Description Get people history trace information.
Da

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
hu

channel int O Video channel index which starts from 1, default is 1.


PlanID int O The plan id, only valid for dome camera.
aH

StartTime string R The start time, ex: "2010-05-12 20:00:00"


EndTime string R The end time, ex: "2010-05-12 22:00:00"
TT

[ Response Params ] ( multipart binary data )


P

[ Example ]
GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getHistoryTrace&channel=
AP

Request
1&PlanID=2&StartTime=2010-05-12%2020:00:00&EndTime=2010-05-12%2022:00:00
IV

HTTP/1.1 200 OK
Server: Device/1.0
2.

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


89

Connection: closed
fo

--<boundary>
Content-Type: application/octet-stream
r1

Content-Length: <length>
Response
00

<history trace binary data>


M

--<boundary>
Content-Type: application/octet-stream
EG

Content-Length: <length>
A

<history trace binary data>


Di

--<boundary>
st


rib

Appendix A: The history trace binary data format.


octet 0 1 2 3 4~7 8~11 12~15
ut

versi chann pres reserv total object object num in this


value total data length
io

on el et ed num packet
n

octet 16~31
s.r

value reserved
.o

octet 32~35 36~37 38~39 40~43 44~47


.

object object current


value object ID 1 reserved
coord x coord y time in utc
octet 48~51 52~53 54~55 56~57 58~61
object object current
value object ID 2 reserved
coord x coord y time in utc

Video Analyse APIs 195


Note: If “object num in this packet” is 0, then all data has been sent, and connection will be closed.

8.2.6 Subscribe Heat Map Raw Data


Table 8-13
URL http://<server>/cgi-bin/HeatMapManager.cgi?action=attachRaw
Method GET
Da

Description Subscribe the heap map raw data.


[ Request Params ] ( key=value format in URL )
hu

Name Type R/O Param Description


aH

channel int O Video channel index which starts from 1, default is 1.


Send heartbeat interval, range is [1, 60],unit is second. If the
TT

URL contains this parameter, and the value is 5, it means every


heartbeat int O 5 seconds the device should send the heartbeat message to
P

the client, the heartbeat meaage are "Heartbeat". If this


AP

parameter is not present, its default value is 60.


[ Response Params ] (multipart binary data)
IV

[ Example ]
GET http://192.168.1.108/cgi-bin/HeatMapManager.cgi?action=attachRaw&channel=1&
2.

Request
heartbeat=5
89

HTTP/1.1 200 OK
Server: Device/1.0
fo

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


r1

Connection: closed
00

--<boundary>
Content-Type: application/octet-stream
M

Content-Length: <length>
EG

<heap map raw data>


A

--<boundary>
Response
Di

Content-Type: text/plain
Content-Length: 11
st
rib

Heartbeat
ut

-<boundary>
Content-Type: application/octet-stream
io

Content-Length: <length>
n
s.r

<heap map raw data>


--<boundary>
.o


.

Appendix A: The heap map raw data format.


octet 0 1 2 3 4 ~ 23
value width height StartTime, ex: “2012-01-04 00:00:00”
octet 24~43 44 ~ 47

Video Analyse APIs 196


value EndTime, ex: “2012-01-04 01:00:00” reserved

octet 48 49 …

value Data: every byte symbolize a pixel

8.2.7 Clear statistics in time section


Da
hu

Table 8-14
http://<server>/cgi-bin/videoStatServer.cgi?action=clearSectionStat[&AreaID=<AreaID>][
URL
aH

&PtzPresetId=<PtzPresetId>]
Method GET
TT

Description Clear statistics in time section


[ Request Params ] ( key=value format in URL )
P

Name Type R/O Param Description


AP

channel int O Video channel index which starts from 1, default is 1.


The area index which starts from 1, valid for multiple area
IV

AreaID int O
device, if omit means clear all area statistics.
PtzPresetId int O The ptz preset index which starts from 1.
2.

[ Response Params ] ( OK )
89

[ Example ]
Request GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=clearSectionStat&AreaID=2
fo

Response OK
r1

8.3 FishEye
00
M

8.3.1 Get FishEye Capability


EG

The method described in the Section “4.5.12 Get video input capability” should be used first.In the
A

response, it will contain these message "caps.FishEye=false", if the value of the FishEye is true,
Di

Then you can use the method described below to get the detail capability.
st

Table 8-15
rib

http://<server>/cgi-bin/devVideoInput.cgi?action=getCapsEx&channel=<ChannelNo>&
Syntax
name=VideoInFishEye
ut

Method GET
Description Get fisheye capability.
io

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCapsEx&channel=1&name=
n

Example
VideoInFishEye
s.r
.o
.

Video Analyse APIs 197


caps.Type=Chip
caps.MountMode[0]=WallMode
caps.MountMode[1]=CeilMode
……
caps.CalibrateMode[0]=Original
Success
caps.CalibrateMode[1]=Config
Return
caps.CalibrateMode[2]=Panorama
Da

……
caps.EPtzCmd[0]=Up
hu

caps.EPtzCmd[1]=Down
…….
aH

Parameters in Response:
Type: string, it can be Chip, Plugin, and ChipAndPlugin. Chip means only support
TT

calibrate by device.
P

Plugin means only support calibrate by plugin. ChipAndPlugin means support


AP

both.
MountMode: string and array.and MountMode means the install mode, it can be
Comment
IV

WallMode,CeilMode, FloorMode,180CeilMode.
CalibrateMode: string and array. It can be Original, Config, Panorama,
2.

DoublePanorama, OriginalPlusThreeEPtzRegion, Single, FourEPtzRegion,


89

TwoEPtzRegion, and Normal.


EPtzCmd: string and array. It can be ZoomIn, ZoomOut, Up, Down, Left, Right,
fo

RotateClock, RotateAntiClock, Stop, TapView, and ShowRegion.


r1

8.3.2 FishEye Setting


00

 Get FishEye config


M

Table 8-16
EG

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FishEye
Method GET
A

Description Get FishEye config.


Di

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FishEye
st

head.PlaceHolder=1
Success
rib

head.CalibrateMode=Original
Return
……..
ut

Parameters in Response:
head = table.FishEye[ChannelNo]
io

ChannelNo: integer, array index starts from 0, which means video channel (equals to
n

Comment video channel index -1, and so 0 means channel 1).


s.r

PlaceHolder:integer, it can be 1(CeilMode), 2(WallMode), 3(FloorMode).


CalibrateMode: string. It can be Original, Config, Panorama, DoublePanorama,
.o

OriginalPlusThreeEPtzRegion, Single, FourEPtzRegion, TwoEPtzRegion, and Normal.


.

 Set FishEye config

Table 8-17
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]

Video Analyse APIs 198


Method GET
Description Set FishEye config.
Change the placeholder setting of channel 1:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].PlaceHol
der=1

Change the calibratemode setting of channel 1:


Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].Calibrate
Example
Mode=Panorama
hu
aH

Also can use


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].Calibrate
Mode=Panorama&FishEye[0].PlaceHolder=1 to change the placeholder and
TT

calibratemode in one message.


P

Success
OK
AP

Return
Comment —
IV

8.4 CrowdDistriMap
2.
89

8.4.1 Get Channel Caps


fo

Table 8-18
r1

Syntax http://<server>/cgi-bin/crowdDistriMap.cgi?action=getCaps
Method GET
00

Description Get Channel CrowdistriMap Caps.


M

Example http://192.168.1.108/cgi-bin/crowdDistriMap.cgi?action=getCaps
CrowdCapsList[0].channel=<ChannelNo>
EG

CrowdCapsList[0].Support=<Support>
Success
A

CrowdCapsList[1].channel=<ChannelNo>
Return
CrowdCapsList[1].Support=<Support>
Di


st

Parameters in URL and Response:


rib

Comment ChannelNo : video channel index


Support : true or false, support or not
ut

8.4.2 Subscribe to Realtime Crowd Stat


io
n

Table 8-19
s.r

http://<server>/cgi-bin/crowdDistriMap.cgi?action=attach&channel=<ChannelNo>[&he
Syntax
artbeat=<Heartbeat>]
.o

Method GET
.

Description Subscribe the crowd distribuite map information, return info at regular time.
Example http://<server>/cgi-bin/crowdDistriMap.cgi?action=attach&channel=1&heartbeat=5
Success HTTP/1.1 200 OK
Return Content-Type: multipart/x-mixed-replace; boundary=<boundary>

Video Analyse APIs 199


Connection: close

--<boundary>
Content-Type: text/plain
Content-Length: <data length>

CrowdStatData[0].Channel=1
Da

CrowdStatData[0].GloabalPeopleNum =10
CrowdStatData[0].RegionNum =1
hu

CrowdStatData[0].RegionPeopleList[0].RegionID=0
CrowdStatData[0].RegionPeopleList[0].Region[0][0]=10
aH

CrowdStatData[0].RegionPeopleList[0].Region[0][1]=10
CrowdStatData[0].RegionPeopleList[0].Region[1][0]=10
TT

CrowdStatData[0].RegionPeopleList[0].Region[1][1]=100
P


CrowdStatData[0].RegionPeopleList[0].RegionPeopleNum=100
AP

CrowdStatData[0].CrowdEventNum =2
IV

CrowdStatData[0].CrowdList[0].Center=2
CrowdStatData[0].CrowdList[0].Radius=2
2.

CrowdStatData[0].RegionEventNum =2
89

CrowdStatData[0].RegionList[0].Region[0][0]=10
CrowdStatData[0].RegionList[0].Region[0][1]=10
fo

CrowdStatData[0].RegionList[0].Region[1][0]=10
CrowdStatData[0].RegionList[0].Region[1][0]=100
r1


00

CrowdStatData[0].RegionList[0].RegionID=0
CrowdStatData[0].RegionList[0].PeopleNum=100
M

--<boundary>
EG

Content-Type: text/plain
Content-Length: 11
A

Heartbeat
Di

--<boundary>
st

Content-Type: text/plain
rib

Content-Length: <data length>


ut

CrowdStatData[0].Channel=1
io


Parameters in URL and Response
n

ChannelNo: integer, video channel index to subscribe


s.r
.o

Region is Polygon, has a list of points, every point has x and y , so Region[0][0] is first
Comment point's x, Region[0][1] is first point's y, Region[1][0] is second point's x, Region[1][1] is
.

second point's y, and so on

Heartbeat: integer, range is [1,60],unit is second.If the URL contains this parameter,
and the value is 5, it means every 5 seconds the device should send the heartbeat

Video Analyse APIs 200


message to the client,the heartbeat meaage are "Heartbeat".

8.4.3 Get Current Crowd Stat


Table 8-20
http://<server>/cgi-bin/crowdDistriMap.cgi?action=getSummary&channel=<ChannelNo
Syntax
>
Da

Method GET
Description Get crowd distribuite map information, return info only once.
hu

Example http://<server>/cgi-bin/crowdDistriMap.cgi?action=getSummary&channel=1
aH

CrowdStatData[0].Channel=1
CrowdStatData[0].GloabalPeopleNum =10
CrowdStatData[0].RegionNum =1
TT

CrowdStatData[0].RegionPeopleList[0].RegionID=0
P

CrowdStatData[0].RegionPeopleList[0].Region[0][0]=10
AP

CrowdStatData[0].RegionPeopleList[0].Region[0][1]=10
CrowdStatData[0].RegionPeopleList[0].Region[1][0]=10
IV

CrowdStatData[0].RegionPeopleList[0].Region[1][1]=100

2.

CrowdStatData[0].RegionPeopleList[0].RegionPeopleNum=100
Success
89

CrowdStatData[0].CrowdEventNum =2
Return
CrowdStatData[0].CrowdList[0].Center=2
fo

CrowdStatData[0].CrowdList[0].Radius=2
r1

CrowdStatData[0].RegionEventNum =2
CrowdStatData[0].RegionList[0].Region[0][0]=10
00

CrowdStatData[0].RegionList[0].Region[0][1]=10
CrowdStatData[0].RegionList[0].Region[1][0]=10
M

CrowdStatData[0].RegionList[0].Region[1][0]=100
EG


CrowdStatData[0].RegionList[0].RegionID=0
A

CrowdStatData[0].RegionList[0].PeopleNum=100
Di

Similar to above "Subscribe to Realtime Crowd Stat", but reply stat only once, not at
Comment regular time.
st

ChannelNo: integer, video channel index which starts from 1.


rib

8.5 Intelligent
ut
io

8.5.1 Get Intelligent Caps


n
s.r

URL http://<server>/cgi-bin/intelli.cgi?action=getCaps
Method GET
.o

Description Get video analyse intelligent capabilities.


.

[ Request Params ] ( key=value )

Video Analyse APIs 201


Name of capability, it can be:
AnalyseMode: get analyse mode capacity
MultiChannelMode: get multi channel seperate intelligent
capsName string O capacity and combined intelligent capacity
MultiVideoAnalyse: get all intelligent capacity from the
multichannel device in each channel
if omit, means get all capacity
Da

[ Response Params ] ( key=value )


caps object R The video service capabilities.
hu

Analyse mode, can be : RealStream, RecordFileStream,


+AnalyseMode string O
aH

PicFileStream
+MultiChannelM
object O Multi channel description
ode
TT

Array<Arra
++IndepMode O Multi channel open at one time separately
P

y<object>>
AP

+++Channel int R Video channel number, start from 0


+++Type string R Business class
IV

Array<Arra
++CompMode O Multi channel combined mode
y<object>>
2.

+++Channel int R Video channel number, start from 0


89

+++Type string R Business class


+MultiVideoAnal Array<obje
fo

O List of channel capabilities


yse ct>
r1

++caps object R Video analyse capabilities


Array<obje
00

+Algorithm O Algorithm version information


ct>
++Class string R Intelligent analyse class, ex : ObjectDetect
M

++AlgorithmVers
EG

string R Algorithm version


ion
++AlgorithmVen
A

sting R Algorithm Vendor name


dor
Di

Array<obje
+TotalCapacity O Intelligent analyse total capacity
st

ct>
++Class string R Intelligent analyse class, ex : ObjectDetect
rib

Array<strin
++Type R Intelligent analyse rules, ex : FaceDetection
ut

g>
The maximum number of video channels that can be analysed
io

++Number int R
at same time
n

[ Example ]
s.r

Request GET http://192.168.1.108/cgi-bin/intelli.cgi?action=getCaps


caps.AnalyseMode=RealStream
.o

caps.MultiChannelMode.IndepMode[0][0].Channel=0
.

caps.MultiChannelMode.IndepMode[0][0].Type=Normal
Response
caps.MultiChannelMode.IndepMode[0][1].Channel=1
caps.MultiChannelMode.IndepMode[0][1].Type=ObjectDetect

Video Analyse APIs 202


caps.MultiChannelMode.CompMode[0][0].Channel=0
caps.MultiChannelMode.CompMode[0][0].Type=Normal
caps.MultiChannelMode.CompMode[0][1].Channel=1
caps.MultiChannelMode.CompMode[0][1].Type=ObjectDetect

caps.Algorithm[0].Class=Normal
caps.Algorithm[0].AlgorithmVersion=V2.8
Da

caps.Algorithm[0].AlgorithmVendor=Dahua
caps.Algorithm[1].Class=ObjectDetect
hu

caps.Algorithm[1].AlgorithmVersion=V2.8
caps.Algorithm[1].AlgorithmVendor=Dahua
aH


caps.TotalCapacity[0].Class=Normal
TT

caps.TotalCapacity[0].Type[0]=FaceDetection
P

caps.TotalCapacity[0].Number=3
caps.TotalCapacity[1].Class=ObjectDetect
AP

caps.TotalCapacity[1].Type[0]=FaceDetection
IV

caps.TotalCapacity[1].Number=3

2.
89

8.5.2 Subscribe Resource Usage Info


fo

URL http://<server>/cgi-bin/intelli.cgi?action=attachResource
Method GET
r1

Description Subscribe the intelligent analyse resource


00

[ Request Params ] ( key=value format in URL )


Send heartbeat interval, range is [1, 60],unit is second. If the
M

URL contains this parameter, and the value is 5, it means every


EG

heartbeat int O 5 seconds the device should send the heartbeat message to
the client, the heartbeat meaage are "Heartbeat". If this
A

parameter is not present, its default value is 60.


Di

[ Response Params ] (key=value format)


Name Type R/O Param Description
st

Array<obj
rib

RemainCapacity R Remain capacity of intelligent analyse


ect>
+Class string R Intelligent analyse class, ex : ObjectDetect
ut

+Number int O Remain number of video channels that can be analysed


io

[ Example ]
n

Request GET http://192.168.1.108/cgi-bin/intelli.cgi?action=attachResource&heartbeat=5


s.r

HTTP/1.1 200 OK
Server: Device/1.0
.o

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


.

Connection: closed
Response

--<boundary>
Content-Type: text/plain
Content-Length: <length>

Video Analyse APIs 203


RemainCapacity[0].Class=Normal
RemainCapacity[0].Number=1
RemainCapacity[1].Class=ObjectDetect
RemainCapacity[1].Number=2

--<boundary>
Da

Content-Type: text/plain
Content-Length: 11
hu

Heartbeat
aH

--<boundary>
Content-Type: text/plain
TT

Content-Length: <length>
P

RemainCapacity[0].Class=Normal
AP

RemainCapacity[0].Number=1
IV

RemainCapacity[1].Class=ObjectDetect
RemainCapacity[1].Number=1
2.


89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Video Analyse APIs 204


9 Intelligent Traffic APIs
9.1 Traffic Snap
Da

9.1.1 Get the Specific Parking Space Status


hu
aH

Table 9-1
http://<server>/cgi-bin/trafficSnap.cgi?action=getParkingSpaceStatus&channel=<Chan
Syntax
nelNo>&<paramName>=<paramValue>[&<paramName>=<paramValue>…]
TT

Method GET
P

Description Get specific parking space(s) status.


AP

http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=getParkingSpaceStatus&condition.L
Example
ane[0]=0&condition.Lane[1]=255
IV

A list of parking space status


status[0].Lane=0
2.

status[0].PictureId=5
89

status[0].TrafficCar.CountInGroup=1
Success

Return
fo

status[1].Lane=1
status[1].PictureId=4
r1

status[1].TrafficCar.CountInGroup=1
00


Parameters in URL:
M

ChannelNo: integer, video channel index which starts from 1.


EG

paramName and paramValue: detail in table below.


A

Comment In table below,


Di

index: The index of type array, start from 0


st

Parameters in Response :
rib

TrafficCar: the members refer to TrafficCar


ut

Appendix
io

ParamName ParamValue type Description


n

condition.Lane[index] int The Lane value


condition.ResponseLevel int The Level value , refer to condition
s.r
.o

9.1.2 Open Strobe


.

Table 9-2
http://<server>/cgi-bin/trafficSnap.cgi?action=openStrobe&channel=<ChannelNo>&inf
Syntax
o.openType=<OpenType>&info.plateNumber=<PlateNumber>
Method GET

Intelligent Traffic APIs 205


Description Open the strobe manually.
http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=openStrobe&channel=1&info.openT
Example
ype=Normal&info.plateNumber=046XRW
Success
OK
Return
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Da

Comment
OpenType: string, For now, the value is fixed to "Normal"
PlateNumber: string, the plateNumber of the TrafficCar.
hu

9.1.3 Open/Close Unlicensed Vehicle Detection


aH
TT

Table 9-3
http://<server>/cgi-bin/trafficSnap.cgi?action=<Action>&channel=<ChannelNo>&nam
Syntax
P

e=UnlicensedVehicle
AP

Method GET
Description Open or Close the unlicensed vehicle detection.
IV

http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=open&channel=1&name=Unlicense
Example
dVehicle
2.

Success
89

OK
Return
Parameters in URL:
fo

Comment Action: string, this value can be open and close.


r1

ChannelNo: integer, video channel index which starts from 1.


00

9.1.4 Snap
M

Table 9-4
EG

Syntax http://<server>/cgi-bin/trafficSnap.cgi?action=manSnap&channel=<ChannelNo>
Method GET
A

Take a snapshot manually. For intelligent traffic device, it should use this method to take
Di

a snapshot.
But, the response is not image data.If you want to get the image data, please follow
st

these steps:
rib

Description
1. Use the method mentioned chapter (4.4.3 Subscribe to snapshot) to subscribe the
ut

image data, and the eventcode is "TrafficManualSnap".


2. Use the "manSnap"to take a snapshot manually.
io

3. In the connection which built in the Step 1, the device will send the image data.
n

Example http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=manSnap&channel=1
s.r

Success
OK
Return
.o

Parameters in URL:
Comment
.

ChannelNo: integer, video channel index which starts from 1.

Intelligent Traffic APIs 206


9.2 Traffic Parking

9.2.1 Get All Status of Parking Spaces


Table 9-5
Syntax http://<server>/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
Da

Method GET
Description Get all valid parking spaces status of one device.
hu

Example http://192.168.1.108/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
aH

A list of parking space status


status[0].Lane=0
status[0].CustomParkNo = A2701
TT

Success status[0].Status = Park


P

Return …
AP

status[1].Lane=1
status[1].Status = NoPark
IV


Parameters in Response :
2.

Comment
Status : Park or NoPark
89

9.2.2 Parking Space Light State


fo
r1

 Get parking space light state

Table 9-6
00

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ParkingSpaceLight
Syntax
M

State
Method GET
EG

Use this method. It can get the light state config. For example, it can know that when the
A

Description space is free, then the light should be green, and the space is full, the light should be
red.
Di

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=ParkingSpac
Example
st

eLightState
rib

table.ParkingSpaceLightState.SpaceFree.Blue=0
table.ParkingSpaceLightState.SpaceFree.Green=1
ut

table.ParkingSpaceLightState.SpaceFree.Pink=0
io

table.ParkingSpaceLightState.SpaceFree.Purple=0
table.ParkingSpaceLightState.SpaceFree.Red=0
n

table.ParkingSpaceLightState.SpaceFree.White=0
s.r

Success
table.ParkingSpaceLightState.SpaceFree.Yellow=0
Return
table.ParkingSpaceLightState.SpaceFull.Blue=0
.o

table.ParkingSpaceLightState.SpaceFull.Green=0
.

table.ParkingSpaceLightState.SpaceFull.Pink=0
table.ParkingSpaceLightState.SpaceFull.Purple=0
table.ParkingSpaceLightState.SpaceFull.Red=1
table.ParkingSpaceLightState.SpaceFull.White=0

Intelligent Traffic APIs 207


table.ParkingSpaceLightState.SpaceFull.Yellow=0
table.ParkingSpaceLightState.SpaceOrder.Blue=0
table.ParkingSpaceLightState.SpaceOrder.Green=0
table.ParkingSpaceLightState.SpaceOrder.Pink=0
table.ParkingSpaceLightState.SpaceOrder.Purple=0
table.ParkingSpaceLightState.SpaceOrder.Red=0
table.ParkingSpaceLightState.SpaceOrder.White=0
Da

table.ParkingSpaceLightState.SpaceOrder.Yellow=1
table.ParkingSpaceLightState.SpaceOverLine.Blue=0
hu

table.ParkingSpaceLightState.SpaceOverLine.Green=0
table.ParkingSpaceLightState.SpaceOverLine.Pink=0
aH

table.ParkingSpaceLightState.SpaceOverLine.Purple=0
table.ParkingSpaceLightState.SpaceOverLine.Red=0
TT

table.ParkingSpaceLightState.SpaceOverLine.White=0
P

table.ParkingSpaceLightState.SpaceOverLine.Yellow=1
table.ParkingSpaceLightState.SpaceSpecial.Blue=0
AP

table.ParkingSpaceLightState.SpaceSpecial.Green=0
IV

table.ParkingSpaceLightState.SpaceSpecial.Pink=0
table.ParkingSpaceLightState.SpaceSpecial.Purple=0
2.

table.ParkingSpaceLightState.SpaceSpecial.Red=0
89

table.ParkingSpaceLightState.SpaceSpecial.White=0
table.ParkingSpaceLightState.SpaceSpecial.Yellow=1
fo

Parameters in Response :
There are five conditions about the space light state: SpaceFree, SpaceFull,
r1

SpaceOrder, SpaceOverLine, and SpaceSpecial. For each condition, you can choose
00

the light state.


Comment
The state value is integer. It can be 0, 1, 2.
M

0 means close;
EG

1 means open;
2 means twinkle.
A

 Set parking space light state


Di

Table 9-7
st

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
rib

Method GET
ut

Description Set the light state config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ParkingSpaceLightSt
io

ate.SpaceFree.Blue=1&ParkingSpaceLightState.SpaceFree.Green=0&ParkingSpaceLi
n

Example ghtState.SpaceFree.Pink=0&ParkingSpaceLightState.SpaceFree.Purple=0&ParkingSp
s.r

aceLightState.SpaceFree.Red=0&ParkingSpaceLightState.SpaceFree.White=0&Parki
ngSpaceLightState.SpaceFree.Yellow=0
.o

Success
.

OK
Return
Comment —

Intelligent Traffic APIs 208


9.2.3 Set Order State
Table 9-8
http://<server>/cgi-bin/trafficParking.cgi?action=setOrderState&state[0].Lane=<LaneN
Syntax
umber>&state[0].State=<State>
Method GET
Da

Description Set the light order state, order or not


http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setOrderState&state[0].Lane=0&s
Example
hu

tate[0].State=Ordered
Success
aH

OK
Return
Parameters in URL:
TT

Comment LaneNumber: integer, for now, fixed to 0.


State: string, the value can be "Ordered"or "Free".
P
AP

9.2.4 Set Light State


IV

Table 9-9
2.

http://<server>/cgi-bin/trafficParking.cgi?action=setLightState&state[Index].LightNo=<L
Syntax aneNumber>&state[Index].Color=<Color>&state[Index].State=<State>&state[Index].
89

Enable=<Enable>
Method GET
fo

Description Set the light state.


r1

http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setLightState&state[0].LightNo=0
Example
&state[0].Color=Red&state[0].State=0&state[0].Enable=true
00

Success
OK
M

Return
Parameters in URL:
EG

Index: integer, start with 0.


A

LaneNumber: integer, the No. of the Lane.


Comment
Color: string, it can be Red, Yellow, Blue, Green, Purple, White, Pink.
Di

State: integer, it can be 0, 1, 2.0 means close;1 means open;2 means twinkle;
st

Enable: true or false, enable or not.


rib

9.2.5 [Config] Parking Space Access Filter Setting


ut
io

 Get parking space access filter setting


n

Table 9-10
s.r

http://<server>/cgi-bin/ConfigManager.cgi?action=getConfig&name=ParkingSpaceAcces
URL
sFilter
.o

Method GET
.

Get Parking Space Access Filter config. Using this method, we can get the accessible
Description
address of the device.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )

Intelligent Traffic APIs 209


Name Type R/O Param Description
table object R config table object
+ParkingSpaceA
object R ParkingSpaceAccessFilter config object
ccessFilter
++Enable bool R Enable filter or not
++Type string R Filter type, can be: "BannedList", "TrustList".
++TrustList Array<string> O IP address list that trust
Da

++BannedList Array<string> O IP address list that banned.


[ Example ]
hu

GET
aH

Request http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=getConfig&name=ParkingSpaceAccessFil
ter
TT

table.ParkingSpaceAccessFilter.Enable=false
Respons table.ParkingSpaceAccessFilter.Type=TrustList
P

e table.ParkingSpaceAccessFilter.TrustList[0]=172.24.2.14
AP

table.ParkingSpaceAccessFilter.BannedList[0]=172.24.2.15
 Set parking space access filter setting
IV

Table 9-11
2.

URL http://<server>/cgi-bin/ConfigManager.cgi?action=setConfig
89

Method GET
Descripti
Set Parking Space Access Filter config.
fo

on
[ Request Params ] ( key=value format at URL )
r1

Name Type R/O Param Description


00

ParkingSpaceAc
object R ParkingSpaceAccessFilter config object
cessFilter
M

+Enable bool R Enable filter or not


EG

+Type string R Filter type, can be: "BannedList", "TrustList".


+TrustList Array<string> O IP address list that trust
A

+BannedList Array<string> O IP address list that banned.


Di

[ Response Params ] ( OK )
[ Example ]
st

GET
rib

http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=setConfig&ParkingSpaceAccessFilter.Ena
Request
ble=true&ParkingSpaceAccessFilter.Type=TrustList&ParkingSpaceAccessFilter.TrustList[0]
ut

=172.24.2.14&ParkingSpaceAccessFilter.BannedList[0]=172.24.2.15
io

Respons
OK
n

e
s.r

9.2.6 Set OverLine State


.o
.

Table 9-12
http://<server>/cgi-bin/trafficParking.cgi?action=setOverLineState&state[0].Lane=<Lan
Syntax
eNumber>&state[0].State=<State>
Method GET
Description Set the spaceState overLine state or StopOverLine state

Intelligent Traffic APIs 210


http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setOverLineState&state[0].Lane=
Example
0&state[0].State=OverLine
Success
OK
Return
Parameters in URL:
Comment LaneNumber: integer, for now, fixed to 0.
State: string, the value can be “OverLine” or “StopOverLine”.
Da

9.3 Traffic Record Import Export


hu
aH

9.3.1 Traffic BlackList / RedList


TT

 Import blacklist or redlist record


P

Table 9-13
AP

http://<server>/cgi-bin/trafficRecord.cgi?action=uploadFile&Type=<Type>&format=<Fo
Syntax
rmat>&code=<Code>
IV

Method POST
Upload a blacklist or redlist(whitelist) file into the deivce, and the device will import the
2.

Description
data of the file.This operation may take a long time.
89

POST
/cgi-bin/trafficRecord.cgi?action=uploadFile&Type=TrafficBlackList&format=CSV&code
fo

=UTF-8 HTTP/1.1
r1

Host: 192.168.1.108
Connection: keep-alive
00

Content-Length:XXXX
Content-Type: multipart/form-data;
M

boundary=----WebKitFormBoundaryooT6JTCbuezAQeDy
Example
EG

------WebKitFormBoundaryooT6JTCbuezAQeDy
A

Content-Disposition: form-data; name="blackfile"; filename="TrafficBlackList.CSV"


Di

Content-Type: application/vnd.ms-excel
st

File data….
rib

------WebKitFormBoundaryooT6JTCbuezAQeDy--
ut

Success
OK
io

Return
n

Parameters in URL:
Type: string, the value can be “TrafficBlackList” or “TrafficRedList”.
s.r

Comment
Format: string, for the blacklist or redlist(whitelist), the value is fixed to "CSV".
.o

Code: string, for the blacklist, the value can be "utf-8"or "GB2312".
.

 Export blacklist or redlist record async

Table 9-14
http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=<Name>&file
Syntax
name=<FileName>&format=<Format>&code=<Code>

Intelligent Traffic APIs 211


Method GET
Let the device export the record into a file in the device. This method is non-blocking. To
Description
get the result, it should use the “getFileExportState” method.
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficB
Example
lackList&filename=RecordFile01&format=CSV&code=utf-8
Success
OK
Return
Da

Parameters in URL:
Name: string, the value can be “TrafficBlackList” or “TrafficRedList”.
hu

Comment FileName: [optional], string, the name of the exported file.


aH

Format: string, for the blacklist or redlist(whitelist), the value is fixed to “CSV”.
Code: string, for the blacklist or whitelist, the value can be “utf-8” or “GB2312”.
Get export blacklist or redlist record state
TT

Table 9-15
P

Syntax http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=<Name>
AP

Method GET
Description Get the blacklist or redlist(whitelist) export state
IV

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=Traffi
Example
2.

cBlackList
89

Success
state=0
Return
fo

Parameters in URL:
Name: string, the value can be “TrafficBlackList” or “TrafficRedList”.
r1

Comment
state: integer, the value can be 0(success),1(fail), 2(running), 3(the file is invalid), 4(the
file is too large) or 5(have duplicate info in the file).
00

 Get export blacklist or redlist record result


M

Table 9-16
EG

http://<server>/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=<Type>&filename
Syntax
=<FileName>
A

Method GET
Di

Description Download the blacklist or redlist(whitelist) record


st

http://192.168.1.108/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=TrafficBlackL
Example
ist&filename=RecordFile01
rib

Success
File data
ut

Return
Parameters in URL:
io

Type: string, the value can be “TrafficBlackList” or “TrafficRedList”.


n

Comment
FileName: [optional], string, the name of the downloaded file. The FileName must be
s.r

same as the exported file name.


.o

9.3.2 Traffic Flow


.

 Export traffic flow record

Table 9-17
Syntax http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficFlow&fi

Intelligent Traffic APIs 212


lename=<FileName>&format=<Format>&code=<Code>
Method GET
Let the deivce export the record into a file in the device.This method is non-blocking.To
Description
get the result, it should use the "getFileExportState"method.
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficFl
Example
ow&filename=RecordFile01&format=CSV&code=utf-8
Success
Da

OK
Return
Parameters in URL:
hu

FileName: [optional], string, the name of the exported file.


Comment
aH

Format: string, for the TrafficFlow, the value is fixed to "CSV".


Code: string, for the TrafficFlow, the value can be "utf-8"or "GB2312".
TT

Table 9-18
Syntax http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficFlow
P

Method GET
AP

Description Get the export state.


IV

Example http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=Traffi
cFlow
2.

Success state=0
89

Return
Comment Parameters in Response:
fo

state: integer,the value can be 0(success),1(fail), 2(running), 3(the file is invalid), 4(the
file is too large) or 5(have duplicate info in the file).
r1

Table 9-19
00

Syntax http://<server>/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=TrafficFlow&filena
me=<FileName>
M

Method GET
EG

Description Download the traffic flow record.


Example http://192.168.1.108/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=TrafficFlow&f
A

ilename=RecordFile01
Di

Success File data


st

Return
Comment Parameters in URL:
rib

FileName: [optional], string, the name of the downloaded file. The FileName must be
ut

same as the exported file name.


io
n

9.3.3 Traffic Snap Event Info


s.r

Export traffic snap event info record


.o


.

Table 9-20
http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFileByConditon&name=T
Syntax rafficSnapEventInfo&filename=<FileName>&format=<Format>&code=<Code>&condit
ion.startTime=<StartTime>&condition.endTime=<EndTime>
Method GET

Intelligent Traffic APIs 213


Let the deivce export the record into a file in the device.This method is non-blocking.To
Description
get the result, it should use the "getFileExportState"method.
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=exportAsyncFileByConditon&na
Example me=TrafficSnapEventInfo&filename=RecordFile01&format=CSV&code=utf-8&condition
.startTime=123456700&condition.endTime=123456800
Success
OK
Return
Da

Parameters in URL:
FileName: [optional], string, the name of the exported file.
hu

Format: string, for the TrafficSnapEventInfo, the value is fixed to "CSV".


Comment
aH

Code: string, for the TrafficSnapEventInfo, the value can be "utf-8"or "GB2312".
StartTime: string, the start of the record’s Time.
EndTime: string, The end of the record’s Time.
TT

Table 9-21
P

Syntax http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficSna
AP

pEventInfo
Method GET
IV

Description Get the export state.


2.

Example http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=Traffi
89

cSnapEventInfo
Success state=0
fo

Return
Comment Parameters in Response:
r1

state: integer,the value can be 0(success),1(fail), 2(running), 3(the file is invalid), 4(the
file is too large) or 5(have duplicate info in the file).
00

Table 9-22
M

Syntax http://<server>/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=TrafficSnapEventI
EG

nfo&filename=<FileName>
Method GET
A

Description Download the traffic snap event info record.


Di

Example http://192.168.1.108/cgi-bin/trafficRecord.cgi?action=downloadFile&Type=TrafficSnapE
st

ventInfo&filename=RecordFile01
Success File data
rib

Return
ut

Comment Parameters in URL:


FileName: [optional], string, the name of the downloaded file. The FileName must be
io

same as the exported file name.


n
s.r

9.4 Vehicles Distribution


.o
.

9.4.1 Subscribe Vehicles Distribution Data


Table 9-23
URL http://<server>/cgi-bin/vehiclesDistribution.cgi?action=attach

Intelligent Traffic APIs 214


Method GET
Description Subscribe the vehicles Distribution data.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Channel int R Video channel index which starts from 1
Send heartbeat interval, range is [1, 60],unit is second. If the
URL contains this parameter, and the value is 5, it means every
Da

heartbeat int O 5 seconds the device should send the heartbeat message to
the client, the heartbeat meaage are "Heartbeat". If this
hu

parameter is not present, its default value is 60.


aH

[ Response Params ] ( key=value format)


Name Type R/O Param Description
TT

Channel int R Video channel index which starts from 1


array<obj
VehiclesData R Vehicles distribution data info.
P

ect>
AP

+PtzPresetId int R The ptz preset index which starts from 1.


+RuleId int R The rule id.
IV

The rule type, 197 : vehicle congestion detection, 198 : vehicle


+RuleType int R
limit detection.
2.

+VehiclesNum int R The vehicles number.


89

+QueueLen int R The vehicle queue length.


The detection region, the first array is point list, max item is 32,
fo

array<arr
+Region R the second array is point, must be two int, means x and y value,
ay<int>>
r1

coordinate remap to 0 - 8192.


[ Example ]
00

GET http://192.168.1.108/cgi-bin/vehiclesDistribution.cgi?action=attach&Channel=1&he
Request
M

artbeat=5
HTTP/1.1 200 OK
EG

Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
A

Connection: closed
Di
st

--<boundary>
Content-Type: text/plain
rib

Content-Length: <length>
ut

Response Channel=1
io

VehiclesData[0].PtzPresetId=1
n

VehiclesData[0].RuleId=1
s.r

VehiclesData[0].RuleType=197
VehiclesData[0].VehiclesNum=25
.o

VehiclesData[0].QueueLen=53
.

VehiclesData[0].Region[0][0]=1032
VehiclesData[0].Region[0][1]=1035
VehiclesData[0].Region[1][0]=1045
VehiclesData[0].Region[1][1]=5072

Intelligent Traffic APIs 215


VehiclesData[0].Region[2][0]=6163
VehiclesData[0].Region[2][1]=5127
VehiclesData[0].Region[3][0]=6031
VehiclesData[0].Region[3][1]=1063

--<boundary>
Content-Type: text/plain
Da

Content-Length: 11
hu

Heartbeat
aH

-<boundary>
Content-Type: text/plain
Content-Length: <length>
TT
P

Channel=1
VehiclesData[0].PtzPresetId=2
AP


IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Intelligent Traffic APIs 216


10 Thermography and Radiometry APIs
10.1 Thermography Manager
Da

10.1.1 Get Capability of Thermography


hu
aH

Table 10-1
http://<server>/cgi-bin/ThermographyManager.cgi?action=getCaps&channel=<Channe
Syntax
lNo>
TT

Method GET
P

Description Get thermography capability.


AP

Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getCaps&channel=1
caps.PresetModes = Indoor
IV

caps.Brightness.Max = 100
caps.Brightness.Min = 0
2.

caps.Brightness.Step = 1
89

caps.Sharpness.Max= 100
caps.Sharpness.Min = 0
fo

caps.Sharpness.Step = 5
caps.EZoom.Max= 24
r1

caps.EZoom.Min = 0
00

caps.EZoom.Step = 1
caps.ThermographyGamma.Max= 8
M

caps.ThermographyGamma.Min = -8
EG

caps.ThermographyGamma.Step = 1
Success
caps.SmartOptimizer.Max= 100
Return
A

caps.SmartOptimizer.Min = 0
Di

caps.SmartOptimizer.Step = 5
caps.Agc.Max= 255
st

caps.Agc.Min = 0
rib

caps.Agc.Step = 5
caps.AgcMaxGain.Max= 255
ut

caps.AgcMaxGain.Min = 0
io

caps.AgcMaxGain.Step = 5
n

caps.AgcPlateau.Max= 100
caps.AgcPlateau.Min = 0
s.r

caps.AgcPlateau.Step = 5
.o

caps.PresetColorization[i]= Ironbow2
caps.PresetROIModes[j]= Full Screen
.

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment

Parameters in Response:

Thermography and Radiometry APIs 217


PresetModes: the preset mode. Range is { "Indoor", "Outdoor", "Default" }
PresetColorization: Preset colorization mode. Range is { "WhiteHot", "BlackHot",
"Fusion", "Rainbow", "Globow", "Ironbow1", "Ironbow2", "Sepia", "Color1", "Color2",
"Icefire", "Rain", "RedHot", "GreenHot"}.
PresetROIModes: Preset ROI mode. Range is {"Full Screen", "Sky", "Ground",
"Horizon", "Center 75%", "Center 50%", "Center 25%", "Custom"}
Da

10.1.2 Thermography Options


hu

 Get thermography options config


aH

Table 10-2
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ThermographyOpti
Syntax
TT

ons
Method GET
P

Description Thermography options contain EZoom, Colorization, and SmartOptimizer and so on.
AP

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Thermograph
Example
yOptions
IV

head.EZoom=0
2.

head.Colorization=White Hot
head.SmartOptimizer=10
89

head.OptimizedRegion.Type=Custom
head.OptimizedRegion.Enable= true
fo

head.OptimizedRegion.Regions[i][0u]=0
r1

head.OptimizedRegion.Regions[i][1u]=0
head.OptimizedRegion.Regions[i][2u]=0
00

Success
head.OptimizedRegion.Regions[i][3u]=0
Return
M

head.Agc=10
head.AgcMaxGain=10
EG

head.AgcPlateau=10
head.Mode="HighTemperature"
A

head.Auto.LowToHigh=13
Di

head.Auto.LHROI=15
st

head.Auto.HighToLow=12
rib

head.Auto.HLROI=95
Parameters in Response:
ut

head = table.ThermographyOptions [ChannelNo][0]


ChannelNo: integer, array index starts from 0, which means video channel (equals to
io

Comment
video channel index -1, and so 0 means channel 1).
n

Regions: the region is a rectangle


s.r

i: the array index starts from 0.


 Set thermography options config
.o
.

Table 10-3
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set thermography options.

Thermography and Radiometry APIs 218


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ThermographyOptio
Example
ns[0][0].OptimizedRegion.Type=Gound
Success
OK
Return
Parameters in URL:
The paramName and paramValue are in the table below.
Da

In table below,
Comment
head = ThermographyOptions[ChannelNo][0]
hu

ChannelNo: integer, array index starts from 0, which means video channel(equals to
aH

video channel index -1, and so 0 means channel 1).


i: the array index starts from 0.
TT

Appendix
P

ParamName ParamValue type Description


AP

Range is [0—24].
head.EZoom integer Range and step are got from interface in "10.1.1
IV

Get Capability of Thermography".


Range is {"White Hot", "Black Hot", "Ironbow2",
2.

"IceFire"…}.
head.Colorization String
89

Range and step are got from interface in "10.1.1


Get Capability of Thermography".
fo

Range is [0—100].
r1

head.SmartOptimizer integer Range and step are got from interface in "10.1.1
Get Capability of Thermography".
00

Range is {"Full Screen", "Sky", "Ground",


head.OptimizedRegion.Type String "Horizontal", "Center 75%", "Center 50%", "Center
M

25%", "Custom"}.
EG

head.OptimizedRegion.Enabl true: enable


bool
e false: not enable
A

head.OptimizedRegion.Regi Range is [0—8191].


integer
Di

ons[i][0u] i: the region index, starts from 0.


head.OptimizedRegion.Regi Range is [0—8191].
st

integer
ons[i][1u] i: the region index, starts from 0.
rib

head.OptimizedRegion.Regi Range is [0—8191].


integer
ons[i][2u] i: the region index, starts from 0.
ut

head.OptimizedRegion.Regi Range is [0—8191].


io

integer
ons[i][3u] i: the region index, starts from 0.
n

Range is [0—255].
s.r

head.Agc integer Range and step are got from interface in "10.1.1
Get Capability of Thermography".
.o

Range is [0—255].
.

head.AgcMaxGain integer Range and step are got from interface in "10.1.1
Get Capability of Thermography".
Range and step are got from interface in "10.1.1
head.AgcPlateau integer
Get Capability of Thermography".

Thermography and Radiometry APIs 219


ParamName ParamValue type Description
Range is {"HighTemperature", "LowTemperature",
head.Mode string
"Auto"}.
head.Auto.LowToHigh integer UInt32
head.Auto.LHROI integer UInt32, percentage range is[0—100]
head.Auto.HighToLow integer UInt32
head.Auto.HLROI integer UInt32, percentage range is[0—100]
Da

10.1.3 Get ExternSystem Information


hu
aH

Table 10-4
http://<server>/cgi-bin/ThermographyManager.cgi?action=getExternSystemInfo&chann
Syntax
TT

el=<ChannelNo>
Method GET
P

Description Get extern system Info.


AP

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getExternSystemInfo&
Example
channel=1
IV

sysInfo.SerialNumber = 11111111123
Success sysInfo.SoftwareVersion = 2222222222222
2.

Return sysInfo.FirmwareVersion= 3333333333333


89

sysInfo.LibVersion = 4444444444
Parameters in URL:
fo

Comment
ChannelNo: integer, video channel index which starts from 1.
r1

10.1.4 Get Information of Preset Mode


00

Table 10-5
M

http://<server>/cgi-bin/ThermographyManager.cgi?action=getPresetParam&channel=<
EG

Syntax
ChannelNo>&mode=<modeType>
Method GET
A

Description Get preset mode info.


Di

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getPresetParam&chan
Example
st

nel=1&mode=Default
presetInfo.Brightness = 50
rib

presetInfo.Sharpness= 50
ut

presetInfo.EZoom= 12
presetInfo.ThermographyGamma= 0
io

presetInfo.Colorization= "White Hot"


n

presetInfo.SmartOptimizer= 10
Success
s.r

presetInfo.OptimizedRegion.Type= Full Screen


Return
presetInfo.OptimizedRegion.Enable= Full Screen
.o

presetInfo.OptimizedRegion.Regions[i][0u]=0
.

presetInfo.OptimizedRegion.Regions[i][1u]=0
presetInfo.OptimizedRegion.Regions[i][2u]=0
presetInfo.OptimizedRegion.Regions[i][3u]=0
presetInfo.Agc= 10

Thermography and Radiometry APIs 220


presetInfo.AgcMaxGain=10
presetInfo.AgcPlateau = 10
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
modeType: depends on capability , get from interface in getCaps
Comment
Parameters in Response :
Da

Regions : the region is a rectangle


i : the array index.
hu

10.1.5 Get Optimized Region Information


aH

Table 10-6
TT

http://<server>/cgi-bin/ThermographyManager.cgi?action=getOptimizedRegion&chann
Syntax
P

el=<ChannelNo>
AP

Method GET
Description Get optimized region info.
IV

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getOptimizedRegion&c
Example
hannel=1
2.

optimizedRegion.Type= Full Screen


89

optimizedRegion.Enable= true
Success optimizedRegion.Regions[i][0u]=0
fo

Return optimizedRegion.Regions[i][1u]=0
r1

optimizedRegion.Regions[i][2u]=0
optimizedRegion.Regions[i][3u]=0
00

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
M

Comment
EG

Parameters in Response:
Regions : the region is a rectangle
A

i: the region index.


Di

10.1.6 Enable Shutter


st
rib

Table 10-7
http://<server>/cgi-bin/ThermographyManager.cgi?action=enableShutter&channel=<C
ut

Syntax
hannelNo>&enable=<Enable>
io

Method GET
n

Description Shutter control, whether enable shutter.


s.r

http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=enableShutter&channel
Example
=1&enable=true
.o

Success
OK
.

Return
Parameters in URL:
Comment ChannelNo: integer, video channel index which starts from 1.
Enable: true or false, enable or not.

Thermography and Radiometry APIs 221


10.1.7 Fix Focus
Table 10-8
http://<server>/cgi-bin/ThermographyManager.cgi?action=fixFocus&linkVideoChannel[
Syntax
0]=<ChannelNo>&linkVideoChannel[1]=<ChannelNo>[&speed=<SpeedValue>]
Method GET
Da

Description The visual channel change focus to the same as the thermography channel.
http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=fixFocus&linkVideoCha
Example
hu

nnel[0]=1&linkVideoChannel[1]=2
Success
aH

OK
Return
Parameters in URL:
TT

Comment ChannelNo: integer, video channel index which starts from 1.


SpeedValue: float, range is 0.0-1.0.
P
AP

10.1.8 Do Flat Field Correction


IV

Table 10-9
2.

http://<server>/cgi-bin/ThermographyManager.cgi?action=doFFC&channel=<Channel
Syntax
89

No>
Method GET
fo

Description Do flat field correction.


Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=doFFC&channel=1
r1

Success
OK
Return
00

Parameters in URL:
Comment
M

ChannelNo: integer, video channel index which starts from 1.


EG

10.2 Radiometry
A
Di

10.2.1 Get Capability of Radiometry


st

Table 10-10
rib

http://<server>/cgi-bin/RadiometryManager.cgi?action=getCaps[&channel=<ChannelN
Syntax
ut

o>]
Method GET
io

Description Get the capabilities of radiometry manager.


n

Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getCaps&channel=1
s.r

caps.TotalNum.MaxNum=8
caps.TotalNum.Spot.MaxSpots=8
.o

caps.TotalNum.Line.MaxLines=1
Success
.

caps.TotalNum.Area.MaxAreas=8
Return
caps.TemperPresets.MaxPresets=256
caps.MeterInfo.Type[0u]=Spot
caps.MeterInfo.Type[1u]=Area

Thermography and Radiometry APIs 222


caps.MeterInfo.ObjectEmissivity.Max=100
caps.MeterInfo.ObjectEmissivity.Min=0
caps.MeterInfo.ObjectEmissivity.Default=0
caps.MeterInfo.ObjectEmissivity.Step=1
caps.MeterInfo.ObjectDistanceMeter.Max=100
caps.MeterInfo.ObjectDistanceMeter.Min=0
caps.MeterInfo.ObjectDistanceMeter.Default=0
Da

caps.MeterInfo.ObjectDistanceMeter.Step=1
caps.MeterInfo.ReflectedTemperature.Max=100
hu

caps.MeterInfo.ReflectedTemperature.Min=0
caps.MeterInfo.ReflectedTemperature.Default=0
aH

caps.MeterInfo.ReflectedTemperature.Step=1
caps.MeterInfo.RelativeHumidity.Max=100
TT

caps.MeterInfo.RelativeHumidity.Min=0
P

caps.MeterInfo.RelativeHumidity.Default=0
caps.MeterInfo.RelativeHumidity.Step=1
AP

caps.MeterInfo.AtmosphericTemperature.Max=100
IV

caps.MeterInfo.AtmosphericTemperature.Min=0
caps.MeterInfo.AtmosphericTemperature.Default=0
2.

caps.MeterInfo.AtmosphericTemperature.Step=1
89

caps.Statistics.MinPeriod=60
caps.Isotherm.MaxTemp=327.0
fo

caps.Isotherm.MinTemp=-20.0
Parameters in URL:
r1

Comment
ChannelNo: integer, video channel index which starts from 1.
00

10.2.2 Heat Image Thermometry


M
EG

 Get heat image thermometry config

Table 10-11
A

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingTherm
Di

Syntax
ometry
st

Method GET
rib

Description Get HeatImagingThermometry Config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=HeatImaging
Example
ut

Thermometry
io
n
s.r
.o
.

Thermography and Radiometry APIs 223


table.RelativeHumidity = 50
table.AtmosphericTemperature =20
table.ObjectEmissivity =1
table.ObjectDistance =100
table.ReflectedTemperature=20
Success table.TemperatureUnit= Centigrade
Return table.Isotherm.Enable=true
Da

table.Isotherm.MaxValue=50
table.Isotherm.MinValue=0
hu

table.Isotherm.ColorBarDisplay=true
table.HotSpotFollow=true
aH

table.TemperEnable=true
Comment —
TT

 Set heat image thermometry config


P

Table 10-12
AP

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
IV

Method GET
2.

Description Set HeatImagingThermometry Config


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingThermo
89

Example
metry.RelativeHumidity=50&HeatImagingThermometry.ObjectDistance=20.3
Success
fo

OK
Return
r1

Parameters in URL:
Comment
The paramName and paramValue are in the table below.
00

Appendix
M

ParamName ParamValue type Description


EG

The Relative Humidity


A

HeatImagingThermometry.RelativeHumidity integer range and step are got from


interface in getCaps.
Di

The Atmospheric
st

Temperature range and


HeatImagingThermometry.AtmosphericTemperature float
rib

step are got from interface


in getCaps.
ut

The Object Emissivity


io

HeatImagingThermometry.ObjectEmissivity float range and step are got from


interface in getCaps.
n

The Object Distance range


s.r

and step are got from


HeatImagingThermometry.ObjectDistance float
.o

interface in getCaps.
Unit is meter.
.

The Reflected Temperature


HeatImagingThermometry.ReflectedTemperature float range and step are got from
interface in getCaps

Thermography and Radiometry APIs 224


ParamName ParamValue type Description
Range is {Centigrade,
HeatImagingThermometry.TemperatureUnit string
Fahrenheit}.
HeatImagingThermometry.Isotherm.Enable bool true or false
MaxValue range is got form
interface in getCaps.
HeatImagingThermometry.Isotherm.MaxValue float
MaxValue must be bigger
Da

than MinVaue
MinValue range is got form
hu

interface in getCaps.
HeatImagingThermometry.Isotherm.MinValue float
aH

MinValue must be smaller


than MaxVaue.
HeatImagingThermometry.Isotherm.ColorBarDisplay
TT

bool true or false


HeatImagingThermometry.HotSpotFollow bool true or false
P

HeatImagingThermometry.TemperEnable bool true or false


AP

10.2.3 Thermometry Rule


IV

 Get thermometry rule config


2.
89

Table 10-13
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ThermometryRule
fo

Method GET
Description Get thermometry rule.
r1

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Thermometry
Example
Rule
00

head.Enable = true
M

head.PresetId =0
head.RuleId=0
EG

head.Name=SpotName
A

head.Type=Spot
head.MeterRegion.Coordinates[PointNo][0]= 0
Di

head.MeterRegion.Coordinates[PointNo][1]= 0
st


rib

head.T=3
head.Alarm.Id=0
Success
ut

head.Alarm.Enable=true
Return
io

head.Alarm.Result =Max
head.Alarm.AlarmCondition=Below
n

head.Alarm.Threshold=20.0
s.r

head.Alarm.PreThreshold=10.0
head.Alarm.PreDuration=30
.o

head.Alarm.Hysteresis=0.1
.

head.Alarm.Duration=30
head.LocalParameters.Enable=true
head.LocalParameters.ObjectEmissivity=0.95
head.LocalParameters.ObjectDistance=0.95

Thermography and Radiometry APIs 225


head.LocalParameters.RefalectedTemp=0
Parameters in Response :
head =table.ThermometryRule[ChannelNo][RuleNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Comment
RuleNo =rule index.
PointNo = point index
Da

Alarm= AlarmSetting[AlarmNo]
AlarmNo = alarm index
hu

 Set thermometry rule config


aH

Table 10-14
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
TT

alue>[&<paramName>=<paramValue>…]
Method GET
P

Description Set thermometry rule.


AP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ThermometryRule[0]
Example
[0].Name=name1
IV

Success
OK
2.

Return
89

Parameters in URL:
The paramName and paramValue are in the table below.
fo

In table below,
r1

head = ThermometryRule[ChannelNo][RuleNo]
Comment ChannelNo: integer, array index starts from 0, which means video channel (equals to
00

video channel index -1, and so 0 means channel 1).


M

PointNo = point index


RuleNo =rule index.
EG

Alarm= AlarmSetting[AlarmNo]
AlarmNo = alarm index
A
Di

Appendix
st

ParamName ParamValue type Description


rib

head.Enable bool Enable/Disable


Range [0—PresetMax]
ut

PresetMax is got from


head.PresetId integer
io

interface in
GetCurrentProtocolCaps.
n

Range [0—MaxNum]
s.r

head.RuleId integer MaxNum is got from interface


.o

in getCaps.
Radiometry rule name.
.

head.Name string
char[64]
head.Type string Range is {Spot, Line, Area }.

Thermography and Radiometry APIs 226


ParamName ParamValue type Description
Range [0—8091]
head.MeterRegion.Coordinates[PointNo][0] integer The Xscale of Region/Line
point
Range [0—8091]
head.MeterRegion.Coordinates[PointNo][1] integer The Yscale of Region/Line
point
Da

Temperature Sample period.


head.T integer
Unit is Second.
hu

Range [0 — 65535],unique
head.Alarm.Id integer
aH

alarm id
head.Alarm.Enable bool Enable/Disable
TT

Depend on the vaule of Type


Spot : {Vaule}
P

head.Alarm.Result string Line: { Max, Min, Aver}


AP

Area: {Max, Min, Aver, Std, Mid,


ISO}
IV

Range is {Below, Match ,


head.Alarm.AlarmCondition string
Above }
2.

head.Alarm.Threshold float Alarm threshold


89

head.Alarm.Hysteresis float Alarm hysteresis


The duration time of alarm.
fo

head.Alarm.Duration integer
Unit is second
r1

Head.Alarm.PreThreshold float PreAlarm threshold


The duration time of preAlarm.
00

head.Alarm.PreDuration integer
Unit is second
head.LocalParameters.Enable bool Enable/Disable
M

Range [0 — 1]
EG

head.LocalParameters.ObjectEmissivity float
Accuracy is 0.01
Object distance
A

head.LocalParameters.ObjectDistance float The range is got from interface


Di

in getCaps.
st

Object Reflected Temperature


head.LocalParameters.ReflectedTemp float The range is got from interface
rib

in getCaps.
ut

10.2.4 Heat Image Temper Event


io
n

 Get heat image temper event config


s.r

Table 10-15
.o

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingTemp
Syntax
er
.

Method GET
Description Get Heat Imaging Temper config
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingT
Example
emper

Thermography and Radiometry APIs 227


Success head.Enable=false
Return head.EventHandler. paramName = paramValue
Parameters in Response:
head= table.HeatImagingTemper[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set heat image temper event config
Da

Table 10-16
hu

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
aH

Method GET
Description Set Heat Imaging Temper config
TT

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingTemper[
Example
0].Enable=false&HeatImagingTemper[0].EventHandler.BeepEnable=false
P

Success
AP

OK
Return
Parameters in URL:
IV

The paramName and paramValue are in the table below.


2.
89

Comment In table below,


head= HeatImagingTemper[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
fo

video channel index -1, and so 0 means channel 1).


r1

Appendix
00

ParamName ParamValue type Description


M

head.Enable bool Enable/Disable Heat Imaging Temper feature.


EG

Setting of EventHandler is described in


head.EventHandler —
SetEventHandler.
A

10.2.5 Get Temperature of Particular Point


Di
st

Table 10-17
rib

http://<server>/cgi-bin/RadiometryManager.cgi?action=getRandomPointTemper&chann
Syntax
el=<ChannelNo>&coordinate[0]=x &coordinate[1]=y
ut

Method GET
io

Description Get temperature values of random point.


n

http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getRandomPointTemper&
Example
channel=1&coordinate[0]=1024&coordinate[1]=1024
s.r

Success TempInfo.Type=Spot
.o

Return TempInfo.TemperAver=27.5
.

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment
x : The Xscale of the point
y : The Yscale of the point

Thermography and Radiometry APIs 228


10.2.6 Get Temperature of Particular Condition
Table 10-18
http://<server>/cgi-bin/RadiometryManager.cgi?action=getTemper&<paramName>=<p
Syntax
aramValue>[&<paramName>=<paramValue>…]
Method GET
Da

Description Get temperature values from rules which have been set.
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getTemper&condition.Pres
hu

Example etId=0&condition.RuleId=0&condition.Type=Spot&condition.Name=Spot1&condition.ch
annel=1
aH

Success TempInfo.Type=Spot
Return TempInfo.TemperAver=27.5
TT

Parameters in URL:
Comment
The paramName and paramValue are in the table below.
P
AP

Appendix

ParamName ParamValue type Description


IV

condition.Channel integer Video channel index. Start from 1


2.

Range [0- PresetMax]


89

condition.PresetId integer PresetMax is got from interface in


GetCurrentProtocolCaps.
fo

Range [0- MaxNum]


condition.RuleId integer
MaxNum is got from interface in getCaps.
r1

condition.Type string Range is {Spot, Line, Area}.


00

Name is got from interface in


condition.Name string
GetThermometryRuleConfig.
M

10.2.7 Query Temperature Information


EG
A

1. Start to query temperature information


Di

Table 10-19
http://<server>/cgi-bin/RadiometryManager.cgi?action=startFind&condition.StartTime=
st

Syntax <StartTimeValue>&condition.EndTime=<EndTimeValue>&condition.Type=<TypeVal
rib

ue>&condition.channel=<ChannelValue>&condition.Period=<PeriodValue>
ut

Method GET
Description Start to query the history data of temperature values.
io

http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=startFind&condition.StartTi
n

Example me=2010-04-01%200:00:00&condition.EndTime=2010-04-08%200:00:00&condition.Ty
s.r

pe=Spot&condition.channel=1&condition.Period=5
Success token=46878
.o

Return totalCount=333
.

Comment The parameters in bold face are as table below.

Appendix

ParamName ParamValue type Description

Thermography and Radiometry APIs 229


ParamName ParamValue type Description
condition.StartTime string The start time to find.
condition.EndTime string The end time to find.
condition.Type string The type of data. Range is {Spot, Line, Area}
condition.channel integer Video channel index. Start from 1
condition.Period integer Range is {5, 10, 15, 30}, minute
2. Get the data of temperature
Da

Table 10-20
hu

http://<server>/cgi-bin/RadiometryManager.cgi?action=doFind&token=<tokenvalue>&
Syntax
beginNumber=<BeginNumber>&count=<findNum>
aH

Method GET
Description Get the history data of temperature.
TT

http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=doFind&token=46878&be
Example
P

ginNumber=16&count=16
found=12
AP

info[i].Time=2010-04-08 16:12:46
IV

info[i].PresetId=0
info[i].RuleId=0
2.

info[i].Type=Spot
89

info[i].Name=xxxx
Success
info[i].Coordinate[0]=1024
Return
fo

info[i].Coordinate[1]=2048
info[i].Channel=0
r1

info[i].TemperatureUnit=Centigrade
info[i].QueryTemperInfo.TemperAve=50.1
00

info[i].QueryTemperInfo.TemperMax=50.2
M

info[i].QueryTemperInfo.TemperMin=50.0
Parameters in URL:
EG

token: query token, get from interface of the first step above.
A

beginNumber: the begin index in this query.


Comment
count: the number you want to query.
Di

Params in Resp:
st

i: the array index.


rib

3. Stop finding temperature information


ut

Table 10-21
Syntax http://<server>/cgi-bin/RadiometryManager.cgi?action=stopFind&token=<tokenvalue>
io

Method GET
n

Description Stop to find the history data of temperature values.


s.r

Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=stopFind&token=46878
Success
.o

OK
Return
.

Comment token: query token, get from interface of the first step.

10.2.8 Subscribe to Temperature Information


Table 10-22

Thermography and Radiometry APIs 230


http://<server>/cgi-bin/RadiometryManager.cgi?action=attachTemper&channel=<Chan
Syntax
nelNo>
Method GET
Description Subscribe to temperature information of a channel.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=attachTemper&channel=2
--<boundary>\r\n
Content-Type: text/plain\r\n
Da

Content-Length: <data length>\r\n\r\n


info[i].Time=2010-04-08 16:12:46
hu

info[i].PresetId=0
aH

info[i].RuleId=0
info[i].Type=Spot
Success
info[i].Name=xxxx
TT

Return
info[i].Coordinate[0]=1024
P

info[i].Coordinate[1]=2048
AP

info[i].Channel=0
info[i].TemperatureUnit=Centigrade
IV

info[i].QueryTemperInfo.TemperAve=50.1
info[i].QueryTemperInfo.TemperMax=50.2
2.

info[i].QueryTemperInfo.TemperMin=50.0
89

Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment
fo

Params in Resp :
r1

i: the array index.


00

10.2.9 Subscribe to Radiometry Data


M

Table 10-23
EG

http://<server>/cgi-bin/RadiometryManager.cgi?action=attachProc&channel=<Channel
Syntax
No>
A

Method GET
Di

Description Subscribe to radiometry data of a channel. It needs to cooperate with interface below.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=attachProc&channel=2
st

--<boundary>\r\n
rib

Content-Type: text/plain\r\n
Content-Length: <data length>\r\n\r\n
ut

dataInfo.Height=0
io

dataInfo.Width=0
n

dataInfo.Channel=0
s.r

Success dataInfo.Time=2010-05-25 00:00:00


Return dataInfo.Length=0
.o

dataInfo.sensorType="Tau"
.

dataInfo.Unzip.ParamR=1
dataInfo.Unzip.ParamB=1
dataInfo.Unzip.ParamF=1
dataInfo.Unzip.ParamO=1

Thermography and Radiometry APIs 231


--<boundary>\r\n
Content-Type: application/http\r\n
Content-Length: <data length>\r\n\r\n
<Binary data>
Comment ChannelNo: integer, video channel index which starts from 1.

10.2.10 To Fetch Radiometry Data


Da

Table 10-24
hu

http://<server>/cgi-bin/RadiometryManager.cgi?action=toFetch&channel=<ChannelNo
Syntax
aH

>
Method GET
Description
TT

Start to fetch radiometry data.


Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=toFetch&channel=2
P

Success
status=Ready
AP

Return
ChannelNo: integer, video channel index which starts from 1.
IV

Comment status: Range is {Ready, Busy}. "Ready"means service available and "Busy"means
service busy.
2.
89

10.2.11 Get FireWarning Config


fo

Table 10-25
r1

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FireWarning
Method GET
00

Description Get FireWarning config.


Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FireWarning
M

head.Enable=true
EG

head.PresetId=0
head.Row = 31
A

head.Col = 40
Di

head.Mode="Auto"
head.SmdFilterEnable=false
st

head.MovingTargetFilterEnable=false
rib

head.SunReflectEnable=false
ut

head.TimeDurationEnable=false
Success head.FireDuration= 15
io

Return head.DetectWindow[windowsNum].Regions[0]=123468789
n

head.DetectWindow[windowsNum].Regions[1]=123468789
s.r

head.DetectWindow[windowsNum].Regions[2]=123468789
head.DetectWindow[windowsNum].Regions[3]=123468789
.o

head.DetectWindow[windowsNum].Postion[0]=0
.

head.DetectWindow[windowsNum].Postion[1]=0
head.DetectWindow[windowsNum].Postion[2]=0
head.DetectWindow[windowsNum].Postion[3]=0
head.DetectWindow[windowsNum].Sensitivity = 95
head. DetectWindow[windowsNum].Id=1

Thermography and Radiometry APIs 232


head.DetectWindow[windowsNum].Name="windName"
head.EventHandler=(output of EventHandler is described in GetEventHandler)
Parameters in Response:
head= table.FireWarning[ChannleNo][RuleNum]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Comment
RuleNum: integer,array index starts from 0,which means rules in each Preset,
Da

If FireWarningMode is "SpaceExClude", then only the first rule used.


windowsNum: support 4 Nums if FireWarningMode is "PtzPreset", 8 if "SpaceExClude"
hu

Postion: only valid in "SpaceExClude"Mode


aH

10.2.12 Set FireWarning Config


TT

Table 10-26
P

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
AP

alue>[&<paramName>=<paramValue>…]
Method GET
IV

Description Set FireWarning config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FireWarning[0][0].Ea
2.

Example
nble=false
89

Success
OK
Return
fo

Comment head = FireWarning[ChNum][RuleNum]


r1

Appendix:
00

ParamName ParamValue type Description


head.Enable bool whether fire detect take effect
M

head.PresetId integer The PresetId


EG

head.Row integer rows of fire detect area


head.Col integer cols of fire detect area
A

head.Mode string Range is {"Auto","Normal"}.


Di

Head.SmdFilterEnable bool whether smd filter take effect


st

whether moving target filter take


Head.MovingTargetFilterEnable bool
effect
rib

whether sun reflect filter take


Head.SunReflectEnable bool
ut

effect
whether include fire detect
io

head.TimeDurationEnable bool duration,only take effect in


n

SpaceExClude mode
s.r

head.FireDuration integer fire last times


head.DetectWindow[windowsNum].Regions[0] integer detect area mask
.o

head.DetectWindow[windowsNum].Sensitivity integer Rage {0,100}


.

head.DetectWindow[windowsNum].Id integer Rage {0,…}


head.DetectWindow[windowsNum].Name string detect window name
Setting of EventHandler is
head.EventHandler EventHandler
described in SetEventHandler.

Thermography and Radiometry APIs 233


10.2.13 Get FireWarningMode Config
Table 10-27
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FireWarningMode
Method GET
Description Get FireWarningMode config.
Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FireWarningMo
Example
de
hu

Success
head.Mode="PtzPreset"
Return
aH

Parameters in Response:
head= table.FireWarningMode[ChannelNo]
Comment
TT

ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
P
AP

10.2.14 Set FireWarningMode Config


IV

Table 10-28
2.

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
89

alue>[&<paramName>=<paramValue>…]
Method GET
fo

Description Set FireWarningMode config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FireWarningMode[0]
r1

Example
. Mode ="SpaceExClude"
Success
00

OK
Return
M

Comment head = FireWarningMode[ChannelNo]


EG

Appendix:
A

ParamName ParamValue type Description


Di

head.Mode string Rage is {"PtzPreset","SpaceExClude"}


st

10.2.15 Get Current Hot Cold Spot


rib
ut

Table 10-29
io

URL http://<server>/cgi-bin/TemperCorrection.cgi?action=getCurrentHotColdSpot
n

Method GET
s.r

Description Get the max and min temperature values.


[ Request Params ] ( key=value format in URL )
.o

channel int R video channel index which starts from 1.


.

[ Response Params ] (key=value format)


Name Type R/O Param Description
info object R The current hot code spot info.

Thermography and Radiometry APIs 234


array< The hot spot position, must be two int, means x and y value,
+HotPoint R
int> coordinate remap to 0 — 8192.
+HotSpotValue double R The hot spot temperature value.
array< The cold spot position, must be two int, means x and y value,
+ColdPoint O
int> coordinate remap to 0 — 8192.
+ColdSpotValue double O The cold spot temperature value.
+TemperatureUnit int O The temperature unit : 0 Centigrade, 1 Fahrenheit
Da

[ Example ]
GET http://192.168.1.108/cgi-bin/TemperCorrection.cgi?action=getCurrentHotColdSpot
hu

Request
&channel=1
aH

info.HotPoint[0]=1150
info.HotPoint[1]=2320
TT

info.HotSpotValue=35.5
Response info.ColdPoint[0]=5452
P

info.ColdPoint[1]=6192
AP

info.ColdSpotValue=24.3
info.TemperatureUnit=0
IV
2.

10.2.16 Heat Image Temper PreAlarm Event


89

 Get heat image temper pre event config


fo

Table 10-30
r1

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PreAlarmEvent
00

Method GET
Description Get Heat Imaging Temper PreAlarm Event config
M

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PreAlarmEve
Example
EG

nt
Success head.Enable=false
A

Return head.EventHandler. paramName = paramValue


Di

Parameters in Response:
head= table.PreAlarmEvent[ChannelNo]
st

Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
rib

video channel index -1, and so 0 means channel 1).


 Set heat image temper pre event config
ut

Table 10-31
io

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
n

Syntax
alue>[&<paramName>=<paramValue>…]
s.r

Method GET
Description Set Heat Imaging Temper PreAlarm Event config
.o

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PreAlarmEvent[0].En
.

Example
able=false&PreAlarmEvent[0].EventHandler.BeepEnable=false
Success
OK
Return
Comment Parameters in URL:

Thermography and Radiometry APIs 235


The paramName and paramValue are in the table below.

In table below,
head=PreAlarmEvent[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
Da

Appendix

ParamName ParamValue type Description


hu

head.Enable bool Enable/Disable Heat Imaging Temper feature.


aH

Setting of EventHandler is described in


head.EventHandler —
SetEventHandler.
TT
P
AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Thermography and Radiometry APIs 236


11 Access Control APIs
11.1 Door
Da

11.1.1 Open Door


hu
aH

Table 11-1
http://<server>/cgi-bin/accessControl.cgi?action=openDoor&channel=<ChannelNo>[&
Syntax
UserID=<UserID>&Type=<Type>]
TT

Method GET
P

Description Open the door.


AP

http://192.168.1.108/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=
Example
101&Type=Remote
IV

Success
OK
Return
2.

Parameters in URL:
89

ChannelNo: integer, the index of door, starts from 1.


Comment
UserID: remote user ID.
fo

Type: the open type, default value is "Remote".


r1

11.1.2 Get Door Status


00

Table 11-2
M

Syntax http://<server>/cgi-bin/accessControl.cgi?action=getDoorStatus&channel=<ChannelNo>
EG

Method GET
Description Get status of the door.
A

Example http://192.168.1.108/cgi-bin/accessControl.cgi?action=getDoorStatus&channel=1
Di

Success
Info.status=Open
Return
st

Parameters in URL :
rib

ChannelNo: integer, the index of door, starts from 1.


Comment
Parameters in Response :
ut

status : the range is {Open, Break, Close}


io
n

11.1.3 Close Door


s.r

Table 11-3
.o

http://<server>/cgi-bin/accessControl.cgi?action=closeDoor&channel=<ChannelNo>[&
Syntax
.

UserID=<UserID>&Type=<Type>]
Method GET
Description Close the door.
http://192.168.1.108/cgi-bin/accessControl.cgi?action=closeDoor&channel=1&UserID=
Example
101&Type=Remote

Access Control APIs 237


Success
OK
Return
Parameters in URL:
ChannelNo: integer, the index of door, starts from 1.
Comment
UserID: remote user ID.
Type: the open type, default value is "Remote".
Da

11.1.4 Capture Fingerprint


hu
aH

Table 11-4
Syntax http://<server>/cgi-bin/accessControl.cgi?action=captureFingerprint
TT

Method GET
Description Capture fingerprint data, then report it via ‘Fingerprint’ event.
P

[ Request Params ] ( key=value format at URL )


AP

Name Type R/O Param Description


info object R fingerprint data
IV

+ReaderID string R Reader machine ID


2.

+FingerPrintNam
string O Fingerprint name (For smart building products)
e
89

+ UserID string O User Identity (For smart building products)


heartbeat int R Heartbeat interval (sec)
fo

timeout int R Timeout (sec)


r1

[ Response Params ] ( OK )
[ Example ]
00

GET http://<server>/cgi-bin/accessControl.cgi?action=captureFingerprint&
M

Request info.ReaderID=101&info.FingerPrintName=aaaa&info.UserID=10221&heartbeat=5&timeou
t=10
EG

Response OK
A
Di

11.1.5 Capture face picture


st
rib

Table 11-5
URL http://<server>/cgi-bin/accessControl.cgi?action=captureCmd
ut

Method GET
io

Description Capture face data, then report it via ‘CitizenPictureCompare’ event.


n

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
s.r

Capture entity types:


.o

+type int R 0x01 - Face


0x02 - Identification card
.

+ UserID string O User ID


heartbeat int R Heartbeat interval (sec)
timeout int R Timeout (sec)
[ Response Params ] ( OK )

Access Control APIs 238


[ Example ]
GET http://<server>/cgi-bin/accessControl.cgi?action=captureCmd&type
Request
=1&UserID=10221&heartbeat=5&timeout=10
Response OK

11.2 Access Control


Da
hu

11.2.1 Add Access Control Custom Password


aH

Table 11-6
http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCustomPa
TT

URL
ssword
P

Method GET
Description Insert access control custom password.
AP

[ Request Params ] ( key=value format in URL )


IV

Name Type R/O Param Description


Access control custom password record name, should be
name string R
2.

"AccessControlCustomPassword".
89

UserID string R The user's id.


OpenDoorPass
string R Ths user’s open door password.
fo

word
Ths user’s alarm password. ( This param is not supported by
r1

AlarmPassword string O
video talk device )
00

The index of the doors that custom password can open. ( This
Doors array<int> O
param is not supported by video talk device )
M

The index of the time sections of each door that this card can
TimeSections array<int> O
EG

open. ( This param is not supported by video talk device )


VTO position number. ( This param is not supported by access
VTOPosition string O
A

control device )
Di

ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".


ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".
st

ValidCounts int O The password’s valid counts.


rib

OriginSmartGate The origin smart gateway address. ( Video talk device


string O
Way customize. )
ut

[ Response Params ] (key=value format)


io

R/
Name Type Param Description
n

O
s.r

RecNo int R The record id.


[ Example ]
.o

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControl
.

CustomPassword&UserID=102&OpenDoorPassword=123456&Doors[0]=1&Doors[1]=3&
Request
Doors[2]=5&VTOPosition=01018001&ValidDateStart=20151022%20093811&ValidDateEn
d=20151222%20093811&ValidCounts=30
Response RecNo=12345

Access Control APIs 239


11.2.2 Modify Access Control Custom Password
Table 11-7
http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCustom
URL
Password
Method GET
Da

Update access control custom password.


Description
Note: You should provide at lease one optional param to update.
hu

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
aH

Access control custom password record name, should be


name string R
"AccessControlCustomPassword".
TT

recno int R The record id.


UserID string R The user's id.
P

OpenDoorPass
AP

string R Ths user’s open door password.


word
Doors array<int> O The index of the doors that custom password can open.
IV

…<See above insert command for other params of the record,


…<other param> — —
2.

They are all optional.>


89

[ Response Params ] ( OK )
[ Example ]
fo

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=AccessContr
olCustomPassword&recno=12345&UserID=102&OpenDoorPassword=123456&Doors[0]
r1

Request
=1&Doors[1]=3&Doors[2]=5&ValidDateStart=20151022%20093811&ValidDateEnd=2015
00

1222%20093811
Response OK
M

11.2.3 Delete Access Control Custom Password


EG
A

 Delete access control custom password record by recno


Di

Table 11-8
st

http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCustomPa
URL
ssword
rib

Method GET
ut

Descriptio
Remove the access control custom password record by recno.
n
io

[ Request Params ] ( key=value format in URL )


n

Name Type R/O Param Description


s.r

Access user card and fingerprint record name, should be


name string R
"AccessControlCustomPassword".
.o

recno int R The record id.


.

[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=AccessCont
Request
rolCustomPassword&recno=12345

Access Control APIs 240


Response OK
 Delete all the access control custom password records

Table 11-9
http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCustomPass
URL
word
Method GET
Da

Descriptio
Remove all the access control custom password records
n
hu

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
aH

Access user card and fingerprint record name, should be


name string R
"AccessControlCustomPassword".
TT

[ Response Params ] ( OK )
[ Example ]
P

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControl
AP

Request
CustomPassword
IV

Response OK
2.

11.2.4 Find Access Control Custom Password


89

 Find Access control custom password by condition


fo

Table 11-10
r1

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCustomPass
URL
word
00

Method GET
Description Find Access control custom password by condition.
M

[ Request Params ] ( key=value format in URL )


EG

Name Type R/O Param Description


name string R Record Name, should be "AccessControlCustomPassword".
A

count int O Max result to return, default is 1024.


Di

StartTime string O The start of the record's CreateTime.


st

EndTime string O The End of the record's CreateTime.


rib

condition object O Search condition.


+UserID string O The user's id.
ut

[ Response Params ] (key=value format)


Name Type R/O Param Description
io

totalCount int O The total record num that find.


n

found int O The record num that returned.


s.r

records array<object> R The records that returned.


.o

+RecNo int R The record id.


+CreateTime int O The create time of record.
.

+UserID string R The user's id.


+OpenDoorPa
string R Ths user’s open door password.
ssword

Access Control APIs 241


+AlarmPasswo Ths user’s alarm password. ( This param is not supported by
string O
rd video talk device )
The index of the doors that custom password can open. ( This
+Doors array<int> O
param is not supported by video talk device )
The index of the time sections of each door that this card can
+TimeSections array<int> O
open. ( This param is not supported by video talk device )
VTO position number. ( This param is not supported by video
Da

VTOPosition string O
talk device )
+ValidDateStar
hu

string O The start of valid date, format is "yyyyMMdd hhmmss".


t
aH

+ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


+ValidCounts int O The password’s valid counts.
TT

+OriginSmartG The origin smart gateway address. ( Video talk device


string O
ateWay customize. )
P

[ Example ]
AP

GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCust
Request omPassword&condition.UserID=103&StartTime=123456700&EndTime=123456800&count
IV

=100
totalCount=1000
2.

found=100
89

records[0].RecNo=12345
records[0].CreateTime=123456789
fo

records[0].UserID=103
r1

records[0].OpenDoorPassword=123456
records[0].Doors[0]=1
00

records[0].Doors[1]=3
records[0].Doors[2]=5
M

records[0].VTOPosition=01018001
EG

records[0].ValidStart=20151022 093811
records[0].ValidEnd=20151222 093811
A

Response

Di

records[1].RecNo=13579
records[1].CreateTime=123456799
st

records[1].UserID=103
rib

records[0].OpenDoorPassword=123456
records[1].Doors[0]=2
ut

records[1].Doors[1]=4
io

records[1].Doors[2]=6
n

records[1].VTOPosition=01018002
s.r

records[1].ValidStart=20151022 093811
records[1].ValidEnd=20151222 093811
.o


.

 Find Access control custom password by recno

Table 11-11
http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCustomPas
URL
sword

Access Control APIs 242


Method GET
Description Find Access control custom password by recno.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R Record Name, should be "AccessControlCustomPassword".
recno int R The record id.
[ Response Params ] (key=value format)
Da

Name Type R/O Param Description


record object R The record that returned.
hu

+RecNo int R The record id.


aH

+CreateTime int O The create time of record.


+UserID string R The user's id.
TT

…<other param> — — …<See above find command for other params of the record.>
[ Example ]
P

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCu
Request
AP

stomPassword&recno=3
record.RecNo=3
IV

record.CreateTime=123456789
record.UserID=103
2.

record.OpenDoorPassword=123456
89

record.Doors[0]=1
Response record.Doors[1]=3
fo

record.Doors[2]=5
r1

record.VTOPosition=01018001
record.ValidStart=20151022 093811
00

record.ValidEnd=20151222 093811

M
EG

11.2.5 Get the Total Number of Records of Access Control


A

Custom Password
Di
st

Table 11-12
http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessControlCust
rib

URL
omPassword
ut

Method GET
Description Get the total number of records of the access control custom password.
io

[ Request Params ] ( key=value format in URL )


n

Name Type R/O Param Description


s.r

Access user card and fingerprint record name, should be


name string R
"AccessControlCustomPassword".
.o

[ Response Params ] ( key=value )


.

count int R The total number of records.


[ Example ]
GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=getQuerySize&name=Access
Request
ControlCustomPassword

Access Control APIs 243


Response count=150

11.2.6 Get Access Control Caps


Table 11-13
URL http://<server>/cgi-bin/accessControlManager.cgi?action=getCaps
Method GET
Da

Description Get access control capabilities.


[ Request Params ] ( none )
hu

[ Response Params ] ( key=value )


aH

caps object R The access control capabilities.


+AccessControl
int R The access control channel number.
TT

Channels
+AccessControl Support log access control alarm record or not. ( This param is
bool O
P

AlarmRecord not supported by video talk device )


AP

+CustomPasswo
int O The custom password crypt type, 0 : plain text, 1 : MD5
rdEncryption
IV

+SupportFinger Support fingerprint type, 0 : unknown, 1 : not support, 2 :


int O
Print support
2.

+OnlySingleDoo Support single door auth type, 0 : not support, 1 : support,


89

int O
rAuth ( This param is not used by video talk device )
Support async auth type, 0 : not support, 1 : support, ( This
fo

+AsynAuth int O
param is not supported by video talk device )
r1

+SpecialDaysSc Special days schedule capabilities, ( This param is not


object O
hedule supported by video talk device )
00

Support special days schedule or not. ( This param is not


++Support bool O
supported by video talk device )
M

++MaxSpecialD Max special days schedule number. ( This param is not


EG

uint O
aysSchedules supported by video talk device )
++MaxTimePeri Max time periods per day. ( This param is not supported by
A

uint O
odsPerDay video talk device )
Di

++MaxSpecialD Max special day groups. ( This param is not supported by video
uint O
st

ayGroups talk device )


++MaxDaysInSp Max special days in special day group. ( This param is not
rib

uint O
ecialDayGroup supported by video talk device )
ut

[ Example ]
Request GET http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getCaps
io
n
s.r
.o
.

Access Control APIs 244


caps.AccessControlChannels=3
caps.AccessControlAlarmRecord=true
caps.CustomPasswordEncryption=1
caps.SupportFingerPrint=1
caps.OnlySingleDoorAuth=1
Response caps.AsynAuth=1
caps.SpecialDaysSchedule.Support=true
Da

caps.SpecialDaysSchedule.MaxSpecialDaysSchedules=5
caps.SpecialDaysSchedule.MaxTimePeriodsPerDay=5
hu

caps.SpecialDaysSchedule.MaxSpecialDayGroups=5
caps.SpecialDaysSchedule.MaxDaysInSpecialDayGroup=5
aH
TT

11.2.7 Get Lock Status


P
AP

Syntax http://<server>/cgi-bin/accessControl.cgi?action=getLockStatus&channel=<ChannelNo>
Method GET
IV

Description Get status of the lock.


Example http://192.168.1.108/cgi-bin/accessControl.cgi?action= getLockStatus &channel=1
2.

Success onLineStatus =”Online”


89

Return status =”Close”


Comment Parameters in URL :
fo

ChannelNo: integer, the index of lock, starts from 1. Default is 1 if not present.
r1

Parameters in Response :
status: the range is {“Open”,”Close”,”Abnormal”, "FakeLocked", "Unknown" }
00

onLineStatus: the range is { "OnLine", "OffLine" }


M
EG

11.2.8 [Config] Access Control General Setting


A
Di

 Get access control general setting


st

Table 11-14
rib

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessControlGener
URL
al
ut

Method GET
io

Description Get access control general setting.


[ Request Params ] ( None )
n

[ Response Params ] ( key=value format )


s.r

Name Type R/O Param Description


.o

table object R config table object


+AccessControl
.

object R AccessControlGeneral config object


General
++AccessProper Access property, can be : “unidirect”, “bidirect” ( This
string O
ty param is supported by access control device. )
+ABLock object O AB Lock setting ( This param is supported by access

Access Control APIs 245


control device. )
+++Enable bool O Enable AB Lock or not.
AB Lock groups, each group has several doors, one door
Array<
+++Doors O can be opened only when all other doors in the AB lock
Array<int> >
group are in closed state.
++CustomPass Whether to enable custom password. ( This param is
bool O
wordEnable supported by video talk device. )
Da

++CommonPass The common password. ( This param is supported by


string O
word video talk device. )
hu

++ButtonExitEna Whether to enable the open door button. ( This param is


bool O
aH

ble supported by video talk device. )


++CheckSensor Whether to check the sensor before lock the door. ( This
bool O
BeforeLock param is supported by video talk device. )
TT

++CheckSensor The check sensor time, in seconds. ( This param is


int O
P

Time supported by video talk device. )


AP

++DuressPassw The duress password. ( This param is supported by video


string O
ord talk device. )
IV

Whether to enable duress password. ( This param is


++DuressEnable bool O
supported by video talk device. )
2.

Unlock Record Type,can be {"Password", "Button",


89

++UnlockRecord
Array<string> O "FingerPrint", "QRCode", "Card","Remote", "BlueTooth",
Type
"Face"}
fo

sensor type,
++SensorType integer O
r1

0 for always open; 1 for always close.


++CallLiftType string O call lift protocol type
00

++CallLiftEnable bool O whether to enable call lift


++AccessVoice object O Door opening prompt tone
M

+++CurrentVoice
EG

integer O the current prompt tone ID, default value 0


ID
voice list, max length is 16
A

voice ID can be: {


Di

0: Validate succeed
st

1: door open succeed


2: unlock succeed
rib

+++VoiceList array<object> O 3: punch time clocks succeed


ut

4: welcome
5: Welcome to come again
io

6: thank you
n

7: custom voice
s.r

}
++++VoiceID integer O voice id
.o

++++VoiceName string O voice info


.

++++FileName string O file full path with name


[ Example ]
GET
Request
http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=AccessControlGeneral

Access Control APIs 246


table.AccessControlGeneral.AccessProperty=bidirect
table.AccessControlGeneral.ABLock.Enable=true
table.AccessControlGeneral.ABLock.Doors[0][0]=1
table.AccessControlGeneral.ABLock.Doors[0][1]=2
table.AccessControlGeneral.ABLock.Doors[0][2]=3
table.AccessControlGeneral.ABLock.Doors[1][0]=4
table.AccessControlGeneral.ABLock.Doors[1][1]=5
Respons
Da

table.AccessControlGeneral.ABLock.Doors[1][2]=6
e
table.AccessControlGeneral.CustomPasswordEnable=true
hu

table.AccessControlGeneral.CommonPassword=123456
table.AccessControlGeneral.ButtonExitEnable=true
aH

table.AccessControlGeneral.CheckSensorBeforeLock=true
table.AccessControlGeneral.CheckSensorTime=30
TT

table.AccessControlGeneral.DuressPassword=654321
P

table.AccessControlGeneral.DuressEnable=true
AP

 Set access control general setting

Table 11-15
IV

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
2.

Method GET
Descripti
89

Set access control general setting.


on
[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


r1

AccessControlG
object R AccessControlGeneral config object
eneral
00

+AccessPropert Access property, can be : “unidirect”, “bidirect” ( This param


string O
M

y is supported by access control device. )


…<See above getConfig command for other params of the
EG

…<other param> — —
config object, They are all optional.>
A

[ Response Params ] ( OK )
[ Example ]
Di

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&AccessControlGeneral.Ac
st

cessProperty=bidirect&AccessControlGeneral.ABLock.Enable=false&AccessControlGener
rib

Request al.CustomPasswordEnable=true&AccessControlGeneral.CommonPassword=123456&Acc
essControlGeneral.ButtonExitEnable=true&AccessControlGeneral.CheckSensorBeforeLoc
ut

k=true
io

Respons
OK
e
n
s.r

11.2.9 [Config] Access Control Setting


.o

 Get access control setting


.

Table 11-16
URL http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessControl
Method GET

Access Control APIs 247


Description Get access control setting.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )
Name Type R/O Param Description
table object R The config table
The AccessControl config array for every access control
+AccessControl array<object> R
channel
Da

++Enable bool O Whether to enable config for this channel.


Door state, can be : “Normal”, “CloseAlways”,
hu

++State string O
“OpenAlways”, “NoPersonNC”, “NoPersonNO”
aH

Open door method, can be following value, default is 2 :


0 : only by password
TT

1 : only by access card


2 : by password or access card
P

3 : by access card first then password


AP

4 : by password first then access card


5 : different method in differenct time range
IV

6 : only by fingerprint
7 : by password or access card or fingerprint
2.

8 : by password and access card and fingerprint together


89

9 : by password and fingerprint together


10 : by access card and fingerprint together
fo

11 : by multiple access user


r1

12 : by face ( match with picture in ID card )


13 : by face and ID card
00

14 : by face ( match with picture in ID card ) or access card


or fingerprint
M

15 : by face and ID card, or access card or fingerprint


EG

++Method int O 16 : by UserID and password


17 : only by face
A

18 : by face and password together


Di

19 : by fingerprint and password together


20 : by fingerprint and face together
st

21 : by access card and face together


rib

22 : by face or password
23 : by fingerprint or password
ut

24 : by fingerprint or face
io

25 : by access card or face


n

26 : by access card or fingerprint


27 : by fingerprint and face and password together
s.r

28 : by access card and face and password together


.o

29 : by access card and fingerprint and password together


.

30 : by access card and fingerprint and face together


31 : by fingerpint or face or password
32 : by access card or face or password
33 : by access card or fingerprint or face
34 by access card and fingerprint and face and password

Access Control APIs 248


together
35 : by access card or fingerprint or face or password
36 : by face and ID card, or access card or face
37 : by face ( match with picture in ID card ) or access card
or face
38 : by access card and password, or fingerprint and
password
Da

39 : by ID card ( match with picture in ID card ) or face


40 : by ID card ( match with fingerprint in ID card )
hu

41 : by ID card ( match with fingerprint and picture in ID


card )
aH

42 : by ID card or access card or fingerprint or face or


password
TT

43 : by multy user method


P

44 : by ID card or health code


AP

++OpenAlwaysT The time range that working, value is index in


int O
ime AccessTimeSechdule config.
IV

++CloseAlwaysT The time range that always closed, value is index in


int O
ime AccessTimeSechdule config.
2.

The time range that working in holidays, value is index in


++HolidayTime int O
89

AccessTimeSechdule config.
The Unlock holding interval, unit is milliseconds, value
++UnlockHoldInt
fo

int O should between 250 to 20000. ( This param is also


erval
r1

supported by video talk device. )


++UnlockReload The Unlock reload interval, unit is milliseconds. ( This
int O
00

Interval param is also supported by video talk device. )


The access control process, can be : "Local", "Dahua",
M

++AccessProtoc
string O "Remote", "Private" ( This param is also supported by
ol
EG

video talk device. )


++BreakInAlarm
bool O Whether to enable the breakin alarm.
A

Enable
Di

++RepeatEnterA
bool O Whether to enable the repeat enter alarm.
larm
st

++DoorNotClose
rib

bool O Whether to enable the alarm when door not closed.


dAlarmEnable
++DuressAlarm
ut

bool O Whether to enable the duress alarm.


Enable
io

++FirstEnter object O The first enter setting.


n

+++Enable bool O Whenther to enable the first enter function,


s.r

+++Status string O The status, can be : “KeepOpen” “Normal”


The time range that enable first enter function, value is
.o

+++Time int O
index in AccessTimeSechdule config.
.

++CardNoConve The card number convert setting : 0 – not convert, 1 –


int O
rt convert using NOT operation, 2 : use HIDpro convert
++MaliciousAcc
essControlEnabl bool O Whether to enable malicious access alarm.
e

Access Control APIs 249


+AutoRemoteCh
object O auto open door remotely
eck
+++Enable bool whether to enable the function
working period , value is index in AccessTimeSechdule
+++Time uint
config.
++Name string O name
++RepeatEnterT
Da

integer O Repeat entry time, unit second, 0 means do not start


ime
++CloseTimeout integer O Closing overtime
hu

++SensorEnable bool O sensor enable


aH

Open the door in different periods


Array<Array<
++TimeSchedule it works when Method is "different method in differenct
object>>
TT

time range".
+++TimeSection string O time section, format as "hh:mm:ss-hh:mm:ss"
P

Open door method, can be following value, default is 2 :


AP

0 : only by password
1 : only by access card
IV

2 : by password or access card


3 : by access card first then password
2.

4 : by password first then access card


89

5 : different method in differenct time range


+++Method integer O 6 : only by fingerprint
fo

7 : by password or access card or fingerprint


r1

8 : by password and access card and fingerprint together


9 : by password and fingerprint together
00

10 : by access card and fingerprint together


11 : by multiple access user
M

17 : only by face
EG

35 : by access card or fingerprint or face or password


++CustomPass
A

bool O whether to enable custom password


wordEnable
Di

++RemoteCheck bool O Is platform validation required


[ Example ]
st

Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=AccessControl


rib

table.AccessControl[0].Enable=true
ut

table.AccessControl[0].State=Normal
table.AccessControl[0].Method=2
io

table.AccessControl[0].OpenAlwaysTime=1
n

table.AccessControl[0].CloseAlwaysTime=2
s.r

Respons table.AccessControl[0].UnlockHoldInterval=500
e table.AccessControl[0].AccessProtocol=Local
.o

table.AccessControl[0].BreakInAlarmEnable=true
.

table.AccessControl[0].DuressAlarmEnable=true
table.AccessControl[0].CardNoConvert=0
table.AccessControl[0].MaliciousAccessControlEnable=true

 Set access control setting

Access Control APIs 250


Table 11-17
URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti
Set access control setting.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Da

AccessControl array<object> R AccessControl config object array


+Enable bool O Whether to enable config for this channel.
hu

…<See above getConfig command for other params of the


…<other param> — —
aH

config object, They are all optional.>


[ Response Params ] ( OK )
TT

[ Example ]
GET
P

http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].Enable=true&
AP

AccessControl[0].State=Normal&AccessControl[0].Method=2&AccessControl[0].OpenAlwa
Request ysTime=1&AccessControl[0].CloseAlwaysTime=2&AccessControl[0].UnlockHoldInterval=5
IV

00&AccessControl[0].AccessProtocol=Local&AccessControl[0].BreakInAlarmEnable=true&
AccessControl[0].DuressAlarmEnable=true&AccessControl[0].CardNoConvert=0&AccessC
2.

ontrol[0].MaliciousAccessControlEnable=true
89

Respons
OK
e
fo
r1

11.2.10 [Config] Wiegand Setting


00

 Get Wiegand setting


M

Table 11-18
URL http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Wiegand
EG

Method GET
A

Description Get Wiegand setting.


[ Request Params ] ( None )
Di

[ Response Params ] ( key=value format )


st

Name Type R/O Param Description


rib

table object R config table object


+Wiegand array<object> R Wiegand config
ut

++Mode int R Wiegand mode, 0: wiegand input, 1 : wiegand output


io

++PulseWidth int R The pulse width, unit is microseconds


n

++PulseStep int R The pulse step, unit is microseconds


The transfer mode, 0 : wiegand 34bit transfer, 4 byte card
s.r

number, 2 bit checksum, 1 : wiegand 66bit transfer, 8 byte


++TransferMode int R
.o

card number, 2 bit checksum, 2 : wiegand 26bit transfer, 3


.

byte card number, 2 bit checksum,


++OutType int R The output type, 0 : output ID, 1 : output card number
the input type, the value is 32bits. It won’t accept any input
++InputType integer O when value is 0.
Bit0: card number input

Access Control APIs 251


Bit1: password input
bit2~Bit31:reserved
++Doors integer O door index, starts from 0, and 0 means door 1
[ Example ]
Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=Wiegand
table.Wiegand[0].Mode=1
table.Wiegand[0].PulseWidth=200
Da

table.Wiegand[0].PulseStep=1000
table.Wiegand[0].TransferMode=1
hu

Respons
table.Wiegand[0].OutType=1
e
aH

table.Wiegand[1].Mode=1
table.Wiegand[0].InputType=3
table.Wiegand[0].Doors=0
TT


P

 Set Wiegand setting


AP

Table 11-19
URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
IV

Method GET
2.

Descripti
Set Wiegand setting.
89

on
[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


Wiegand array<object> R Wiegand config object
r1

+Mode int O Wiegand mode, 0 : wiegand input, 1 : wiegand output


00

…<See above getConfig command for other params of the


…<other param> — —
config object, They are all optional.>
M

[ Response Params ] ( OK )
EG

[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&Wiegand[0].Mode=1&Wie
A

Request gand[0].PulseWidth=200&Wiegand[0].PulseStep=1000&Wiegand[0].TransferMode=1&Wie
gand[0].OutType=1
Di

Respons
st

OK
e
rib

11.2.11 [Config] Access Time Schedule Setting


ut
io

The following Apis are not supported by video talk device.


n

 Get access time schedule setting


s.r

Table 11-20
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessTimeSchedul
.o

URL
e
.

Method GET
Description Get access time schedule setting.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )

Access Control APIs 252


Name Type R/O Param Description
table array<object> R config table object
+AccessTimeSc
array<object> R AccessTimeSchedule config object array
hedule
++Name string O The schedule name, max string length is 63.
++Enable bool R Whether to enable this time schedule
The time schedule array, first array has max 8 iterm, refer
Da

to 7 day in a week and last one is holiday, each item is an


array< array<
++TimeSechdule O array has max 6 time section, each time section is a string,
hu

string > >


format is “enable, hour:minite:second –
aH

hour:minite:second”, for example : "1 00:00:00-12:00:00"


[ Example ]
TT

GET
Request
http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=AccessTimeSchedule
P

table.AccessTimeSchedule[0].Name=TS1
AP

table.AccessTimeSchedule[0].Enable=true
table.AccessTimeSchedule[0].TimeSchedule[0][0]=1 00:00:00-12:00:00
Respons
IV

table.AccessTimeSchedule[0].TimeSchedule[0][1]=1 15:00:00-20:00:00
e
table.AccessTimeSchedule[0].TimeSchedule[1][0]=1 00:00:00-12:00:00
2.

table.AccessTimeSchedule[0].TimeSchedule[1][1]=1 15:00:00-20:00:00
89


 Set access time schedule setting
fo

Table 11-21
r1

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
00

Descripti
Set access time schedule setting.
M

on
[ Request Params ] ( key=value format at URL )
EG

Name Type R/O Param Description


A

AccessTimeSch
array<object> R The access time schedule config object array
edule
Di

+Name string O The schedule name, max string length is 63.


st

…<See above getConfig command for other params of the


…<other param> — —
rib

config object, They are all optional.>


[ Response Params ] ( OK )
ut

[ Example ]
io

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&AccessTimeSchedule[0].
n

Name=TS1&AccessTimeSchedule[0].Enable=true&AccessTimeSchedule[0].TimeSchedule
Request [0][0]=1%2000:00:00-12:00:00&AccessTimeSchedule[0].TimeSchedule[0][1]=1%2015:00:0
s.r

0-20:00:00&AccessTimeSchedule[0].TimeSchedule[1][0]=1%2000:00:00-12:00:00&Access
.o

TimeSchedule[0].TimeSchedule[1][1]=1%2015:00:00-20:00:00
Respons
.

OK
e

Access Control APIs 253


11.2.12 [Config] Special Day Group Setting
The following Apis are not supported by video talk device.
 Get special day group setting

Table 11-22
URL http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDayGroup
Da

Method GET
Description Get special day group setting.
hu

[ Request Params ] ( None )


aH

[ Response Params ] ( key=value format )


Name Type R/O Param Description
table object R config table object
TT

+SpecialDayGro
array<object> R SpecialDayGroup config object array
P

up
AP

++Name string O The special day group name


++Enable bool R Whether to enable this special day group
IV

++Days array<object> O The special days in group


+++SpecialDayN
2.

string O The special day name.


ame
89

+++StartTime string O The special day start datetime


+++EndTime string O The special day end datetime
fo

[ Example ]
r1

Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDayGroup


table.SpecialDayGroup[0].Name=SpecialDayGroup1
00

table.SpecialDayGroup[0].Enable=true
Respons table.SpecialDayGroup[0].Days[0].SpecialDayName=NationalDay
M

e table.SpecialDayGroup[0].Days[0].StartTime=2017-10-01 00:00:00
EG

table.SpecialDayGroup[0].Days[0].StartTime=2017-10-07 23:59:59

A

 Set special day group setting


Di

Table 11-23
st

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
rib

Method GET
Descripti
ut

Set special day group setting.


on
io

[ Request Params ] ( key=value format at URL )


n

Name Type R/O Param Description


SpecialDayGrou
s.r

array<object> R The special day group config object array


p
.o

+Name string O The special day group name


.

…<See above getConfig command for other params of the


…<other param> — —
config object, They are all optional.>
[ Response Params ] ( OK )
[ Example ]
Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&SpecialDayGroup[0].Nam

Access Control APIs 254


e=SpecialDayGroup1&SpecialDayGroup[0].Enable=true&SpecialDayGroup[0].Days[0].Spe
cialDayName=NationalDay&SpecialDayGroup[0].Days[0].StartTime=2017-10-01%2000:00:
00&SpecialDayGroup[0].Days[0].StartTime=2017-10-07%2023:59:59
Respons
OK
e

11.2.13 [Config] Special Days Schedule Setting


Da

The following Apis are not supported by video talk device.


hu

 Get special days schedule setting


aH

Table 11-24
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDaysSchedul
URL
TT

e
Method GET
P

Description Get special days schedule setting.


AP

[ Request Params ] ( None )


[ Response Params ] ( key=value format )
IV

Name Type R/O Param Description


2.

table object R config table object


89

+SpecialDaysSc
array<object> R SpecialDaysSchedule config object array
hedule
fo

++Name string O The special day schedule name


++Enable bool R Whether to enable this special day schedule
r1

The special day group number, value is the index of


++GroupNo int R
00

SpecialDayGroup setting array.


The time section array, the format of the item is “enable,
M

++TimeSection array<string> R hour:minite:second – hour:minite:second”, for example : "1


EG

00:00:00-12:00:00".
++Doors array<int> R The doors array.
A

[ Example ]
GET
Di

Request
http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDaysSchedule
st

table.SpecialDaysSchedule[0].Name=SpecialDayGroup1
rib

table.SpecialDaysSchedule[0].Enable=true
table.SpecialDaysSchedule[0].GroupNo=1
ut

Respons table.SpecialDaysSchedule[0].TimeSection[0]=1 00:00:00-12:00:00


io

e table.SpecialDaysSchedule[0].TimeSection[1]=1 15:00:00-20:00:00
n

table.SpecialDaysSchedule[0].Doors[0]=2
table.SpecialDaysSchedule[0].Doors[1]=3
s.r


.o

 Set special days schedule setting


.

Table 11-25
URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti Set special days schedule setting.

Access Control APIs 255


on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
SpecialDaysSch
array<object> R The special days schedule config object array
edule
+Name string O The special day schedule name
…<See above getConfig command for other params of the
Da

…<other param> — —
config object, They are all optional.>
[ Response Params ] ( OK )
hu

[ Example ]
aH

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&SpecialDaysSchedule[0].
Name=SpecialDayGroup1&SpecialDaysSchedule[0].Enable=true&SpecialDaysSchedule
TT

Request [0].GroupNo=1&SpecialDaysSchedule[0].TimeSection[0]=1%2000:00:00-12:00:00&Special
DaysSchedule[0].TimeSection[1]=1%2015:00:00-20:00:00&SpecialDaysSchedule[0].Doors
P

[0]=2&SpecialDaysSchedule[0].Doors[1]=3
AP

Respons
OK
e
IV

11.2.14 [Config] MeasureTemperature Setting


2.
89

The following Apis are not supported by video talk device.


 Get measure temperature setting
fo

Table 11-26
r1

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MeasureTemperatur
URL
e
00

Method GET
M

Description Get measure temperature setting.


EG

[ Request Params ] ( None )


[ Response Params ] ( key=value format )
A

Name Type R/O Param Description


table object R config table object
Di

+MeasureTempe
st

object R MeasureTemperature config object


rature
rib

++Enable bool R whether to enable measure temperature function


mask mode
ut

0: don not detect mask


++MaskOpt uint R
io

1: mask prompt
n

2: mask intercept
++OnlyTemperat whether to enable the single function, temperature
s.r

bool O
ureMode measurement
.o

++TemperatureD
bool R whether to show the temperature
.

isplay
temperature unit:{
++TemperatureU 0: centigrade
uint O
nit 1: Fahrenheit
}

Access Control APIs 256


Temperature measurement method, it can be:
0: Single chip microcomputer infrared temperature
measurement
++Type integer R 1: the thermal imaging principle of temperature
measurement
2: Temperature measurement module of Guide
3: single point temperature measurement at wrist
Da

++GuideModule
object O param of temperature measurement module of Guide
Param
hu

+++Threshold float O the temprerature threshold, unit is ℃


aH

Calibration Model, it can be:


0: indoor mode
+++CalibrationM
uint32 O 1: wall mounting mode
TT

odel
2: Gate mode
P

3: exclusive floor mode


AP

+++Correct Float O temperature correct value, unit is ℃


+++DebugModel whether tou enable debug mode of temperature
Bool O
IV

Enable measurement, show temperature on the top of face


+++HeatDisplay
2.

bool O whether to show heat


Enbale
89

+++MaxDistance uint32 O the max distance for temperature measurement, unit: cm


+++ProjectDebu
bool O whether to enable project debug mode
fo

gModel
r1

whether to show the rectangle of temperature


+++RectEnable Bool O
measurement area on the video.
00

the threshold under which the temperature value will be


+++TempRandR
Float O replaced with valid one. When threshold value is 0, the
M

eplaceThreshold
function won’t work.
EG

+++ValidTemper
float O the lower limit of valid temperature value
atureLowerLimit
A

++InfraredTemp
object O param of infrared temperature measurement
Di

eratureParam
+++Correct float O temperature correct value, unit is ℃
st

+++DebugModel whether tou enable debug mode of temperature


rib

bool O
Enable measurement, show temperature on the top of face
ut

+++MaxDistance Uint32 O the max distance for temperature measurement, unit: cm


Maximum distance for reporting high temperature events,
io

+++OverTemper In this distance, the high temperature was measured and


n

atureMaxDistanc Uint32 O reported directly. Beyond this distance, the high


s.r

e temperature was measured, it will indicates closing to the


point, and then measured again (CM)
.o

whether to show the rectangle of temperature


+++RectEnable bool O
.

measurement area on the video.


+++RetentionTi
Uint32 O temperature retention Time, unit: ms
me
+++SensorType string O sensor type in temperature measurement module

Access Control APIs 257


"90641",
"90640"
+++Threshold Uint32 O temperature threshold, unit : ℃
+++ValidTemper
Flaot O the lower limit of valid temperature value
atureLowerLimit
++ThermalImagi
object O param of thermallmaging
ngParam
Da

+++RetentionTi
Uint32 O temperature retention Time, unit: ms
me
hu

+++Threshold Uint32 O temperature threshold, unit : ℃


aH

++WristTempera
Object O param of wrist temperature measurement
tureParam
TT

+++Correct Float O temperature correct value, unit is ℃


+++InvalidTemp
Uint32 O invalid temperature measurement distance
P

eratureDistance
AP

+++Temperature
Uint32 O timeout of temperature measurement, unit: s
Timeout
IV

+++Threshold Float O temperature threshold, unit : ℃


+++ValidTemper
2.

Uint32 O valid temperature measurement distance,


atureDistance
89

+++ValidTemper
flaot O the lower limit of valid temperature value
atureLowerLimit
fo

[ Example ]
r1

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=
Request
MeasureTemperature
00

table.MeasureTemperature.Enable=true
table.MeasureTemperature.GuideModuleParam.CalibrationModel=1
M

table.MeasureTemperature.GuideModuleParam.Correct=0
EG

table.MeasureTemperature.GuideModuleParam.DebugModelEnable=false
table.MeasureTemperature.GuideModuleParam.HeatDisplayEnbale=false
A

table.MeasureTemperature.GuideModuleParam.MaxDistance=0
Di

table.MeasureTemperature.GuideModuleParam.ProjectDebugModel=false
st

table.MeasureTemperature.GuideModuleParam.RectEnable=true
table.MeasureTemperature.GuideModuleParam.TempRandReplaceThreshold=0
rib

table.MeasureTemperature.GuideModuleParam.Threshold=37.300000
ut

Respons table.MeasureTemperature.GuideModuleParam.ValidTemperatureLowerLimit=30
e table.MeasureTemperature.InfraredTemperatureParam.Correct=0
io

table.MeasureTemperature.InfraredTemperatureParam.DebugModelEnable=false
n

table.MeasureTemperature.InfraredTemperatureParam.MaxDistance=100
s.r

table.MeasureTemperature.InfraredTemperatureParam.OverTemperatureMaxDistance=100
table.MeasureTemperature.InfraredTemperatureParam.RectEnable=true
.o

table.MeasureTemperature.InfraredTemperatureParam.RetentionTime=500
.

table.MeasureTemperature.InfraredTemperatureParam.SensorType=
table.MeasureTemperature.InfraredTemperatureParam.Threshold=37.300000
table.MeasureTemperature.InfraredTemperatureParam.ValidTemperatureLowerLimit=30
table.MeasureTemperature.MaskOpt=0
table.MeasureTemperature.OnlyTemperatureMode=false

Access Control APIs 258


table.MeasureTemperature.TemperatureDisplay=true
table.MeasureTemperature.TemperatureUnit=0
table.MeasureTemperature.ThermalImagingParam.RetentionTime=30
table.MeasureTemperature.ThermalImagingParam.Threshold=60
table.MeasureTemperature.Type=3
table.MeasureTemperature.WristTemperatureParam.Correct=0
table.MeasureTemperature.WristTemperatureParam.InvalidTemperatureDistance=24
Da

table.MeasureTemperature.WristTemperatureParam.TemperatureTimeout=10
table.MeasureTemperature.WristTemperatureParam.Threshold=37.300000
hu

table.MeasureTemperature.WristTemperatureParam.ValidTemperatureDistance=5
table.MeasureTemperature.WristTemperatureParam.ValidTemperatureLowerLimit=35
aH


 Set measure temperature setting
TT

Table 11-27
P

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
AP

Method GET
Descripti
IV

Set measure temperature setting.


on
2.

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
89

MeasureTemper
object R The measure temperature config object
ature
fo

+Name string O The measure temperature name


r1

…<See above getConfig command for other params of the


…<other param> — —
config object, They are all optional.>
00

[ Response Params ] ( OK )
M

[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&MeasureTemperature.En
EG

Request able=true&MeasureTemperature.GuideModuleParam.Threshold=38.5&MeasureTemperatur
A

e.MaskOpt=2
Respons
Di

OK
e
st
rib

11.2.15 [Config] CitizenPictureCompare Setting


ut
io

 Get citizen picture compare setting


n

Table 11-28
s.r

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=CitizenPictureCompa
URL
re
.o

Method GET
.

Description Get citizen picture compare setting


[ Request Params ] ( None )
[ Response Params ] ( key=value format )
Name Type R/O Param Description

Access Control APIs 259


table object R config table object
+CitizenPictureCom
object R CitizenPictureCompare config object
pare
++Threshold uint8 R threshold of citizen picture compare, range [1, 100]
whether enable unlock
++UnlockEnable bool R if false, it won’t unlock, when citizen picture compare
succeed.
Da

++FuncEnable bool O whether to enable citizen picture comparison


++CitizenIDCheck bool O is citizen ID check supported
hu

device work mode, it can be:


aH

++SysMode string O { "FaceCollect" , "VisitorVerify", "CitizenCompare",


"CitizenIDCheck", "Other" }
TT

[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=
Request
P

CitizenPictureCompare
AP

table.CitizenPictureCompare.SysMode=CitizenCompare
table.CitizenPictureCompare.Threshold=50
IV

Respons table.CitizenPictureCompare.UnlockEnable=false
e table.CitizenPictureCompare.FuncEnable=false
2.

table.CitizenPictureCompare.CitizenIDCheck=false
89


 Set citizen picture compare setting
fo

Table 11-29
r1

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
00

Descripti
Set citizen picture compare setting
M

on
EG

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
A

CitizenPictureCo
object R CitizenPictureCompare config object
mpare
Di

…<See above getConfig command for other params of the


st

…<other param> — —
config object, They are all optional.>
rib

[ Response Params ] ( OK )
[ Example ]
ut

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&CitizenPictureCompare.S
io

ysMode= CitizenIDCheck&CitizenPictureCompare.Threshold=80&CitizenPictureCompare.
Request
n

UnlockEnable=true&CitizenPictureCompare.FuncEnable=true&CitizenPictureCompare.Citi
zenIDCheck=true
s.r

Respons
OK
.o

e
.

Access Control APIs 260


11.2.16 Sending User Information
Insert or update multiple new users. Update when the current user exists. This only applies to the
AccessUser entity here.

Table 11-30
URL http://<server>/cgi-bin/AccessUser.cgi?action=insertMulti
Da

Method POST
Description Insert person information.
hu

[ Request Params ] ( JSON format in body )


aH

Name Type R/O Param Description

UserList array<object> R User list, with up to 10 entries


TT

+UserID string R User ID


P

+UserName string O User name


AP

0: General user, by default; 1:


Blocklist user (report the blocklist
IV

+UserType uint16 O event ACBlocklist); 2: Guest user; 3:


Patrol user; 4: VIP user; 5: Disabled
2.

user
89

Limit of passing times for guest


+UseTime uint16 O
users
fo

First user authority or not. false: No;


+IsFirstEnter bool O
r1

true: Yes
+FirstEnterDoors int16[] O -1 indicates all channels.
00

+UserStatus uint16 O 0: Normal; 1: Frozen


M

+Authority uint8 O User authority (attendance machine


EG

field). 1: Admin; 2: General user


+CitizenIDNo string O ID card number
A

The password when unlocking by


Di

card + password. The password


+Password string O
st

when unlocking by User ID +


password
rib
ut

Door authority. The index in the


controller is used with
io

+Doors int16[] O
TimeSections, and the value
n

corresponds to the subscript of the


s.r

AC configuration.
The door authority corresponds to
.o

the period index. For example, door


.

+TimeSections uint16[] O 3 corresponds to period 2. Each


element corresponds to the door in
Doors.
+SpecialDaysSchedule uint32[64] O Holiday plan identification. The

Access Control APIs 261


value is the subscript number
configured by
SpecialDaysSchedule (defined in
the configuration).
"yyyy-MM-dd HH:mm:ss", start of
+ValidFrom string O validity period. Note: The original
"ValidDateStart" is deprecated.
Da

"yyyy-MM-dd HH:mm:ss", end of


+ValidTo string O validity period. Note: The original
hu

"ValidDateEnd" is deprecated.
aH

[ Response Params ] ( OK )
[ Example ]
POST http://192.168.1.108/cgi-bin/AccessUser.cgi?action=insertMulti
TT
P

{
AP

UserList[{
"UserID": "100013",
IV

"UserName": "",
"UserType": 0,
2.

"UseTime": 1,
89

"IsFirstEnter": true,
"FirstEnterDoors": [0, 1],
fo

Request "UserStatus": 0,
r1

"Authority": 1,
"CitizenIDNo": "123456789012345678",
00

"Password": "xxxxxxxxxx",
"Doors": [1,3,5,7],
M

"TimeSections": [1,2,3,4],
EG

"SpecialDaysSchedule": [1,2],
"ValidFrom": "2018-01-02 00:00:00",
A

"ValidTo": "2018-01-02 01:00:00",


Di

} ,…,{}]
}
st

Response OK
rib

11.2.17 Updating User Information


ut
io

Update information of multiple users.


n

Table 11-31
s.r

URL http://<server>/cgi-bin/AccessUser.cgi?action=updateMulti
Method POST
.o

Description Update person information.


.

[ Request Params ] ( JSON format in body )


Name Type R/O Param Description

UserList array<object> R User list, with up to 10 entries

Access Control APIs 262


+ UserID string R User ID
+UserName string O User name
0: General user, by default; 1:
Blocklist user (report the blocklist
+UserType uint16 O event ACBlocklist); 2: Guest user;
3: Patrol user; 4: VIP user; 5:
Disabled user
Da

Limit of passing times for guest


+UseTime uint16 O
users
hu

First user authority or not. false:


+IsFirstEnter bool O
aH

No; true: Yes


+FirstEnterDoors int16[] O -1 indicates all channels.
+UserStatus uint16 O 0: Normal; 1: Frozen
TT
P

+Authority uint8 O User authority (attendance machine


AP

field). 1: Admin; 2: General user


+CitizenIDNo string O ID card number
IV

The password when unlocking by


card + password. The password
2.

+Password string O
when unlocking by User ID +
89

password
fo

Door authority. The index in the


r1

controller is used with


+Doors int16[] O
TimeSections, and the value
00

corresponds to the subscript of the


AC configuration.
M

The door authority corresponds to


EG

the period index. For example, door


+TimeSections uint16[] O 3 corresponds to period 2. Each
A

element corresponds to the door in


Di

Doors.
Holiday plan identification. The
st

value is the subscript number


rib

+SpecialDaysSchedule uint32[64] O configured by


SpecialDaysSchedule (defined in
ut

the configuration).
io

"yyyy-MM-dd HH:mm:ss", start of


n

+ValidFrom string O validity period. Note: The original


s.r

"ValidDateStart" is deprecated.
"yyyy-MM-dd HH:mm:ss", end of
.o

+ValidTo string O validity period. Note: The original


.

"ValidDateEnd" is deprecated.
[ Response Params ] ( OK )
[ Example ]

Access Control APIs 263


POST http://192.168.1.108/cgi-bin/AccessUser.cgi?action=insertMulti

{
UserList[{
"UserID": "100013",
"UserName": "",
"UserType": 0,
Da

"UseTime": 1,
"IsFirstEnter": true,
hu

"FirstEnterDoors": [0, 1],


Request "UserStatus": 0,
aH

"Authority": 1,
"CitizenIDNo": "123456789012345678",
TT

"Password": "xxxxxxxxxx",
P

"Doors": [1,3,5,7],
"TimeSections": [1,2,3,4],
AP

"SpecialDaysSchedule": [1,2],
IV

"ValidFrom": "2018-01-02 00:00:00",


"ValidTo": "2018-01-02 01:00:00",
2.

} ,…,{}]
89

Response OK
fo

11.2.18 Deleting All User Information


r1
00

Delete all user information.


M

Table 11-32
URL http://<server>/cgi-bin/AccessUser.cgi?action=removeAll
EG

Method GET
Description Clear information of all persons.
A

[ Request Params ] ( key=value format at URL )


Di

Name Type R/O Param Description


st

[ Response Params ] ( OK )
rib

[ Example ]
ut
io

Request GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=removeAll


n
s.r
.o

Response OK
.

11.2.19 Deleting Information of Multiple Users


Delete information of multiple users.

Access Control APIs 264


Table 11-33
URL http://<server>/cgi-bin/AccessUser.cgi?action=removeMulti
Method GET
Description Delete user data.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Da

UserIDList array<string> R User ID list, with up to 10 entries

[ Response Params ] ( OK )
hu

[ Example ]
aH
TT

GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=removeMulti&UserIDList[0]=102&
Request
UserIDList [1]=102
P
AP
IV

Respons
OK
e
2.
89

11.2.20 Searching for Information of Multiple Users


fo

Search for information of multiple users.


r1

Table 11-34
URL http://<server>/cgi-bin/AccessUser.cgi?action=list
00

Method GET
M

Description Search for user data.


[ Request Params ] ( key=value format at URL )
EG

Name Type R/O Param Description


A

UserIDList array<string> R User ID list, with up to 10 entries


[ Response Params ]
Di

Users array<object> R The records that returned


st

+ UserID string R User ID


rib

+UserName string O User name


0: General user, by default; 1:
ut

Blocklist user (report the blocklist


io

+UserType uint16 O event ACBlocklist); 2: Guest user;


n

3: Patrol user; 4: VIP user; 5:


Disabled user
s.r

Limit of passing times for guest


+UseTime uint16 O
.o

users
First user authority or not. false:
.

+IsFirstEnter bool O
No; true: Yes
+FirstEnterDoors int16[] O -1 indicates all channels
+UserStatus uint16 O 0: Normal; 1: Frozen
+Authority uint8 O

Access Control APIs 265


User authority (attendance
machine field). 1: Admin;
2: General user
+CitizenIDNo string O ID card number
The password when unlocking by
card + password. The password
+Password string O
when unlocking by UserID +
Da

password
hu

Door authority. The index in the


aH

controller is used with


+Doors int16[] O
TimeSections, and the value
corresponds to the subscript of the
TT

AC configuration.
P

The door authority corresponds to


AP

the period index. For example,


+TimeSections uint16[] O door 3 corresponds to period 2.
IV

Each element corresponds to the


door in Doors.
2.

Holiday plan identification. The


89

value is the subscript number


+SpecialDaysSchedule uint32[64] O configured by
fo

SpecialDaysSchedule (defined in
r1

the configuration).
"yyyy-MM-dd HH:mm:ss", start of
00

+ValidFrom string O validity period. Note: The original


"ValidDateStart" is deprecated.
M

"yyyy-MM-dd HH:mm:ss", end of


EG

+ValidTo string O validity period. Note: The original


"ValidDateEnd" is deprecated.
A

[ Example ]
Di
st
rib

GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=list&UserIDList[0]=102&UserIDList
Request
[1]=102
ut
io
n

Users[0].UserID=100013
Users[0].UserName=Name
s.r

Users[0].UserType=1
.o

Users[0].UseTime=1
Respons
.

Users[0].IsFirstEnter=ZhangSan
e
Users[0].FirstEnterDoors=0
Users[0].UserStatus=12345678
Users[0].Authority=1
Users[0].CitizenIDNo=1

Access Control APIs 266


Users[0].Password=ZhangSan
Users[0].Doors=0
Users[0].TimeSections=12345678
Users[0].SpecialDaysSchedule=1
Users[0].ValidFrom=1
records[0].ValidTo=ZhangSan

Da

11.2.21 Sending Information of Multiple Card Numbers


hu

Send information of multiple card numbers.


aH

Table 11-35
TT

URL http://<server>/cgi-bin/AccessCard.cgi?action=insertMulti
Method POST
P

Description Insert card number information.


AP

[ Request Params ] ( JSON format in body )


Name Type R/O Param Description
IV

CardList array<object> R User list, with up to 10 entries


2.
89

+CardNo string R Card No.


+UserID string R User ID
fo

Card type
r1

Enumint{
0: Ordinary card
00

1: VIP card
+CardType uint16 O
2: Guest card
M

3: Patrol card
EG

4: Blocklist card
5: Duress card
A

+CardName string O Card name


Di

Card status. Different card status results in


different person status.
st

0: Normal
rib

1<<0: Reported for loss


+CardStatus uint32 O
1<<1: Canceled
ut

1<<2: Frozen
io

1<<3: Arrearage
n

1<<4: Overdue
[ Response Params ] ( OK )
s.r

[ Example ]
.o
.

Access Control APIs 267


POST http://192.168.1.108/cgi-bin/AccessCard.cgi?action=insertMulti

{
CardList[{
"UserID" : "100013"
Request "CardNo" : ""
"CardType" : 0
Da

"CardName" : "201 - Xiao Wang"


"CardStatus" : 0
hu

} ,…,{}]
}
aH

Response OK
TT

11.2.22 Updating Information of Multiple Card Numbers


P
AP

Update information of multiple card numbers.

Table 11-36
IV

URL http://<server>/cgi-bin/AccessCard.cgi?action=updateMulti
2.

Method POST
Description Update card number information.
89

[ Request Params ] ( JSON format in body )


Name Type R/O Param Description
fo

CardList array<object> R User list, with up to 10 entries


r1

+CardNo string R Card No.


+UserID string R User ID
00

Card type
M

Enumint{
0: Ordinary card
EG

1: VIP card
+CardType uint16 O
A

2: Guest card
3: Patrol card
Di

4: Blocklist card
st

5: Duress card
rib

+CardName string O Card name


Card status. Different card status results in
ut

different person status.


io

0: Normal
1<<0: Reported for loss
n

+CardStatus uint32 O
1<<1: Canceled
s.r

1<<2: Frozen
1<<3: Arrearage
.o

1<<4: Overdue
.

[ Response Params ] ( OK )
[ Example ]

Access Control APIs 268


POST ttp://192.168.1.108/cgi-bin/AccessCard.cgi?action=updateMulti

{
CardList[{
"UserID" : "100013"
Request "CardNo" : ""
"CardType" : 0
Da

"CardName" : "201 - Xiao Wang"


"CardStatus" : 0
hu

} ,…,{}]
}
aH

Response OK
TT

11.2.23 Removing All Card Number Information


P
AP

Remove all card number information.

Table 11-37
IV

URL http://<server>/cgi-bin/AccessCard.cgi?action=removeAll
2.

Method GET
Description Clear all card information.
89

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
fo

[ Response Params ] ( OK )
r1

[ Example ]
00
M

Request GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=removeAll


EG
A
Di

Response OK
st

11.2.24 Removing Information of Multiple Card Numbers


rib
ut

Remove information of multiple card numbers.


io

Table 11-38
n

URL http://<server>/cgi-bin/AccessCard.cgi?action=removeMulti
s.r

Method GET
Description Delete card number data.
.o

[ Request Params ] ( key=value format at URL )


.

Name Type R/O Param Description


User card number list, with up to
CardNoList array<string> R
10 entries
[ Response Params ] ( OK )

Access Control APIs 269


[ Example ]

Reque GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=removeMulti&CardNoList[0]=12345


st 678&CardNoList[1]=12345687
Da

Respo
hu

OK
nse
aH

11.2.25 Searching for Information of Multiple Card Numbers


TT

Search for information of multiple card numbers.


P

Table 11-39
AP

URL http://<server>/cgi-bin/AccessCard.cgi?action=list
Method GET
IV

Description Search for card number data.


2.

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
89

CardNoList array<string> R User ID list, with up to 10 entries


[ Response Params ]
fo

records array<object> R The records that returned.


r1

+CardNo string R Card No.


+UserID string R User ID
00

Card type
M

Enumint{
0: Ordinary card
EG

1: VIP card
+CardType uint16 O
A

2: Guest card
3: Patrol card
Di

4: Blocklist card
st

5: Duress card
rib

+CardName string O Card name


Card status. Different card status
ut

results in different person status.


io

0: Normal
1<<0: Reported for loss
n

+CardStatus uint32 O
1<<1: Canceled
s.r

1<<2: Frozen
.o

1<<3: Arrearage
1<<4: Overdue
.

[ Example ]

Access Control APIs 270


GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=list&CardNoList
Request
[0]=102&CardNoList[1]=102
Da

Cards[0].CardNo=12345678
Cards[0].UserID=1
hu

Cards[0].CardType=1
Cards[0].CardName=ZhangSan
aH

Cards[0].CardStatus=0

TT

Response
Cards[1].CardNo=12345679
P

Cards[1].UserID=2
Cards[1].CardType=1
AP

Cards[1].CardName=LiSi
IV

Cards[1].CardStatus=0

2.
89

11.2.26 Sending Face Information


fo

Insert multiple face information.


r1

Table 11-40
URL http://<server>/cgi-bin/AccessFace.cgi?action=insertMulti
00

Method POST
M

Description Insert face information.


[ Request Params ] ( JSON format in body )
EG

Name Type R/O Param Description


FaceList array<object> R Face list, with up to 10 entries
A

+UserID string R User ID


Di

Base64 of red light face templates, 8192


+FaceData array<string> O
st

Bytes/per face, maximum 20.


rib

Base64 of white light face images,


+PhotoData array<string> O
200kx5.
ut

Either cloud storage URL of white light


face images or PhotoData. If PhotoData
io

+PhotoURL array<string> O exists, this field is invalid when it is subject


n

to PhotoData. Only HTTP URL is available


s.r

now.
[ Response Params ] ( OK )
.o

[ Example ]
.

Access Control APIs 271


POST http://192.168.1.108/cgi-bin/AccessFace.cgi?action=insertMulti

{
“FaceList”:[
{
"UserID": "102",
Request "FaceData": [ "xxxx", "xxxx", … ],
Da

"PhotoData": [ "yyyy", "yyyy", … ],


" PhotoURL": [ "yyyy", "yyyy", … ],
hu

},
….
aH

]
}
TT

Response OK
P

11.2.27 Updating Face Information


AP
IV

Update multiple face information.


2.

Table 11-41
URL http://<server>/cgi-bin/AccessFace.cgi?action=updateMulti
89

Method POST
Description Update face information.
fo

[ Request Params ] ( JSON format in body )


r1

Name Type R/O Param Description


FaceList array<object> R Face list, with up to 10 entries
00

+UserID string R User ID


M

Base64 of red light face templates, 8192


+FaceData array<string> O
Bytes/per face, maximum 20.
EG

Base64 of white light face images,


+PhotoData array<string> O
A

200kx5.
Either cloud storage URL of white light
Di

face images or PhotoData. If PhotoData


st

+PhotoURL array<string> O exists, this field is invalid when it is subject


rib

to PhotoData. Only HTTP URL is available


now.
ut

[ Response Params ] ( OK )
io

[ Example ]
POST http://192.168.1.108/cgi-bin/AccessFace.cgi?action=updateMulti
n
s.r

{
.o

“FaceList”:[
Request {
.

"UserID": "102",
"FaceData": [ "xxxx", "xxxx", … ],
"PhotoData": [ "yyyy", "yyyy", … ],
" PhotoURL": [ "yyyy", "yyyy", … ],

Access Control APIs 272


},
….
]
}
Da

Response OK
hu

11.2.28 Deleting All Face Information


aH

Delete all face information.


TT

Table 11-42
URL http://<server>/cgi-bin/AccessFace.cgi?action=removeAll
P

Method GET
AP

Description Clear all face information.


[ Request Params ] ( key=value format at URL )
IV

Name Type R/O Param Description


2.

[ Response Params ] ( OK )
[ Example ]
89
fo
r1

Request GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=removeAll


00
M

Response OK
EG

11.2.29 Deleting Multiple Face Information


A
Di

Delete multiple face information.


st

Table 11-43
rib

URL http://<server>/cgi-bin/AccessFace.cgi?action=removeMulti
Method GET
ut

Description Delete face data.


io

[ Request Params ] ( key=value format at URL )


n

Name Type R/O Param Description


s.r

User card number list, with up to


UserIDList array<string> R
10 entries
.o

[ Response Params ] ( OK )
.

[ Example ]

Access Control APIs 273


GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=removeMulti&
Request
UserIDList[0]=101&UserIDList[1]=102
Da

Response OK
hu

11.2.30 Searching for Multiple Face Information


aH

Search for multiple face information.


TT

Table 11-44
URL http://<server>/cgi-bin/AccessFace.cgi?action=list
P

Method GET
AP

Description Search for user face data.


[ Request Params ] ( key=value format at URL )
IV

Name Type R/O Param Description


2.

UserIDList array<string> R User ID list, with up to 10 entries


89

[ Response Params ]
FaceDataList array<object> R The records that returned.
fo

+UserID string R User ID


r1

Base64 of red light face


+FaceData array<string> O templates, 8192 Bytes/per face,
00

maximum 20.
M

Base64 of white light face


+PhotoData array<string> O
images, 200kx5.
EG

Either cloud storage URL of white


A

light face images or PhotoData. If


PhotoData exists, this field is
Di

+PhotoURL array<string> O
invalid when it is subject to
st

PhotoData. Only HTTP URL is


rib

available now.
[ Example ]
ut
io
n

GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=list&UserIDList
Request
s.r

[0]=1&UserIDList[1]=2
.o
.

FaceDataList[0].UserID=1
FaceDataList[0].PhotoData=[ "xxxx", "xxxx", … ],
Response
FaceDataList[0].FaceData=[ "xxxx", "xxxx", … ],

Access Control APIs 274


FaceDataList[1].UserID=2
FaceDataList[1].PhotoData=[ "xxxx", "xxxx", … ],
FaceDataList[1].FaceData=[ "xxxx", "xxxx", … ],

11.2.31 Sending Fingerprint Information


Da

Insert multiple fingerprint information.


hu

Table 11-45
URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=insertMulti
aH

Method POST
Description Insert fingerprint information.
TT

[ Request Params ] ( JSON format in body )


Name Type R/O Param Description
P

vecPackets array<string> R Fingerprint feature data


AP

AccessFingerprints array<object> R Fingerprint list, with up to 1 entry


+UserID string R User ID
IV

+FingerprintPacket object R Send fingerprint information list.


2.

++Length uint32 R Length of a single fingerprint package


89

++Count uint32 R Number of fingerprint packages


Either cloud storage URL of fingerprint
fo

data or Length. If the Length exists and is


++DataURL array<string> O not 0, this field is invalid when it is subject
r1

to Length. Only HTTP URL is available


00

now.
Duress fingerprint number, with a value
M

range of [1, count]. This field is invalid if


EG

++DuressIndex Uint8 R the value is illegal. That is, there is no


duress fingerprint. For example, 0
A

indicates no duress fingerprint.


[ Response Params ] ( OK )
Di

[ Example ]
st

POST http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=insertMulti
rib

{
ut

“vecPackets“: [ "xxxx", "xxxx", … ],


io

“AccessFingerprints”:[
{
n

"UserID": "102",
s.r

Request
"FingerprintPacket" :
.o

{
"Length" : 810,
.

"Count" : 3,
"DuressIndex" : 2
}
}

Access Control APIs 275


]
}
Da

Response OK
hu

11.2.32 Updating Fingerprint Information


aH

Update multiple fingerprint information.


TT

Table 11-46
URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=updateMulti
P

Method POST
AP

Description Update fingerprint information.


[ Request Params ] ( JSON format in body )
IV

Name Type R/O Param Description


2.

vecPackets array<string> R Binary fingerprint data (Binary Data).


AccessFingerprints array<object> R Fingerprint list, with up to 1 entry
89

+UserID string R User ID


fo

+FingerprintPacket object R Send fingerprint information list.


++Length uint32 R Length of a single fingerprint package
r1

++Count uint32 R Number of fingerprint packages


Either cloud storage URL of fingerprint
00

data or Length. If the Length exists and is


M

++DataURL array<string> O not 0, this field is invalid when it is subject


to Length. Only HTTP URL is available
EG

now.
A

Duress fingerprint number, with a value


range of [1, count]. This field is invalid if
Di

++DuressIndex Uint8 R the value is illegal. That is, there is no


st

duress fingerprint. For example, 0


rib

indicates no duress fingerprint.


[ Response Params ] ( OK )
ut

[ Example ]
io

POST http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=updateMulti
n

{
s.r

“vecPackets“: [ "xxxx", "xxxx", … ],


.o

“AccessFingerprints”:[
Request
{
.

"UserID": "102",
"FingerprintPacket" :
{
"Length" : 810,

Access Control APIs 276


"Count" : 3,
"DuressIndex" : 2
}
}
]
}
Da

Response OK
hu

11.2.33 Deleting All Fingerprint Information


aH

Delete all fingerprint information.


TT

Table 11-47
URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=removeAll
P

Method GET
AP

Description Clear all fingerprint information.


[ Request Params ] ( key=value format at URL )
IV

Name Type R/O Param Description


2.

[ Response Params ] ( OK )
[ Example ]
89
fo
r1

Request GET http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=removeAll


00
M

Response OK
EG

11.2.34 Deleting Fingerprint Information


A
Di

Delete fingerprint information.


st

Table 11-48
rib

URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=removeMulti
Method GET
ut

Description Delete fingerprint data.


io

[ Request Params ] ( key=value format at URL )


n

Name Type R/O Param Description


s.r

User card number list, with up to 1


UserIDList array<string> R
entry
.o

[ Response Params ] ( OK )
.

[ Example ]

Access Control APIs 277


GET http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=removeMulti&
Request
UserIDList[0]=101&UserIDList[1]=102
Da

Response OK
hu

11.2.35 Searching for Fingerprint Information


aH

Search for user fingerprint information.


TT

Table 11-49
URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=get
P

Method GET
AP

Description Search for user fingerprint information.


[ Request Params ] ( key=value format at URL )
IV

Name Type R/O Param Description


2.

UserID string R User ID list, with up to 1 entry


89

[ Response Params ]
Binary fingerprint data (Binary
fo

FingerprintData BinaryData R
Data).
r1

FingerprintPacket object R Description of fingerprint data


Length of a single fingerprint
00

+Length uint32 R
package
M

+Count uint32 R Number of fingerprint packages


Either cloud storage URL of
EG

fingerprint data or Length. If the


A

Length exists and is not 0, this


+DataURL array<string> O
field is invalid when it is subject to
Di

Length. Only HTTP URL is


st

available now.
rib

Duress fingerprint number, with a


value range of [1, count]. This
ut

field is invalid if the value is


+DuressIndex Uint8 R
io

illegal. That is, there is no duress


fingerprint. For example, 0
n

indicates no duress fingerprint.


s.r

[ Example ]
.o
.

Access Control APIs 278


Request GET http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=get&UserID=1
Da

FingerprintPacket.Length=810
FingerprintPacket.Count=3
hu

Response
FingerprintPacket.DuressIndex=1
FingerprintData=xxx
aH

11.2.36 Starting Searching for User Related Information


TT
P

Start searching for user related information.


AP

Table 11-50
URL http://<server>/cgi-bin/AccessUser.cgi?action=startFind
IV

Method GET
2.

Description Start searching for user related information.


[ Request Params ] ( key=value format at URL )
89

Name Type R/O Param Description


Search conditions. Users can
fo

perform conditional search


r1

Condition object R
according to the user information
field.
00

+UserID string O User ID


M

+UserName string O User name


0: General user, by default; 1:
EG

Blocklist user (report the blocklist


A

+UserType uint16 O event ACBlocklist); 2: Guest user;


3: Patrol user; 4: VIP user; 5:
Di

Disabled user
st

Limit of passing times for guest


+UseTime uint16 O
rib

users
First user authority or not. false:
+IsFirstEnter bool O
ut

No; true: Yes


io

+FirstEnterDoors int16[] O -1 indicates all channels.


+UserStatus uint16 O 0: Normal; 1: Frozen
n

User authority (attendance


s.r

+Authority uint8 O machine field). 1: Admin;


.o

2: General user
+CitizenIDNo string O ID card number
.

The password when unlocking by


card + password. The password
+Password string O
when unlocking by UserID +
password

Access Control APIs 279


Door authority. The index in the
controller is used with
+Doors int16[] O TimeSections, and the value
corresponds to the subscript of
the AC configuration.
The door authority corresponds to
the period index. For example,
Da

+TimeSections uint16[] O door 3 corresponds to period 2.


Each element corresponds to the
hu

door in Doors.
aH

Holiday plan identification. The


value is the subscript number
+SpecialDaysSchedule uint32[64] O configured by
TT

SpecialDaysSchedule (defined in
P

the configuration).
AP

"yyyy-MM-dd HH:mm:ss", start of


+ValidFrom string O validity period. Note: The original
IV

"ValidDateStart" is deprecated.
"yyyy-MM-dd HH:mm:ss", end of
2.

+ValidTo string O validity period. Note: The original


89

"ValidDateEnd" is deprecated.
[ Response Params ]
fo

Token uint32 R Search token.


r1

Total number of entries found this


Total uint32 R
time
00

Search capability: Maximum


Caps uint32 R number of records that can be
M

returned each time.


EG

[ Example ]
A
Di

Request GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=startFind&Condition.UserID=1


st
rib
ut

{
io

"Token": 1234,
n

Response "Total": 20,


"Caps ": 20
s.r

}
.o

11.2.37 Getting User Related Information


.

Get user related information.

Table 11-51

Access Control APIs 280


URL http://<server>/cgi-bin/AccessUser.cgi?action=doFind
Method GET
Description Get user related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

Token int R Search token


Da

Offset int R Offset


hu

Count int R Number of entries obtained this time


aH

[ Response Params ]
TT

info array<object> R Person information


[ Example ]
P
AP
IV

GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=doFind&Token=1234&Offset=0&C
Request
ount=20
2.
89
fo

{ "Info": [ {
r1
00

"UserID": "102",
Respons

M

e
}, { … }, … ]
EG
A

}
Di
st

11.2.38 Stopping Searching for User Related Information


rib

Get user related information.


ut

Table 11-52
io

URL http://<server>/cgi-bin/AccessUser.cgi?action=stopFind
n

Method GET
s.r

Description Get user related information.


[ Request Params ] ( key=value format at URL )
.o

Name Type R/O Param Description


.

Token int R Search token.

[ Response Params ](OK)


[ Example ]

Access Control APIs 281


Request GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=stopFind&Token=1234
Da

Response OK
hu

11.2.39 Starting Searching for Card Number Related


aH

Information
TT

Start searching for card number related information.


P

Table 11-53
AP

URL http://<server>/cgi-bin/ AccessCard.cgi?action=startFind


Method GET
IV

Description Start searching for card number related information.


2.

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
89

Search conditions. Users can


perform conditional search
fo

Condition object R
according to the user information
r1

field.
+UserID string O User ID
00

+CardNo string O User card number


M

Card type
Enumint{
EG

0: Ordinary card
A

1: VIP card
+CardType uint16 O
2: Guest card
Di

3: Patrol card
st

4: Blocklist card
rib

5: Duress card
+CardName string O Card name
ut

Card status Different card status


results in different person status.
io

0: Normal
n

1<<0: Reported for loss


s.r

+CardStatus uint32 O
1<<1: Canceled
1<<2: Frozen
.o

1<<3: Arrearage
.

1<<4: Overdue
[ Response Params ]
Token uint32 R Search token.
Total uint32 R Total number of entries found this

Access Control APIs 282


time
Search capability: Maximum
Caps uint32 R number of records that can be
returned each time.
[ Example ]
Da

Request GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=startFind&Condition.UserID=1


hu
aH
TT

{
P

"Token": 1234,
AP

Response "Total": 20,


IV

"Caps ": 20
2.

}
89

11.2.40 Getting Card Number Related Information


fo

Get card number related information.


r1

Table 11-54
00

URL http://<server>/cgi-bin/AccessCard.cgi?action=doFind
Method GET
M

Description Get card number related information.


EG

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
A

Token int R Search token.


Di
st

Offset int R Offset


rib

Number of entries obtained this


Count int R
time
ut

[ Response Params ]
io

info array<object> R Person information


n

[ Example ]
s.r
.o

GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=doFind&Token=1234&Offset=0&C
.

Request
ount=20

Access Control APIs 283


{ "Info": [ {

"UserID": "102",
Respons
e …
Da

}, { … }, … ]
hu

}
aH

11.2.41 Stopping Searching for Card Number Related


TT

Information
P
AP

Stop searching for card number related information.


IV

Table 11-55
URL http://<server>/cgi-bin/AccessCard.cgi?action=stopFind
2.

Method GET
89

Description Stop searching for card number related information.


[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


r1

Token int R Search token.


00

[ Response Params ](OK)


[ Example ]
M
EG
A

Request GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=stopFind&Token=1234


Di
st
rib

Response OK
ut

11.2.42 Starting Searching for Face Related Information


io
n

Start searching for face related information.


s.r

Table 11-56
URL http://<server>/cgi-bin/AccessFace.cgi?action=startFind
.o

Method GET
.

Description Start searching for face related information.


[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

Access Control APIs 284


Search conditions. Users can
perform conditional search
Condition object R
according to the user information
field.
+UserID string O User ID
[ Response Params ]
Token uint32 R Search token.
Da

Total number of entries found this


Total uint32 R
time
hu

Search capability: Maximum


aH

Caps uint32 R number of records that can be


returned each time.
[ Example ]
TT
P
AP

Request GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=startFind&Condition.UserID=1


IV
2.
89

{
fo

"Token": 1234,
r1

Response "Total": 20,


00

"Caps ": 20
M

}
EG

11.2.43 Getting Face Related Information


A

Get face related information.


Di

Table 11-57
st

URL http://<server>/cgi-bin/AccessFace.cgi?action=doFind
rib

Method GET
Description Get face related information.
ut

[ Request Params ] ( key=value format at URL )


io

Name Type R/O Param Description


n

Token int R Search token.


s.r
.o

Offset int R Offset


.

Number of entries obtained this


Count int R
time
[ Response Params ]
info array<object> R Person information

Access Control APIs 285


[ Example ]

GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=doFind&Token=1234&Offset=0&C
Request
ount=20
Da
hu

{ "Info": [ {
aH

"UserID": "102",
TT

Respons
e …
P

}, { … }, … ]
AP
IV

}
2.

11.2.44 Stopping Searching for Face Related Information


89

Stop searching for face related information.


fo
r1

Table 11-58
00

URL http://<server>/cgi-bin/AccessFace.cgi?action=stopFind
Method GET
M

Description Stop searching for face related information.


EG

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
A

Token int R Search token.


Di

[ Response Params ](OK)


st

[ Example ]
rib
ut
io

Request GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=stopFind&Token=1234


n
s.r
.o

Response OK
.

Access Control APIs 286


12 Intelligent Building APIs
12.1 Video Talk
Da

The following Apis are supported by VTT / VTA products.


hu

12.1.1 Subscribe Video Talk Status


aH

Table 12-1
TT

Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=attachState
Method GET
P

Description Subscribe the video talk status. When client disconnect, it will unsubscribe.
AP

Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=attachState
Notify the state:
IV
2.

SID=315
state.State=Answer
89

state.Talkback.Pack=RTP
state.Talkback.Protocol=UDP
fo

state.Talkback.Type=Talk
r1

state.Talkback.Audio.AudioPort=6000
state.Talkback.Audio.Format[0].Compression=PCM
00

Success state.Talkback.Audio.Format[0].Frequency=44000
M

Return state.Talkback.Audio.Format[0].Depth=16
state.Talkback.Audio.Format[1].Compression=G.711A
EG

state.Talkback.Audio.Format[1].Frequency=44000
state.Talkback.Audio.Format[1].Depth=16
A

state.Talkback.Video.VideoPort=7000
Di

state.Talkback.Video.Format[0].Compression=H.264
st

state.Talkback.Video.Format[0].Frequency=90000
state.Talkback.Video.Format[1].Compression=MJPG
rib


ut

state.Talkback. MediaAddr=224.10.10.10
Parameters in Response:
io

Comment State: in range of {"Ringing", "Inviting", "Answer", "Refuse", "Cancel", "Hangup",


n

"Busying" }
s.r

12.1.2 Unsubscribe Video Talk Status


.o
.

Table 12-2
Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=detachState&SID=<sid>
Method GET
Description Unsubscribe the video talk status.

Intelligent Building APIs 287


Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=detachState&SID=101
Success
OK
Return
Parameters in URL:
Comment
sid: the subscribe id, which is the response of attachState

12.1.3 Invite Server on Video Talk


Da

Table 12-3
hu

http://<server>/cgi-bin/VideoTalkPeer.cgi?action=invite[&Talkback.Protocol=<protocol>
Syntax
aH

&Talkback.Type=<type>&Talkback.MediaAddr=<addr>…]
Method GET
Description Start the video talk conversation.
TT

http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=invite&Talkback.Protocol=UDP&
Example
P

Talkback.Type=Talk&Talkback.MediaAddr=224.10.10.10
AP

Success
OK
Return
IV

Parameters in URL:
protocol: the transmit protocol
2.

Comment
type: video talk type.
89

addr: addr to get stream


fo

12.1.4 Cancel the Video Talk


r1

Table 12-4
00

Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=cancel
Method GET
M

Description Cancel video talk conversation.


EG

Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=cancel
Success
A

OK
Return
Di

Comment —
st

12.1.5 Answer the Invitation


rib
ut

Table 12-5
http://<server>/cgi-bin/VideoTalkPeer.cgi?action=answer&Talkback.Protocol=<protoco
io

Syntax
l>&Talkback.Type=<type>&Talkback.MediaAddr=<addr>…
n

Method GET
s.r

Description Answer the call.


http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=answer&Talkback.Protocol=UDP
.o

Example
&Talkback.Type=Talk&Talkback.MediaAddr=224.10.10.10
.

Success
OK
Return
Parameters in URL:
Comment
protocol: the transmit protocol

Intelligent Building APIs 288


type: video talk type.
addr: addr to get stream

12.1.6 Refuse to Answer the Video Talk Invitation


Table 12-6
Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=refuse
Da

Method GET
Description Refuse answer the call.
hu

Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=refuse
aH

Success
OK
Return
TT

Comment —
P

12.1.7 Hang Up
AP

Table 12-7
IV

Syntax http://<server>/cgi-bin/VideoTalkPeer.cgi?action=hangup
Method GET
2.

Description Close it when the conversation is over.


89

Example http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=hangup
Success
fo

OK
Return
r1

Comment —
00

12.2 Video Talk Log


M

The following Apis are supported by VTO products.


EG

12.2.1 Query Video Talk Log


A
Di

Table 12-8
st

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog[&condition.C
Syntax
allType=<Type>&condition.EndState=<State>&count=<countNo>]
rib

Method GET
ut

Description Find the VideoTalkLog record.


http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog&conditi
io

Example
on.CallType=Incoming&condion.EndState=Missed&count=500
n

totalCount=1000
s.r

found=500
records[0].RecNo=789
.o

Success records[0].CreateTime=123456789
.

Return records[0].CallType=Incoming
records[0].EndState=Received
records[0].PeerNumber=501

Intelligent Building APIs 289


Parameters in URL:
Type: call type
State: end state of the call
countNo: the number of records to get

Comment
Parameters in Response :
totalCount : the record count which match condition
Da

found : the record count to return


CallType: call type. The range is {"Incoming", "Outgoing"}.
hu

EndState: the range is {"Missed" , "Received"}


aH

12.3 Announcement Record


TT

The following Apis are supported by VTO products.


P

12.3.1 Insert Record


AP
IV

Table 12-9
http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=Announcement&Conten
2.

Syntax t=<Content>&ExpirTime=<ExpirTime>&IssueTime=<IssueTime>&Title=<Title>&User
89

=<User>&State=<State>&ReadFlag=<ReadFlag>
Method GET
fo

Description Insert the Announcement record.


r1

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=Announcement&C
Example ontent=stringData&ExpirTime=2012-01-01%2012:00:00&IssueTime=2012-01-01%201
00

2:00:00&Title=Anounce1&User=101&State=0&ReadFlag=0
Success
M

RecNo=<RecNo>
Return
EG

Parameters in URL:
Content: Announcement Content
A

ExpirTime: the time when the Announcement expire, format: 2012-01-01%2012:00:00


Di

IssueTime: Announcement issue time, format: 2012-01-01%2012:00:00


Title: title of the announcement
st

Comment
User: the number the Announcement issued to
rib

State: the state of the Announcement. 0 init, 1 send , 2 overdue


ReadFlag: the read flag. 0 not read, 1 read.
ut

Parameters in Response :
io

RecNo: the record index of the new record


n

12.4 Alarm Record


s.r
.o

12.4.1 Query Alarm Record


.

Table 12-10
http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AlarmRecord[&StartTime=<
Syntax
startTime>&EndTime=<endTime>&count=<countNo>]

Intelligent Building APIs 290


Method GET
Description Find the AlarmRecord record. ( This api is supported by video talk device. )
http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AlarmRecord&StartTi
Example
me=2014-8-25%2000:02:32&EndTime=2014-8-25%2001:02:32&count=500
totalCount=1000
found=500
records[0].RecNo=789
Da

records[0].CreateTime=123456789
Success records[0].Channel=0
hu

Return records[0].SenseMethod=DoorMagnetism
aH

records[0].RoomNumber=501
records[0].ReadFlag=0
records[0].Comment=Friend
TT


P

Parameters in URL:
AP

startTime: The start time ,format : 2014-8-25%2000:01:32


endTime: The end time, format: 2014-8-25%2000:02:32
IV

countNo: the number of records to get, The record count, default 1024
2.

Comment Parameters in Response :


89

totalCount : the record count which match condition


found : the record count to return
fo

SenseMethod :the range is { "DoorMagnetism", "PassiveInfrared", "GasSensor",


"SmokingSensor", "WaterSensor", "ActiveInfrared", "CallButton", "UrgencyButton",
r1

"Steal", "Perimeter", "PreventRemove", "DoorBell" }


00

12.4.2 Query Access Control Alarm Record


M
EG

Table 12-11
http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlAlarmRecor
Syntax
A

d[&StartTime=<startTime>&EndTime=<endTime>&count=<countNo>]
Di

Method GET
Find the AccessControlAlarmRecord record. ( This api is supported by access control
st

Description
device. )
rib

http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlAlarmR
Example ecord&StartTime=2014-8-25%2000:02:32&EndTime=2014-8-25%2001:02:32&count=5
ut

00
io

totalCount=1000
n

found=500
s.r

records[0].RecNo=789
records[0].CreateTime=123456789
.o

Success records[0].UserID=10113
.

Return records[0].EventCode=DoorMagnetism
records[0].DevAddrs=1
records[0].IndexNum=0
records[0].Time=2017-05-10 16:00:01

Intelligent Building APIs 291


Parameters in URL:
startTime: The start time ,format : 2014-8-25%2000:01:32
endTime: The end time, format: 2014-8-25%2000:02:32
countNo: the number of records to get, The record count, default 1024

Comment
Parameters in Response :
totalCount : the record count which match condition
Da

found : the record count to return


EventCode : alarm event code, the range is { "DoorNotClosed", "BreakIn",
hu

"RepeatEnter", "Duress", "AlarmLocal", "ChassisIntruded" }


aH

12.5 SIP
TT
P

The user needs to connect video intercom through CGI protocol, but do not know how to use this
AP

protocol to configure the device. This document provides the corresponding CGI protocol according
to the configuration data format involved in the specific service.
IV

12.5.1 Get SIP Configuration


2.
89

Table 12-12
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name
fo

=SIP
Method GET
r1

Description Get SIP server configuration.


00

[ Request Params ] (None)


[ Response Params ] ( key=value format )
M

Name Type R/O Param Description


EG

table object R Configuration data table


+SIP object R Configuration name
A

++AccoutName string O Account name


Di

SIP server
++SIPServer string R
IP address or domain name
st

++SIPServerPort int R SIP server port number


rib

++OutboundProxy string O Proxy server IP address or domain name


Proxy server ID
ut

++OutboundProxyID string O
++OutboundProxyPort Int O Proxy server port number
io

User account ID
++UserID String R
n

Generally a phone number


s.r

++UserType int O User type


++AuthID String R Authentication ID
.o

++AuthPassword String R Authentication password


.

STUN (Simple Traversal of UDP over


++STUNServer String O NATs) server
IP address or domain name
++RegisterRealm String R Registration domain

Intelligent Building APIs 292


++RegExpiration int O Registration interval, in seconds
Local SIP port
++LocalSIPPort Int R
0-65535
Local RTP port
++LocalRTPPort int R
0-65535
Restart to delete registration information.
++UnregisterOnReboot bool O true: Delete
Da

false: Not delete


++DefaultCallNumber string O Default call number
hu

++MediaDetail Object O Media configuration


aH

Video stream
enumchar[32]{
"Main": Main stream
TT

+++VideoStream string O "Extra1": Sub stream 1


P

"Extra2": Sub stream 2


AP

"Extra3": Sub stream 3


}
IV

Audio stream
enumchar[32]{
2.

"Main": Main stream


89

+++AudioStream string O "Extra1": Sub stream 1


"Extra2": Sub stream 2
fo

"Extra3": Sub stream 3


r1

}
++RouteEnable bool O Enable SIP cross-router or not.
00

Router address, which can be IP


++Route string O
address or domain name.
M

Username to log in to VTNC


++SIPServerLoginUserName string O
EG

For intelligent building only


Password to log in to VTNC
A

++SIPServerLoginPWD string O
For intelligent building only
Di

Whether the door station is a standby


++IsMainVTO string O server
st

For intelligent building only


rib

Standby server IP address


++SIPServerRedundancy string O
For intelligent building only
ut

++SIPServerRedundancyUserNa Standby server login username


io

string O
me For intelligent building only
n

++SIPServerRedundancyPassWo Standby server login password


string O
s.r

rd For intelligent building only


The start number of the analog indoor
.o

++AnalogNumberStart string O monitor supported in the analog system


.

For intelligent building only


The end number of the analog indoor
++AnalogNumberEnd string O monitor supported in the analog system
For intelligent building only

Intelligent Building APIs 293


Enable registration
For intelligent building only
++UserEnable bool R
true: Register to the SIP server.
false: Not register to the SIP server.
[ Example ]
Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=SIP
table.SIP.AuthID=8001
Da

table.SIP.AuthPassword=123456
table.SIP.IsMainVTO=0
hu

table.SIP.LocalRTPPort=15000
aH

table.SIP.LocalSIPPort=5060
table.SIP.OutboundProxy=192.168.1.111
table.SIP.OutboundProxyID=8000
TT

table.SIP.OutboundProxyPort=5060
P

table.SIP.RegisterRealm=VDP
AP

table.SIP.Route[0]=sip:10.30.1.2:5060;lr
Response table.SIP.RouteEnable=true
IV

table.SIP.SIPServer=192.168.1.111
table.SIP.SIPServerID=8000
2.

table.SIP.SIPServerLoginPWD=admin
89

table.SIP.SIPServerLoginUserName=admin
table.SIP.SIPServerPort=5060
fo

table.SIP.SIPServerRedundancyPassWord=admin
table.SIP.SIPServerRedundancyUserName=admin
r1

table.SIP.UserEnable=true
00

table.SIP.UserID=8001
table.SIP.UserType=2
M
EG

12.5.2 Modifying SIP Configuration


A

Table 12-13
Di

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
st

Description Modify SIP configuration.


rib

[ Request Params ] ( key=value at URL )


Name Type R/O Param Description
ut

+SIP object R Configuration name


io

++AccoutName string O Account name


n

SIP server
++SIPServer string R
s.r

IP address or domain name


++SIPServerPor
int R SIP server port number
.o

t
.

++OutboundPro
string O Proxy server IP address or domain name
xy
++OutboundPro
string O Proxy server ID
xyID

Intelligent Building APIs 294


++OutboundPro
Int O Proxy server port number
xyPort
User account ID
++UserID String R
Generally a phone number
++UserType int O User type
++AuthID String R Authentication ID
++AuthPasswor
Da

String R Authentication password


d
STUN (Simple Traversal of UDP over NATs) server
hu

++STUNServer String O
IP address or domain name
aH

++RegisterReal
String R Registration domain
m
TT

++RegExpiration int O Registration interval, in seconds


Local SIP port
++LocalSIPPort Int R
P

0-65535
AP

Local RTP port


++LocalRTPPort int R
0-65535
IV

Restart to delete registration information.


++UnregisterOn
bool O true: Delete
2.

Reboot
false: Not delete
89

++DefaultCallNu
string O Default call number
mber
fo

++MediaDetail Object O Media configuration


r1

Video stream
enumchar[32]{
00

"Main": Main stream


+++VideoStream string O "Extra1": Sub stream 1
M

"Extra2": Sub stream 2


EG

"Extra3": Sub stream 3


}
A

Audio stream
Di

enumchar[32]{
"Main": Main stream
st

+++AudioStream string O "Extra1": Sub stream 1


rib

"Extra2": Sub stream 2


"Extra3": Sub stream 3
ut

}
io

++RouteEnable bool O Enable SIP cross-router or not.


n

Router address, which can be IP address or domain


++Route string O
s.r

name.
++SIPServerLog Username to log in to VTNC
.o

string O
inUserName For intelligent building only
.

++SIPServerLog Password to log in to VTNC


string O
inPWD For intelligent building only
Whether the door station is a standby server
++IsMainVTO string O
For intelligent building only

Intelligent Building APIs 295


++SIPServerRe Standby server IP address
string O
dundancy For intelligent building only
++SIPServerRe
Standby server login username
dundancyUserN string O
For intelligent building only
ame
++SIPServerRe
Standby server login password
dundancyPassW string O
Da

For intelligent building only


ord
The start number of the analog indoor monitor supported
hu

++AnalogNumbe
string O in the analog system
rStart
aH

For intelligent building only


The end number of the analog indoor monitor supported
++AnalogNumbe
string O in the analog system
TT

rEnd
For intelligent building only
P

Enable registration
AP

For intelligent building


++UserEnable bool R
true: Register to the SIP server.
IV

false: Not register to the SIP server.


[ Response Params ] ( OK )
2.

[ Example ]
89

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&SIP.SIPServer
Request =192.168.1.108&SIP.SIPServerPort=5060&SIP.RegisterRealm=VDP&SIP.RouteEnable=
fo

true
r1

Response OK
00

12.6 Registar
M
EG

12.6.1 Get Registar Configuration


A

Table 12-14
Di

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=
st

Registar
rib

Method GET
Description Get Registar configuration.
ut

[ Request Params ] (None)


io

[ Response Params ] ( key=value format )


Name Type R/O Param Description
n

table object R Configuration data table


s.r

+Registar object[] R
.o

One-dimensional array. Each subscript


represents a registration server.
.

++RegistarName char[] O Registration server name, which must be


unique.
(Note: For VTH, use the IP address and
port in the configuration to connect VTO.)

Intelligent Building APIs 296


++Enable bool O Register to the registration server or not.
++ServerType enumchar[32] R Server type, which is used only for SIP
video talk, instead of VT video talk.
Enumchar[32]{
"VTO"
"H500"
"VTNC"
Da

"ZYCOO"
"ThirdParty"
hu

"3CXSystem"
"Asterisk"
aH

}
++GeneralServerInfo object O
TT

+++Address char[40] O IP address


P

+++Port uint O Registration port number


AP

+++Password char[64] O Password registered to the register server,


which will be used when registration
IV

authentication is required.
[ Example ]
2.

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=
Request
89

Registar

Response
fo

table.Registar[0].ServerType=VTO
r1

12.6.2 Modifying Registar Configuration


00

Table 12-15
M

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
EG

Method GET
Description Modify Registar configuration.
A

[ Request Params ] ( key=value at URL )


Di

Name Type R/O Param Description


st

+Registar object[] R One-dimensional array. Each subscript represents a register


server.
rib

++RegistarNam char[] O Registration server name, which must be unique.


ut

e (Note: For VTH, use the IP address and port in the


configuration to connect VTO.)
io

++Enable bool O Register to the registration server or not.


n
s.r
.o
.

Intelligent Building APIs 297


++ServerType enumchar[32] R Server type, which is used only for SIP video talk, instead of
VT video talk.
Enumchar[32]{
"VTO"
"H500"
"VTNC"
"ZYCOO"
Da

"ThirdParty"
"3CXSystem"
hu

"Asterisk"
}
aH

++GeneralServe object O
rInfo
TT

+++Address char[40] O IP address


P

+++Port uint O Registration port number


AP

+++Password char[64] O Password registered to the registration server, which will be


used when registration authentication is required.
IV

[ Response Params ] ( OK )
[ Example ]
2.

GET
Request
89

http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&Registar.ServerType=VTO
Response OK
fo
r1

12.7 Room Number Database Management


00
M

12.7.1 Adding Room Number


EG

Table 12-16
A

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=VideoTalkContact
Method GET
Di

Description Add room number to the contacts.


st

[ Request Params ] (key=value format in URL)


rib

Name Type R/O Param Description


CreateTime uint O Start time
ut

UTC seconds, read only


io

FirstName string O First name


FamilyName string O Last name
n

VTShortNumber string R Short number for video intercom


s.r

VTMiddleNumbe string O Middle number for video intercom


.o

r
VTLongNumber string O Long number for video intercom or serial number of analog
.

indoor monitor
VTNetAddress string O Network address for video intercom
MacAdress string O MAC address
VTOPosition string O Door number linked with indoor monitor

Intelligent Building APIs 298


VTSlaveBindMo enumint O Mode when accessing to the analog indoor monitor for video
de talk
Enumint{
0: SubAddress
1: SubID+SubPort
}
VTSlaveId uint32 O Allocator address when accessing to the analog indoor monitor
Da

for video talk


(Change string to uint32 for consistency)
hu

VTSlavePort uint32 O Allocator port when accessing to the analog indoor monitor for
aH

video talk
(Change string to uint32 for consistency)
VTSlaveAddress string O Address of the analog indoor monitor for video talk
TT

NickName string O Nickname


P

Notes string O Notes


AP

Type enumchar[ O User type


32] Enumchar[32]{
IV

"VTH": Indoor monitor


"VTO": Door station
2.

}
89

RegisterType enumchar[ R Registration method


32] Enumchar[32]{
fo

"public"
r1

"local"
}
00

VTHPassword string R Registration password


VTOBuilding string O Building number
M

VTOUnit string O Unit number


EG

GroupNumber string O Group


Channel uint32 O Channel number, based on which the mobile phone subscribes
A

to the call notification message.


Di

Floors char[256][4 O Floor number (lift control requirements), with up to 256


] characters
st

LiftControlByVT bool O Lift control is triggered by the indoor monitor opening the door.
rib

H
ut

[ Response Params ] (key=value format )


Name Type R/O Param Description
io

RecNo int R Record ID of successfully creation


n

[ Example ]
s.r

GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=VideoTalkContact&VTShort
.o

Number=101&RegisterType=public&VTHPassword=123456
.

Response RecNo=12345

Intelligent Building APIs 299


12.7.2 Getting Records by recno
Table 12-17
URL http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=VideoTalkContact
Method GET
Description Search for room number records by recno.
Da

[ Request Params ] (key=value format in URL)


Name Type R/O Param Description
hu

recno int R Record ID


[ Response Params ] (key=value format )
aH

Name Type R/O Param Description


+RecNo int R Record ID
TT

+CreateTime uint O Start time


UTC seconds, read only
P

+FirstName string O First name


AP

+FamilyName string O Last name


IV

+VTShortNumbe string R Short number for video intercom


r
2.

+VTMiddleNumb string O Middle number for video intercom


89

er
+VTLongNumbe string O Long number for video intercom or serial number of VTH
fo

r analog indoor monitor


+VTNetAddress string O Network address for video intercom
r1

+MacAdress string O MAC address


00

+VTOPosition string O Door number linked with indoor monitor


+VTSlaveBindM enumint O Mode when accessing to the analog indoor monitor for video
M

ode talk
EG

Enumint{
0: SubAddress
A

1: SubID+SubPort
}
Di

+VTSlaveId uint32 O Allocator address when accessing to the analog indoor monitor
st

for video talk


rib

(Change string to uint32 for consistency)


+VTSlavePort uint32 O Allocator port when accessing to the analog indoor monitor for
ut

video talk
io

(Change string to uint32 for consistency)


n

+VTSlaveAddres string O Address of the analog indoor monitor for video talk
s
s.r

+NickName string O Nickname


.o

+Notes string O Notes


.

+Type enumchar[ O User type


32] Enumchar[32]{
"VTH": Indoor monitor
"VTO": Door station
}

Intelligent Building APIs 300


+RegisterType enumchar[ R Registration method
32] Enumchar[32]{
"public"
"local"
}
+VTHPassword string R Registration password
+VTOBuilding string O Building number
Da

+VTOUnit string O Unit number


+GroupNumber string O Group
hu

[ Example ]
aH

GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=VideoTalkContact&recno=123
45
TT

record.RecNo=12345
P

record.CreateTime=123456789
AP

record.FirstName=Dafei
record.FamilyName=Wang
IV

record.VTShortNumber=0101
record.VTMiddleNumber=11010101
2.

record.VTLongNumber=330103001101010151
89

record.VTNetAddress=127.0.0.1
record.MacAdress=0A:3E:FF:2A:50:41
fo

record.VTOPosition=01018001
r1

record.VTSlaveBindMode=0
record.VTSlaveId=1258421
00

Response record.VTSlavePort=1258421
record.VTSlaveAddress=04:b3:01:f7
M

record.NickName=Nick
EG

record.Notes=Friend
record.Type=VTH
A

record.RegisterType=public
Di

record.VTHPassword=123456
record.VTOBuilding=01
st

record.VTOUnit=01
rib

record.GroupNumber=301
record.Channel=1
ut

record.Floors[0]=1
io

record.LiftControlByVTH=true
n

12.7.3 Updating Room Number Records


s.r
.o

Table 12-18
.

URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=VideoTalkContact
Method GET
Description Update Room number database records.
[ Request Params ] (key=value format in URL)
Name Type R/O Param Description

Intelligent Building APIs 301


recno int R Record ID
CreateTime uint O Start time
UTC seconds, read only
FirstName string O First name
FamilyName string O Last name
VTShortNumber string O Short number for video intercom
VTMiddleNumbe string O Middle number for video intercom
Da

r
VTLongNumber string O Long number for video intercom or serial number of VTH
hu

analog indoor monitor


aH

VTNetAddress string O Network address for video intercom


MacAdress string O MAC address
TT

VTOPosition string O Door number linked with indoor monitor


VTSlaveBindMo enumint O Mode when accessing to the analog indoor monitor for video
P

de talk
AP

Enumint{
0: SubAddress
IV

1: SubID+SubPort
}
2.

VTSlaveId uint32 O Allocator address when accessing to the analog indoor monitor
89

for video talk


(Change string to uint32 for consistency)
fo

VTSlavePort uint32 O Allocator port when accessing to the analog indoor monitor for
r1

video talk
(Change string to uint32 for consistency)
00

VTSlaveAddress string O Address of the analog indoor monitor for video talk
NickName string O Nickname
M

Notes string O Notes


EG

Type enumchar[ O User type


32] Enumchar[32]{
A

"VTH": Indoor monitor


Di

"VTO": Door station


st

}
RegisterType enumchar[ O Registration method
rib

32] Enumchar[32]{
ut

"public"
"local"
io

}
n

VTHPassword string O Registration password


s.r

VTOBuilding string O Building number


VTOUnit string O Unit number
.o

GroupNumber string O Group


.

Channel uint32 O Channel number, based on which the mobile phone subscribes
to the call notification message.
Floors char[256][4 O Floor number (lift control requirements), with up to 256
] characters

Intelligent Building APIs 302


LiftControlByVT bool O Lift control is triggered by the indoor monitor opening the door.
H
[ Response Params ] (OK)
[ Example ]
GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=VideoTalkContact&recno=
12345&FirstName=Green&FamilyName=Jim&VTHPassword=654321
Da

Response OK
hu

12.7.4 Deleting Records by recno


aH

Table 12-19
URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=VideoTalkContact
TT

Method GET
P

Description Delete records by recno.


AP

[ Request Params ] (key=value format in URL)


Name Type R/O Param Description
IV

recno int R Record ID


[ Response Params ] (OK)
2.

[ Example ]
89

GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=VideoTalkContact&recno
fo

=12345
r1

Response OK
00

12.7.5 Clearing All Room Numbers


M

Table 12-20
EG

URL http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=VideoTalkContact
Method GET
A

Description Delete all records .


Di

[ Request Params ] (key=value format in URL)


st

Name Type R/O Param Description


rib

name string R Database name, which must be VideoTalkContact.


[ Response Params ] (OK)
ut

[ Example ]
Request GET http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=VideoTalkContact
io

Response OK
n
s.r

12.7.6 Getting Total Quantity of Room Number


.o
.

Table 12-21
URL http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=VideoTalkContact
Method GET
Description Get the total number of records of the database VideoTalkContact.

Intelligent Building APIs 303


[ Request Params ] (key=value format in URL)
Name Type R/O Param Description
name string R Database name, which must be VideoTalkContact.
[ Response Params ] (key=value format )
Name Type R/O Param Description
count int R Total number of records
[ Example ]
Da

GET
Request
http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=VideoTalkContact
hu

Response Count=200
aH
TT
P
AP
IV
2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Intelligent Building APIs 304


13 DVR Custom APIs
13.1 File Finder
Da

13.1.1 Create a File Finder


hu
aH

Table 13-1
http://<server>/cgi-bin/FileFindHelper.cgi?action=startFind&condition.channel=<Channe
lNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamType=<
TT

Syntax
stream>[&condition.flags[0]=<flag>&condition.events[0]=<event>&combineMode.granu
P

larity=<granularityValue>&combineMode.types[0]=<combineType>]
Method GET
AP

Description Start to find files.


IV

Find a file in channel 1. Event type is "AlarmLocal" or "VideoMotion". Time lines between
2014-1-1 12:00:00 and 2015-1-10 12:00:00. Combine "AlarmLocal" or "VideoMotion"
2.

files with granularity 16.


89

URL is:
Example http://172.23.1.66/cgi-bin/fileFindHelper.cgi?action=startFind&condition.channel=1&con
fo

dition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:00&co
ndition.streamType=Main&condition.flags[0]=Event&condition.events[0]=AlarmLocal&co
r1

ndition.events[1]=VideoMotion&combineMode.granularity=16&combineMode.types[0]=A
00

larmLocal&combineMode.types[0]=VideoMotion
Success
M

result=08137
Return
EG

Start to find a file with the above condition and combine files with certain type. If it
succeeds, return to find id. Otherwise return to Error.
A

Parameters in URL:
Di

ChannelNo: integer, video channel index which starts from 1.


start / end: the start/end time when recording.
st

flag: which flags of the file you want to find. It is an array. The index starts from 0. The
rib

range of flag is {"Timing", "Marked", "Event", "Restrict"}. If omitted, find files with all the
flags.
ut

event: by which event the record file is triggered. It is an array. The index starts from 0.
io

Comment The range of event is {"AlarmLocal", "VideoMotion", "VideoLoss"}. This condition can be
n

omitted. If omitted, find files of all the events.


stream: which video stream type you want to find. The range of stream is {"Main",
s.r

"Extra1", "Extra2", "Extra3"}.


.o

combineType: which types of the file you want to combined. It is an array. The index
starts from 0. The range of combine type is {"AlarmLocal", "VideoMotion", "Timing",
.

"VideoLoss"}. This condition can be omitted. If omitted, file will not be combined.
granularityValue: by which granularity to combine files
Example:
File 1:

DVR Custom APIs 305


items[0].Channel =1
items[0].StartTime =2011-1-1 12:00:00
items[0].EndTime =2011-1-1 13:00:00
items[0].Events[0]=AlarmLocal
items[0].VideoStream=Main
items[0].Length =790
items[0].Duration = 3600
Da

File 2:
hu

items[0].Channel =1
items[0].StartTime =2011-1-1 13:00:00
aH

items[0].EndTime =2011-1-1 14:00:00


items[0].Events[0]=AlarmLocal
TT

items[0].VideoStream=Main
P

items[0].Length =790
items[0].Duration = 3600
AP
IV

file1 and file2 will be combined to file3


File 3:
2.

items[0].Channel =1
89

items[0].StartTime =2011-1-1 12:00:00


items[0].EndTime =2011-1-1 14:00:00
fo

items[0].Events[0]=AlarmLocal
items[0].VideoStream=Main
r1

items[0].Length =1580
00

items[0].Duration = 7200
M

13.1.2 Create a Motion File Finder


EG

Table 13-2
A

http://<server>/cgi-bin/FileFindHelper.cgi?action=startMotionFind&condition.channel=<C
hannelNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamT
Di

Syntax ype=<stream>&motionRegion.senseLevel=<level>[&motionRegion.rects[rectNo][0]=<r
st

ect0>&motionRegion.rects[rectNo][1]=<rect1>&motionRegion.rects[rectNo][2]=<rect2>
rib

&motionRegion.rects[rectNo][3]=<rect3>]
Method GET
ut

Description Start to find motion files.


io

Find a file in channel 1, event type is "AlarmLocal" or "VideoMotion", and time between
n

2014-1-1 12:00:00 and 2015-1-10 12:00:00, motion region is [0,0,21,17]


URL is:
s.r

http://172.23.1.66/cgi-bin/fileFindHelper.cgi?action=startMotionFind&condition.channel=
.o

Example 1&condition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:
00&condition.streamType=Main&condition.flags[0]=Event&condition.events[0]=AlarmLoc
.

al&condition.events[1]=VideoMotio&motionRegion.senseLevel=1&motionRegion.rects[1]
[0]=0&motionRegion.rects[1][1]=0&motionRegion.rects[1][2]=21&motionRegion.rects[1][
3]=17
Success result=08137

DVR Custom APIs 306


Return
Start to find a file with the above condition and combine files with certain type. If success,
return find id, else return Error.
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
start / end: the start/end time when recording.
flag: which flags of the file you want to find. It is an array. The index starts from 0. The
Da

range of flag is {"Timing", "Marked", "Event", "Restrict"}. If omitted, find files with all the
flags.
hu

event: by which event the record file is triggered. It is an array. The index starts from 0.
Comment
The range of event is {"AlarmLocal", "VideoMotion"}. This condition can be omitted. If
aH

omitted, find files of all the events.


stream: which video stream type you want to find. The range of stream is {"Main",
TT

"Extra1", "Extra2", "Extra3"}.


P

level: the motion sensitive level, range is 0–6, 0 represent all level
AP

rectNo: the rects array index, start from 1


rect0 & rect1 & rect2 & rect3 : relative coordinates, rect0 and rect2 range is 0—21, rect1
IV

and rect3 range is 0—17. {0,0,0,0} top—left, {21,0,0,0} top—right, {0,17,0,0} bottom
—left, {21,17,0,0} bottom—right
2.
89

13.1.3 Get the File Information Found by the Finder


fo

Table 13-3
http://<server>/cgi-bin/FileFindHelper.cgi?action=findNext&findId=<findId>&count=<fileCo
r1

Syntax
unt>
00

Method GET
Descriptio
M

Find the next files no more than fileCount number.


n
EG

Example http://192.168.1.108/cgi-bin/FileFindHelper.cgi?action=findNext&findId=08137&count=100
found=1
A

items[0].channel =1
Di

items[0].startTime =2011-1-1 12:00:00


items[0].endTime =2011-1-1 13:00:00
st

Success
items[0].fileType =dav
rib

Return
items[0].events[0]=AlarmLocal
items[0].streamType=Main
ut

items[0].length =790
io

items[0].duration = 3600
n

findId: The find Id is created by API Create a file finder or API Create a motion file finder.
Comment
Must create a finder before finding files.
s.r
.o

13.1.4 Stop the Finder


.

Table 13-4
Syntax http://<server>/cgi-bin/FileFindHelper.cgi?action=stopFind&findId=<findId>
Method GET
Description Stop the searching operation.

DVR Custom APIs 307


Example http://192.168.1.108/cgi-bin/FileFindHelper.cgi?action=stopFind&findId=08137
Success
OK
Return
findId: The find Id is created by API Create a file finder or API Create a motion file
Comment
finder. Must create a finder before finding files.

13.1.5 Get Bound Files


Da

Table 13-5
hu

http://<server>/cgi-bin/FileFindHelper.cgi?action=getBoundFile&condition.channel=<Cha
aH

Syntax nnelNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamTyp
e=<stream>[&condition.flags[0]=<flag>&condition.events[0]=<event>]
Method GET
TT

Description Get bound files.


P

http://<server>/cgi-bin/FileFindHelper.cgi?action=getBoundFile&condition.channel=1&co
AP

Example ndition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:00&c
ondition.streamType=Main&condition.flags[0]=Timing
IV

found=2
items[0].channel =1
2.

items[0].startTime =2011-1-1 12:00:00


89

items[0].endTime =2011-1-1 13:00:00


items[0].flags [0]= Timing
fo

items[0].streamType=Main
r1

items[0].length =790
Success
items[0].duration = 3600
Return
00

items[1].channel =1
items[1].startTime =2011-1-1 13:00:00
M

items[1].endTime =2011-1-1 14:00:00


EG

items[1].events[0]= Timing
items[1].streamType=Main
A

items[1].length =790
Di

items[1].duration = 3600
Comment Params is same as FileFindHelper.startFind
st
rib

13.2 BandLimit
ut

13.2.1 Get Bandwidth Limit State


io
n

Table 13-6
s.r

Syntax http://<server>/cgi-bin/BandLimit.cgi?action=getLimitState
Method GET
.o

Description Get bandwidth limit state.


.

Example http://192.168.1.108/cgi-bin/bandLimit.cgi?action=getLimitState
Success
limit=true
Return
Comment —

DVR Custom APIs 308


13.3 Record Files Protection

13.3.1 Add Protection


Table 13-7
http://<server>/cgi-bin/FileManager.cgi?action=addConditionList&condition.Types[0]=<
Da

Syntax paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramValu
e>&condition.Channel[0]=<paramValue>
hu

Method GET
aH

Description Add protection or access control for record files.


http://192.168.1.108/cgi-bin/FileManager.cgi?action=addConditionList&condition.Types
TT

[0]=RecordRestrict&condition.Types[1]=RecordProtect&condition.StartTime=2014-7-3
Example
%2021:02:32&condition.EndTime=2014-7-3%2023:02:32&condition.Channel[0]=1&con
P

dition.Channel[1]=3
AP

Success
OK
Return
IV

In table below:
Comment TypeIndex: The index of type array
2.

ChIndex: The index of channel number array


89

Appendix:
fo

ParamName ParamValue type Description


r1

An array. The range is {"RecordProtect",


condition.Type[TypeIndex] string
"RecordRestrict"}.
00

The time format is "Y-M-D H-m-S", example


condition.StartTime string
2011-7-3%2021:02:32
M

condition.EndTime string The time format is "Y-M-D H-m-S"


EG

condition.Channel[ChIndex] integer Video channel index which starts from 1.


A

13.3.2 Cancel Protection


Di
st

Table 13-8
http://<server>cgi-bin/FileManager.cgi?action=cancelConditionList&condition.Types[0]
rib

Syntax =<paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramVa
lue>&condition.Channel[0]=<paramValue>
ut

Method GET
io

Description Cancel protection of record files.


n

http://192.168.1.108/cgi-bin/FileManager.cgi?action=cancelConditionList&condition.Ty
s.r

pes[0]=RecordRestrict&condition.Types[1]=RecordProtect&condition.StartTime=2014-
Example
7-3%2021:02:32&condition.EndTime=2014-7-3%2023:02:32&condition.Channel[0]=1&
.o

condition.Channel[1]=3
.

Success
OK
Return
Comment paramValue as Appendix above.

DVR Custom APIs 309


13.3.3 Remove Protection
Table 13-9
http://<server>/cgi-bin/FileManager.cgi?action=removeConditionList&condition.Types[0
Syntax ]=<paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramV
alue>&condition.Channel[0]=<paramValue>
Method GET
Da

Description Remove protection of record files.


hu

http://192.168.1.108/cgi-bin/FileManager.cgi?action=removeConditionList&condition.Ty
pes[0]=RecordRestrict&condition.Types[1]=RecordProtect&condition.StartTime=2014-
aH

Example
7-3%2021:02:32&condition.EndTime=2014-7-3%2023:02:32&condition.Channel[0]=0&
condition.Channel[1]=3
TT

Success
OK
Return
P

Comment paramValue as Appendix above.


AP
IV

13.3.4 DownloadFile
2.

download file
89

Request URL http://<server>/cgi-bin/FileManager.cgi?action=downloadFile


Method GET
fo

Request Params ( key=value format in URL )


r1

Name Type R/O Description Example


fileName string R filename or path download.jp
00

g
M

Request Example
http://192.168.1.108/cgi-bin/FileManager.cgi?action=downloadFile&fileName=download.jpg
EG
A

Response Params (multipart binary data )


Name Type R/O Description Example
Di

Response Example
st

HTTP/1.1 200 OK
rib

Content-type: text/plain;charset=utf-8
CONNECTION: close
ut

Set-Cookie:secure; HttpOnly
io

CONTENT-LENGTH: <length>
n

<Binary Data>
s.r
.o

13.3.5 UploadFile
.

Upload radar photos


http://<server>/cgi-bin/FileManager.cgi?action=uploadFile&fileName=<FileName>&file
Request URL
Length=<FileLength>

DVR Custom APIs 310


Method POST
Request Params ( key=value format in url )
Name Type R/O Description Example
File length, in bytes.
Total length for one-time upload.
fileLength uint R 124879
For radars, a single file is up to
8,388,608 KB.
Da

File name, only the types bmp and


fileName char[128] R "xxxxxx.bmp"
jpg are available for radars.
hu

Request Example
POST
aH

http://192.168.1.108/cgi-bin/FileManager.cgi?action=uploadFile&fileName=xxxxxx.bmp&fileLength=124
879
TT

HTTP/1.1
P

Host: 192.168.1.108
Connection: keep-alive
AP

Content-Type: multipart/form-data;boundary=---------------------------8655433224198
IV

Content-Length: xxxxxxxxx
2.

-----------------------------8655433224198
89

Content-Disposition:form-data;name="upload"; filename="xxxxxx.bmp"
Content-Type: image/jpeg or application/x-MS-bmp
fo

photo data….
r1
00

-----------------------------8655433224198--
M

Response Params ( OK in body )


EG

Parameter Type Required Description Example


Response Example
A

OK
Di
st

13.4 Get Daylight


rib

Table 13-10
ut

Syntax http://<server>/cgi-bin/global.cgi?action=getDST
io

Method GET
n

Description Get daylight saving time state.


Example http://192.168.1.108/cgi-bin/global.cgi?action=getDST
s.r

Success
result = 1
.o

Return
.

Comment result: 1/0, yes or not in daylight saving time

DVR Custom APIs 311


14 Comm
14.1 Coaxial Control IO
Da

14.1.1 Control White Light or Speaker


hu

 control white light or speaker


aH

Table 14-1
http://<server>/cgi-bin/coaxialControlIO.cgi?action=control&[channel=<channelno>]&inf
TT

Syntax
o[0].Type=<type>&info[0].IO=<io>&info[0].TriggerMode=<triggermode>
P

Method GET
AP

Description Control white light or speaker


http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action=control&channel=1&info[0].Ty
Example
IV

pe=1&info[0].IO=0&info[0].TriggerMode=1
Success
2.

OK
Return
89

channelno: video channel index for white light,for siren it's audio output channel, The
Comment
channel number is default 0 if the request is not carried the param
fo

Appendix:
r1

ParamName ParamValue type Description


00

Required.
type integer
1:wight light, 2:speaker
M

Required.
io integer
EG

1:open, 2:close
Required.
A

triggermode integer
1:trigger by linkage, 2:trigger by manual
Di

 get white light and speaker status


st

Table 14-2
rib

Syntax http://<server>/cgi-bin/coaxialControlIO.cgi?action= getstatus&[channel=<channelno>]


Method GET
ut

Description Get white light and speaker stauts


io

Example http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action= getStatus&channel=1


Success status.whitelight=on
n

Return status.speaker=on
s.r

Comment channelno: video channel index


.o

14.2 Pir Alarm


.

14.2.1 Configure Pir Parameter


 Get pir parameter

Comm 312
Table 14-3
Syntax http://<server>/cgi-bin/pirAlarm.cgi?action=getPirParam&[channel=<channelNo>]
Method GET
Description Get pir parameter.
Example http://192.168.1.108/cgi-bin/pirAlarm.cgi?action=getPirParam&channel=1
head.Enable=true
head.PirLink.LightingLink.Enable=true
Da

head.PirLink.LightingLink.LightLinkType=Filcker
head.PirLink.LightingLink.FilckerIntevalTime=5
hu

head.PirLink.LightingLink.LightDuration=10
aH

head.PirLink.LightingLink.WhiteLightTimeSection=TimeSection
head.PirLink.TimeSection[weekday][0]=1 00:00:00-24:00:00
head.PirLink.TimeSection[weekday][1]=0 02:00:00-24:00:00
TT

head.PirLink.TimeSection[weekday][2]=0 03:00:00-24:00:00
P

head.PirLink.TimeSection[weekday][3]=0 04:00:00-24:00:00
AP

head.PirLink.TimeSection[weekday][4]=0 05:00:00-24:00:00
head.PirLink.TimeSection[weekday][5]=0 06:00:00-24:00:00
IV

head.RecordEnable=true
head.RecordChannels=[0, 1, 2]
2.

head.RecordLatch=10
89

head.AlarmOutEnable=true
head.AlarmOutChannels=[1, 4]
Success
fo

head.AlarmOutLatch=10
Return
head.SnapshotEnable=true
r1

head.SnapshotChannels=[2, 4]
00

head.MailEnable=true
head.AlarmBellEnable=true
M

head.AlarmBellLatch=10
EG

head.Dejitter=0
head.LogEnable=true
A

head.DetectWindow[0].Level=3
Di

head.DetectWindow[0].Id=0
head.DetectWindow[0].Name=Region0
st

head.DetectWindow[0].Sensitive=58
rib

head.DetectWindow[0].Threshold=4
head.DetectWindow[0].Region[0]=3932160
ut

head.DetectWindow[0].Region[1]=3932160
io


n


head. DetectWindow [1]…
s.r

if a device has one or more pir, PirParam is a array


.o

channel : video channel index


Comment
weekday : range is [0-6] (Sunday - Saturday)
.

head=configEx[channelNo]
 set pir parameter

Table 14-4

Comm 313
http://<server>/cgi-bin/pirAlarm.cgi?action=setPirParam&[channel=<channelNo>]&<pa
Syntax
ramName>=<paramValue>...&<paramName>=<paramValue>
Method GET
Description Set pir parameter.
http://192.168.1.108/cgi-bin/pirAlarm.cgi?action=setPirParam&channel=1&configEx[1].
Example
Enable=true&configEx[1].PirLink.LightingLink.Enable=true&...
Success
Da

OK
Return
channel : video channel index
hu

Comment
head=configEx[channelNo]
aH

Appendix:
TT

ParamName ParamValue type Description


Enable/Disable motion detect feature in a
head.Enable bool
P

channel.
AP

WinNum
Index of detect window, there are 4 detect
IV

windows at present. Each window is


divided into 18 lines and 22 blocks/line.
2.

head.DetectWindow[WinNum].Level integer
89

Range is [1—6].
Sensitivity of pir
fo

1: lowest sensitivity.
r1

6: highest sensitivity.
head.DetectWindow[WinNum].Id integer It is the Id of a detect window.
00

head.DetectWindow[WinNum].Nam
string It is the name of a detect window.
e
M

Range is [0—100].
head.DetectWindow[WinNum].Sens
EG

integer It presents more sensitive if the value is


itive
larger.
A

Range is [0—100].
head.DetectWindow[WinNum].Thre
Di

integer It presents the threshold value when trigger


shold
motion detect.
st
rib
ut
io
n
s.r
.o
.

Comm 314
ParamName ParamValue type Description
LineNum
Index of region, region is divided into lines
and each line has several blocks, a line is
described by a 32 bit integer, a bit for a
block.
0=Line 1
Da

1=Line 2

hu


aH

Currently, region is divided into 18 lines


head.DetectWindow[WinNum].Regi
integer and 22 blocks/line.
TT

on[LineNum]
A bit describes a block in the line.
P

Bit = 1: motion in this block is monitored.


AP

Example:
MotionDetect[0].Region[0] = 4194303
IV

(0x3FFFFF):: motion in channel 0 line 0's


22 blocks is monitored.
2.

MotionDetect[0].Region[1] =0: motion in


89

line 1's 22 blocks is not monitored.


MotionDetect[0].Region[17] = 3: in the last
fo

line of channel 0, motion in the left two


blocks is monitored.
r1

wd (week day) range is [0—6] (Sunday -


00

Staurday)
ts (time section) range is [0 — 23],
M

timesection table index.


EG

Format: mask hh:mm:ss-hh:mm:ss


A

head.TimeSection[wd][ts] string Mask: [0—65535], hh: [0—24], mm: [0—


59], ss: [0—59]
Di

Mask indicates record type by bits:


st

Bit0: regular record


rib

Bit1: motion detection record


Bit2: alarm record
ut

Bit3: card record


io

Range is {0, 1}
n

head.PirLink.RecordChannels[ch] Integer 0 – do not record on video channel ch


1 – record on video channel ch
s.r

head.PirLink.RecordEnable bool Enable/Disable record function.


.o

Range is [10—300].
head.PirLink.RecordLatch integer Unit is seconds, indicates the time to
.

record after input alarm is cleared.

Comm 315
ParamName ParamValue type Description
Range is {0, 1}, ch is alarm out channel
index.
head.PirLink.AlarmOutChannels[ch] integer 0 — do not output alarm at alarm out
channel ch
1 — output alarm at alarm out channel ch
head.PirLink.AlarmOutEnable bool Enable/Disable alarm out function.
Da

Range is [10—300].
head.PirLink.AlarmOutLatch Integer Unit is seconds, indicates the time to
hu

output alarm after input alarm is cleared.


aH

Range is {0, 1}
head.PirLink.SnapshotChannels[ch] integer 0 — do not snapshot on video channel ch
1 — snapshot on video channel ch
TT

head.PirLink.SnapshotEnable bool Enable/Disable snapshot function.


P

Range is [0—255].
AP

head.PirLink.Dejitter integer Alarm signal dejitter seconds. Alarm signal


change during this period is ignored.
IV

head.PirLink.MailEnable bool Enable/Disable mail send for alarm.


head.PirLink.AlarmBellEnable bool Enable/Disable mail send for alarm.
2.

Range is [10, 300]


89

head.PirLink.AlarmBellLatch integer
Unit is seconds
head.PirLink.LogEnable bool Enable/Disable log for alarm.
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Comm 316
15 Other APIs
15.1 Discover Devices
Da

15.1.1 Discover Devices on Internet


hu

Table 15-1
aH

Syntax http://<server>/cgi-bin/deviceDiscovery.cgi?action=attach[&DeviceClass=<deviceClass>]
Method GET
TT

Description Discover devices on internet.


Example http://192.168.1.108/cgi-bin/deviceDiscovery.cgi?action=attach&DeviceClass=VTO
P

deviceInfo[index].AlarmInputChannels=8
AP

deviceInfo[index].AlarmOutputChannels=0
deviceInfo[index].DeviceClass=VTO
IV

deviceInfo[index].DeviceType=VTO2000A
2.

deviceInfo[index].HttpPort=80
deviceInfo[index].IPv4Address.DefaultGateway=172.12.0.1
89

deviceInfo[index].IPv4Address.DhcpEnable=false
deviceInfo[index].IPv4Address.IPAddress=172.12.7.102
fo

deviceInfo[index].IPv4Address.SubnetMask=255.255.0.0
r1

deviceInfo[index].IPv6Address.DefaultGateway=2008::1
Success
deviceInfo[index].IPv6Address.DhcpEnable=false
00

Return
deviceInfo[index].IPv6Address.IPAddress=2008::6/112
M

deviceInfo[index].Mac=00:01:5b:01:44:77
deviceInfo[index].MachineName=YZZ4DZ008D00031
EG

deviceInfo[index].Port=37777
deviceInfo[index].RemoteVideoInputChannels=0
A

deviceInfo[index].SerialNo=YZZ4DZ008D00031
Di

deviceInfo[index].Vendor=Multi
st

deviceInfo[index].Version=1.200.0.0
deviceInfo[index].VideoInputChannels=1
rib

deviceInfo[index].VideoOutputChannels=16
ut

Parameters in URL:
deviceClass: in range of {VTO, VTH, VTT, VTS, VTNC, SHG}
io

Comment Parameters in Response:


n

index: the array index which starts from 0.


s.r

Version: Software Version


.o

15.2 Flashlight
.

15.2.1 Flashlight Config


 Get Flashlight Config

Other APIs 317


Table 15-2
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FlashLight
Method GET
Description Get Flashlight config. It does not recommend using it.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FlashLight
head.Brightness=50
head.Enable=false
Da

Success head.TimeSection[0][0]=1 00:00:00-23:59:59


Return head.TimeSection[0][1]=0 00:00:00-23:59:59
hu


aH

head.TimeSection[6][5]=0 00:00:00-23:59:59
Parameters in Response:
Comment
head = table.FlashLight
TT

 Set flashlight config


P

Table 15-3
AP

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
IV

alue>[&<paramName>=<paramValue>…]
Method GET
2.

Description Set Flashlight config.


89

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FlashLight.Enable=tr
Example
ue&FlashLight.TimeSection[1][0]=1%2012:00:00-18:00:00
fo

Success
OK
Return
r1

Comment —
00

Appendix:
M

ParamName ParamValue Description


EG

type
FlashLight.Enable bool Enable
A

FlashLight.Brightness integer Brightness


Di

It is an effective time period for flash light every


day.
st

wd (week day) range is [0 — 6] (Sunday —


rib

Saturday)
ts (time section) range is [0—23], it's index of time
ut

section table.
io
n

Format: mask hh:mm:ss-hh:mm:ss


FlashLight.TimeSection[wd][ts] string
Mask: {0,1}, hh: [0—24], mm: [00—59], ss: [00—
s.r

59]
.o

Mask 0: this time section is not used.


Mask 1: this time section is used.
.

Example:
TimeSection[1][0]=1 12:00:00—18:00:00
Means flash light is effective between 12:00:00

Other APIs 318


ParamName ParamValue Description
type
and 18:00:00 at Monday.

15.3 Open Platform

15.3.1 Application Start and Stop


Da
hu

 Start Application
aH

Table 15-4
http://<server>/cgi-bin/installManager.cgi?action=start&appname=<appname>&appid=
Syntax
TT

<appid>
Method GET
P

Description Start application.


AP

http://192.168.1.108/cgi-bin/installManager.cgi?action=start&appname=FaceDemo&ap
Example
pid=1
IV

Success
OK
Return
2.

Parameters in URL:
89

Comment appname: the application name,


appid: optional, the application id
fo

 Stop Application
r1

Table 15-5
00

http://<server>/cgi-bin/installManager.cgi?action=stop&appname=<appname>&appid=
Syntax
<appid>
M

Method GET
Description Stop application.
EG

http://192.168.1.108/cgi-bin/installManager.cgi?action=stop&appname=FaceDemo&ap
Example
A

pid=1
Success
Di

OK
Return
st

Parameters in URL:
rib

Comment appname: the application name,


appid: optional, the application id
ut

15.3.2 Install Application


io
n

 Install application with app data


s.r

Table 15-6
.o

URL http://<server>/cgi-bin/dhop.cgi?action=uploadApp
.

Method POST
Description Install application.
[ Request Params ] (None)
[ Response Params ] ( OK )

Other APIs 319


[ Example ]
POST /cgi-bin/dhop.cgi?action=uploadApp HTTP/1.1
Host: 172.29.2.176
Content-Length: 413124
Content-Type:multipart/form-data;boundary=<boundary>

Request --<boundary>
Da

Content-Disposition: form-data; name="dev_upgrade"; filename="demo.bin"


Content-Type: application/octet-stream
hu

<app data>
aH

--<boundary>--
Response OK
TT

 Install Application with app download url


P

Table 15-7
AP

URL http://<server>/cgi-bin/dhop.cgi?action=installAppByUrl
Method GET
IV

Description Install application.


2.

[ Request Params ] (key=value format in URL)


89

Url string R The app download url


[ Response Params ] ( OK )
fo

[ Example ]
GET http://192.168.1.108/cgi-bin/dhop.cgi?action=installAppByUrl&Url=https://aaa/bbb/c
r1

Request
cc/app.bin
Response OK
00
M

15.3.3 Update Application and License


EG

 Update Application with app download url


A

Table 15-8
Di

URL http://<server>/cgi-bin/dhop.cgi?action=updateAppByUrl
st

Method GET
Description Update Application
rib

[ Request Params ] (key=value format in URL)


ut

appName string R The app name


Url string R The app download url
io

[ Response Params ] ( OK )
n

[ Example ]
s.r

GET http://192.168.1.108/cgi-bin/dhop.cgi?action=updateAppByUrl&appName=xxx&Url
Request
=https://aaa/bbb/ccc/app.bin
.o

Response OK
.

 Update firmware with firmware download url

Table 15-9
URL http://<server>/cgi-bin/dhop.cgi?action=updateFirmwareByUrl
Method GET

Other APIs 320


Description Update firmware
[ Request Params ] (key=value format in URL)
Url string R The firmware download url
[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/dhop.cgi?action=updateFirmwareByUrl&Url=https://aa
Request
a/bbb/ccc/firmware.bin
Da

Response OK
Update application license with license download url
hu

Table 15-10
aH

URL http://<server>/cgi-bin/dhop.cgi?action=updateLicenseByUrl
Method GET
TT

Description Update application license.


P

[ Request Params ] (key=value format in URL)


appName string R The app name
AP

Url string R The license download url


IV

[ Response Params ] ( OK )
[ Example ]
2.

GET http://192.168.1.108/cgi-bin/dhop.cgi?action=updateLicenseByUrl&appName=xxx&
Request
89

Url=https://aaa/bbb/ccc/license.bin
Response OK
fo

 Update application license with license data


r1

Table 15-11
URL http://<server>/cgi-bin/dhop.cgi?action=uploadLicense
00

Method POST
M

Description Update application license.


[ Request Params ] (key=value format in URL)
EG

appName string R The app name


A

[ Response Params ] ( OK )
[ Example ]
Di

POST /cgi-bin/dhop.cgi?action=uploadLicense&appName=xxx HTTP/1.1


st

Host: 172.29.2.176
rib

Content-Type: application/octet-stream
Request
Content-Length: <length>
ut

<app license data>


io

Response OK
n
s.r

15.3.4 Uninstall Application


.o
.

URL http://<server>/cgi-bin/dhop.cgi?action=uninstall
Method GET
Description Uninstall application.
[ Request Params ] (key=value format in URL)

Other APIs 321


appName string R The app name
[ Response Params ] ( OK )
[ Example ]
Request GET http://192.168.1.108/cgi-bin/dhop.cgi?action=uninstall&appName=xxx
Response OK

15.3.5 Download Application Log


Da

URL http://<server>/cgi-bin/dhop.cgi?action=downloadLog
hu

Method GET
aH

Description Download application log.


[ Request Params ] (key=value format in URL)
TT

appName string R The app name


[ Response Params ] ( log file content )
P

[ Example ]
AP

Request GET http://192.168.1.108/cgi-bin/dhop.cgi?action=downloadLog&appName=xxx


HTTP/1.1 200 OK
IV

Server: Device/1.0
Content-Type: Application/octet-stream
2.

Response
Content-Length: <length>
89

<log file data>


fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Other APIs 322


15.4 LensFunc

15.4.1 getCaps
URL http://<server>/cgi-bin/LensFunc.cgi?action=getCaps
Method GET
Da

Description Get Caps


hu

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
aH

Channel uint R Video channel index which starts from 1.


[ Response Params ] ( key=value format )
TT

Name Type R/O Param Description


Caps object R The capacity.
P

+DepthField uint8 R Whether support depth field adjust, 0 : not support, 1 : support
AP

+AngleAdjust object O The angel adjust capacity.


IV

Whether support angel adjust, 0 : not support, 1 : only support


++Support uint8 R horizontal adjust, 2 : only support vertical adjust, 3 : support
2.

both horizontal and vertical adjust.


89

++MaxVelocity uint8 R The max velocity, range from 1 to 8


[ Example ]
fo

Request GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=getCaps&Channel=1


Caps.DepthField=1
r1

Response Caps.AngelAdjust.Support=3
00

Caps.AngelAdjust.MaxVelocity=8
M
EG

15.4.2 adjustAngleContinuously
A

URL http://<server>/cgi-bin/LensFunc.cgi?action=adjustAngleContinuously
Di

Method GET
Description Adjust the angel continuously.
st

[ Request Params ] ( key=value format at URL )


rib

Name Type R/O Param Description


Channel uint R Video channel index which starts from 1.
ut

The moving direction, 0 : negative X axis direction, 1 : positive


io

Direction uint8 R X axis direction, 2 : negative Y axis direction, 3 : positive Y axis


n

direction
s.r

Velocity uint8 R The adjust velocity, range from 1 to MaxVelocity


[ Response Params ] ( OK )
.o

[ Example ]
.

GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=adjustAngleContinuously&Chan
Request
nel=1&Direction=2&Velocity=2
Response OK

Other APIs 323


15.4.3 stopAdjustingAngle
URL http://<server>/cgi-bin/LensFunc.cgi?action=stopAdjustingAngle
Method GET
Description Stop adjusting angel
[ Request Params ] ( key=value format at URL )
Da

Name Type R/O Param Description


Channel uint R Video channel index which starts from 1.
hu

[ Response Params ] ( OK )
[ Example ]
aH

Request GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=stopAdjustingAngle&Channel=1


Response OK
TT
P

15.4.4 adjustDepthField
AP
IV

URL http://<server>/cgi-bin/LensFunc.cgi?action=adjustDepthField
Method GET
2.

Description Adjust depth position


89

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
fo

Channel uint R Video channel index which starts from 1.


r1

DepthField float R The sensor depth position, range from 0 to 1, -1 means reset.
[ Response Params ] ( OK )
00

[ Example ]
GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=adjustDepthField&Channel=1&D
M

Request
epthField=0.3
EG

Response OK
A
Di

15.4.5 adjustDepthFieldContinuously
st

URL http://<server>/cgi-bin/LensFunc.cgi?action=adjustDepthFieldContinuously
rib

Method GET
ut

Description Adjust depth position continuously.


[ Request Params ] ( key=value format at URL )
io

Name Type R/O Param Description


n

Channel uint R Video channel index which starts from 1.


s.r

The sensor depth position adjust velocity, range from -1 to 1,


DepthFieldSpee
float R positive and negative value means difference direction, 0
.o

d
means stop adjust.
.

[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=adjustDepthFieldContinuously&
Request
Channel=1&DepthFieldSpeed=0.03

Other APIs 324


Response OK

15.4.6 getDepthFieldStatus
URL http://<server>/cgi-bin/LensFunc.cgi?action=getDepthFieldStatus
Method GET
Da

Description Get depth position status.


hu

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
aH

Channel uint R Video channel index which starts from 1.


[ Response Params ] ( key=value format )
TT

Name Type R/O Param Description


Status object R The depth position status.
P

The depth position status, “Normal” : normal status,


AP

+Status string R
“AutoDepthField” : adjusting depth position.
+DepthField float R The sensor board relative position, range from 0 to 1
IV

+DepthFieldStep
uint R The depth position total step.
2.

s
The depth position reset result, only valid when reset.
89

+ResetResult string O
“Success” : reset success, ”Failed” : reset failed
[ Example ]
fo

Request GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=getDepthFieldStatus&Channel=1


r1

Status.Status=Normal
Status.DepthField=0.3
00

Response
Status.DepthFieldSteps=1000
M

Status.ResetResult=Success
EG
A

15.4.7 autoAdjustDepthField
Di

URL http://<server>/cgi-bin/LensFunc.cgi?action=autoAdjustDepthField
st

Method GET
rib

Description Automatic adjust depth position


[ Request Params ] ( key=value format at URL )
ut

Name Type R/O Param Description


io

Channel uint R Video channel index which starts from 1.


n

[ Response Params ] ( OK )
[ Example ]
s.r

GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=autoAdjustDepthField&Channel=
Request
.o

1
.

Response OK

Other APIs 325


15.5 positionManager

15.5.1 getGPSStatus
Syntax http://<server>/cgi-bin/positionManager.cgi?action=getGPSStatus
Method GET
Da

Description Get gps info


Example http://192.168.1.108/cgi-bin/positionManager.cgi?action=getGPSStatus
hu

Success status.Time=2011-07-03 21:02:32


aH

Return status.Longitude=120.175556
status.Latitude=30.186389
status.Speed=30.00
TT

status.Altitude=45.0
P

status.Bearing=45.3
AP

status.SatelliteCount=11
status.WorkStatus=1
IV

Comment Time:time, ex: 2012-01-04 23:30:30.


Longitude:Longitude, in degrees, positive East, negative West
2.

Latitude:Latitude, in degrees, positive north, negative South


89

Speed:speed, unit: km/h


Altitude:Altitude, unit: m
fo

Bearing:Direction angle,unit: degree


r1

SatelliteCount:Satellite number
WorkStatus:GPS working status,0= unlocated,1= un-differenced positioning,2=
00

differential positioning,3= invalid PPS,6= estimating


M
EG

15.6 Radar Adaptor


A

15.6.1 getCaps
Di
st

Please use the interface getCapsEx.


rib

 Radar equipment detection capability request


Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getCaps&channel=< ChannelNo >
ut

Method GET
io

Description Request radar device detection capabilities


Example
n

http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=getCaps&channel=1
Success caps.DetectionRange = 5000 //Zoom in 100 times, while the true value is 50.00
s.r

Return caps.DetectionAngle = 8003 //Zoom in 100 times


.o

caps.DetectionHuman = 4000 //Zoom in 100 times


Comment Parameters in URL:
.

ChannelNo: integer, channel index which starts from 1.

Other APIs 326


15.6.2 getCapsEx
 Radar equipment caps request
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getCapsEx&channel=<ChannelNo>
Method GET
Description Request radar device detection capabilities
Da

Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=getCapsEx&channel=1
Success caps.DetectionRange = 5000 // Radar detection range
hu

Return caps.DetectionAngle = 8003 // Radar detection angle


caps.DetectionHuman = 4000 // Radar human detection range
aH

caps.Capacity.Support = true //Power setting enable


caps.Capacity.List[0] = 150 // Power allows setting list, no more than 24 choices
TT

...
caps.Capacity.List[23] = 300
P

caps.RadarScene.Support = true // Scene setting enable


AP

caps.RadarChannel.Support = true // Radar channel setting enable


caps.RadarChannel.List[0] = 1 // Channel allows setting list, no more than 24 choices
IV


2.

caps.RadarChannel.List[23] = 2
caps.MovedDetect.Support = true // Device motion detection setting enabled
89

Comment Parameters in URL:


ChannelNo: integer, channel index which starts from 1.
fo
r1

15.6.3 getStatus
00
M

 Radar Equipment Status Request


Syntax
EG

http://<server>/cgi-bin/radarAdaptor.cgi?action=getStatus&channel=<ChannelNo>
Method GET
A

Description Request radar device status


Example
Di

http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=getCaps&channel=1
Success status.State = Normal
st

Return
rib

Comment Parameters in URL:


ChannelNo: integer, channel index which starts from 1.
ut

Appendix:
io
n

ParamName ParamValue type Description


State string Radar state, the range is { "Normal" , "Abnormal" }
s.r
.o
.

15.6.4 calculateRealSize
 Radar real map size calculation
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=calculateRealSize&channel=<Channel

Other APIs 327


No>&distance=<distance>&startPoint[0]=<startX>&startPoint[1]=<startY>&endPoint[0
]=<endX>&endPoint[1]<endY>
Method GET
Description Calculate radar real map size
Example http://192.168.0.108/cgi-bin/radarAdaptor.cgi?action=calculateRealSize&channel=1&dis
tance=10.01&startPoint[0]=10&startPoint[1]=20&endPoint[0]=30&endPoint[1]=40
Success realSize.realMap[0]=300
Da

Return realSize.realMap[1]=400
Comment Parameters in URL:
hu

ChannelNo: integer, channel index which starts from 1.


aH

Distance: Segment distance, Unit: m


startPoint: Line segment start coordinates
endPoint: Line segment end coordinates
TT

Appendix:
P
AP

ParamName ParamValue type Description


realMap array<integer> Length and width of actual map, unit:meter
IV
2.

15.6.5 attachAlarmPointInfo
89
fo

 Radar track point request


Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=attachAlarmPointInfo&channel=<Chann
r1

elNo>&[&heartbeat=<Heartbeat>]
Method GET
00

Description Request radar track points


M

[ Request Params ] ( key=value format in URL )


EG

Name Type R/O Param Description


Channel int R Video channel index which starts from 1
A

Send heartbeat interval, range is [1, 60],unit


Di

is second. If the URL contains this


parameter, and the value is 5, it means
st

every 5 seconds the device should send the


heartbeat int O
rib

heartbeat message to the client, the


heartbeat meaage are "Heartbeat". If this
ut

parameter is not present, its default value is


io

60.
Example http://192.168.0.108/cgi-bin/radarAdaptor.cgi?action=attachAlarmPointInfo&channel=1&
n

heartbeat=5
s.r

Success HTTP/1.1 200 OK


.o

Return Server: Device/1.0


Content-Type: multipart/x-mixed-replace; boundary=<boundary>
.

Connection: closed

--<boundary>
Content-Type: application/octet-stream

Other APIs 328


Content-Length: <length>

Channel=1
info[0].PointType=0x80
info[0].RegionNumber=1
info[0].ObjectType=1
info[0].TrackID=1
Da

info[0].Distance=1001 //Zoom in 100 times, while the true value is 10.01


info[0].Angle=2010 //Zoom in 100 times
hu

info[0].Speed=501 //Zoom in 100 times


……
aH

info[3].PointType=0x80
……
TT
P

--<boundary>
Content-Type: text/plain
AP

Content-Length: 11
IV

Heartbeat
2.

-<boundary>
89

Content-Type: application/octet-stream
Content-Length: <length>
fo

Channel=1
r1

info[0].PointType=0x80
00

……
M

--<boundary>
EG


Comment Parameters in URL:
A

ChannelNo: integer, channel index which starts from 1.


Di

Notice:
st

A detach occurs when the connection is disconnected.


rib
ut

15.6.6 getLinkSDState
io
n

 Linked device status request


s.r

Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getLinkSDState&channel=<ChannelNo>
&ip[0]=<ip>&ip[1]=<ip>......&ip[23]=<ip>
.o

Method GET
.

Description Request linkage device status


Example http://192.168.0.108/cgi-bin/radarAdaptor.cgi?action=getLinkSDState&channel=1&ip[0]=1
92.168.1.115&ip[1]=192.168.1.116
Success state[0].SDLinkIP=192.168.1.115

Other APIs 329


Return state[0].State=0
state[0].Channel=1
state[1].SDLinkIP=192.168.1.116
state[1].State=0
state[1].Channel=2
Comment Parameters in URL:
ChannelNo: integer, channel index which starts from 1.
Da

ip: IP address of the linkage device


hu

Appendix:
aH

ParamName ParamValue type Description


State integer device state, 0: out of time, 1: offline, 2: disconnected
TT
P

15.6.7 manualLocate
AP

Radar manual positioning request


IV


Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=manualLocate&channel=<ChannelNo>&
2.

point[0]=<x>&point[1]=<y>
Method GET
89

Description Request manual radar positioning


fo

Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=manualLocate&channel=1&point[0]
=10&point[1]=10
r1

Success OK
Return
00

Comment Parameters in URL:


M

ChannelNo: integer, channel index which starts from 1.


point: Pixel coordinates in the code stream
EG
A
Di

15.6.8 startRadarCalibration
st

 Radar equipment calibration


rib

Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=startRadarCalibration&channel=<Chan
nelNo>&mode=<mode>&direction=<direction>&step=<step>
ut

Method GET
io

Description Calibration of radar equipment


n

Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=startRadarCalibration&channel=1
s.r

&mode=1&direction=1&step=5
Success OK
.o

Return
.

Comment Parameters in URL:


ChannelNo: integer, channel index which starts from 1.
mode: Calibration mode, 0:auto, 1: manual,2:init
direction: Calibration direction, effective in manual mode , 0:invalid, 1:top, 2:bottom,

Other APIs 330


3:left, 4: right, 5: left_top, 6: right_top, 7: left_bottom, 8: right_bottom
step: step size

15.6.9 addRadarLinkSD
Radar link SD added
Da


Request URL http://<server>/cgi-bin/radarAdaptor.cgi?action=addRadarLinkSD
hu

Method GET
Request Params ( key=value format in URL )
aH

Name Type R/O Description Example


Devices array<o 是 Add or update the added device login
TT

bject> information
+PassWord char[32] 是 password, plaintext "admin123"
P

+UserName char[12 是 user name "admin"


AP

8]
+Port integer 是 port 5000
IV

+SDLinkIP char[32] 是 device ip adress "192.168.1.108"


2.

Channel integer 是 video channel, which starts from 1. 1


Request Example
89

http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=addRadarLinkSD&Devices[0].SDLinkIP=10.11.17.
98&Devices[0].Port=5000&Devices[0].Usename=admin&Devices[0].PassWord=admin123&Channel=1
fo
r1

Response Params ( key=value format in body )


Name Type R/O Description Example
00

SD object 是 dome camera


M

+Info object 是 information


++ErrorCode integer 是 errorcode 0
EG

0:normal
A

1:overtime
2:Wrong user name or password
Di

3:The device does not support linkage


st

Response Example
rib

SD.Info.ErrorCode=0
ut
io

15.6.10 delRadarLinkSD
n
s.r

 Remove radar link SD


Request URL http://<server>/cgi-bin/radarAdaptor.cgi?action=delRadarLinkSD
.o

Method GET
.

Request Params ( key=value format in URL )


Name Type R/O Description Example
Devices array<obje 是 Delete the SD added in
ct> radar equipment
Empty array will delete

Other APIs 331


all linkage equipment by
default
+SDLinkIP char[32] 是 device to be deleted "192.168.1.108"
Channel integer 是 video channel, which 1
starts from 1.
Request Example
http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=delRadarLinkSD&Devices[0].SDLinkIP=10.11.17.9
Da

8&Channel=1
hu

Response Params ( key=value format in body )


Name Type R/O Description Example
aH

Response Example
OK
TT
P

15.6.11 [Config]MapPara
AP

map para
IV

Parameter Type Required Description Example


One-dimensional array, with one
2.

MapPara object[] Yes


configuration for each video channel
89

Configuration of radar position on the


+RadarCoordinate object Yes null
map
fo

++RadarDirectionAngle double Yes Configuration of radar direction (°) 70.5


++RadarPixelPoint integer Yes Pixel coordinates of radar on the map [10, 20]
r1

+MapSize object Yes Configuration of map size null


00

Pixel coordinates of line segment in the [[10,10],


++PixelLine integer[][] Yes
image [20,20]]
M

The actual length represented by the


++Distance double Yes 10.1
EG

line segment in the image (m)


Example
A

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MapPara
Di

Appendix: configuration operation method


st

configname and configobject in the following table correspond to specific configuration names and
rib

configuration contents.
special explanation:
ut

In the return of getConfig, there is a "table" level above the specific configuration.
io

In the request of setConfig, there is no "table" level above the specific configuration.
n

 getConfig
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=configName
s.r

Method GET
.o

Request Params ( key=value format in URL )


Name Type R/O Description Example
.

name string R config name MapPara


Request Example
http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name= MapPara

Other APIs 332


Response Params ( key=value format in body )
Name Type R/O Description Example
table object 是 table prefix
+configObject configObject 是 Specific configuration configObject
information
Response Example
table.MapPara[0].RadarCoordinate.RadarDirectionAngle=70.5
Da

table.MapPara[0].RadarCoordinate.RadarPixelPoint[0]=10
table.MapPara[0].RadarCoordinate.RadarPixelPoint[1]=20
hu

table.MapPara[0].MapSize.PixelLine[0][0]=10
table.MapPara[0].MapSize.PixelLine[0][1]=10
aH

table.MapPara[0].MapSize.PixelLine[1][0]=20
table.MapPara[0].MapSize.PixelLine[1][1]=20
TT

table.MapPara[0].MapSize.Distance=10.1
P

table.MapPara[1].RadarCoordinate.RadarDirectionAngle=70.5

AP
IV

 setConfig
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig
2.

Method GET
89

Request Params ( key=value format in URL )


Name Type R/O Description Example
fo

configObject string R Specific configuration configObject


content
r1

Request Example
00

http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&MapPara[0].RadarCoordinate.RadarDirectio
nAngle=70.5&MapPara[0].RadarCoordinate.RadarPixelPoint[0]=10&MapPara[0].RadarCoordinate.Rad
M

arPixelPoint[1]=20&MapPara[0].MapSize.PixelLine[0][0]=10&MapPara[0].MapSize.PixelLine[0][1]=10&
EG

MapPara[0].MapSize.Distance=10.1
A

Response Params ( OK in body )


Di

Name Type R/O Description Example


Response Example
st

OK
rib
ut

15.6.12 [Config]RadarAnalyseRule
io
n

RadarAnalyseRule
Requi
s.r

Parameter Type Description Example


red
.o

Radar alarm linkage configuration


object[][24]
.

RadarAnalys Two-dimensional array. The first dimension


object[][] Yes
eRule indicates video channel, and the second
dimension indicates multiple linkage
configurations.

Other APIs 333


+EventHandl
object Yes Alarm linkage configuration null
er
Whether to record alarm logs. The type is
fixed to EventStart/EventStop/EventPulse
++LogEnable bool Yes false
and the original event type is recorded in
the Detail.Code field in the log.
[["1
Da

00:00:00-23:59:59",
"0
hu

Alarm period. For the definition of alarm


00:00:00-23:59:59",
period, see Dahua Information Exchange
"0
aH

Format.
00:00:00-23:59:59",
++TimeSectio TimeSect TimeSection is used for the filtering of notify
Yes "0
TT

n ion[][] action. No data is sent if it is not within the


00:00:00-23:59:59",
period.
P

"0
All fields except this one are used for
00:00:00-23:59:59",
AP

listener response.
"0
IV

00:00:00-23:59:59",]
]
2.

List of snapshot channel numbers.


89

One-dimensional array. Each member


++SnapshotC
int[] Yes indicates that the corresponding channel [0]
hannels
fo

needs to take snapshot, and the channel


number starts from 0.
r1

++SnapshotE
bool Yes Enable snapshotg false
00

nable
++RecordLat Record delay time (second)
integer Yes 10
M

ch Range [10, 300]


EG

List of record channel numbers.


One-dimensional array. Each member
++RecordCha
A

int[] Yes indicates that the corresponding channel [0]


nnels
needs to record, and the channel number
Di

starts from 0.
st

Record enabling, with RecordChannels.


rib

Record is enabled if it is true; start


++RecordEna
bool Yes recording when the event action is start and false
ut

ble
stop recording when it is stop. Record is
io

disabled if it is false.
++VoiceEnabl
n

bool Yes Voice prompt false


e
s.r

++BeepEnabl
bool Yes Buzzer false
.o

e
++MessageE
.

bool Yes Upload to the alarm center server. false


nable
++MailEnable bool Yes Send email. false
++TipEnable bool Yes Local message box prompt false
++AlarmOutL integer Yes Output delay time (second) after the alarm 10

Other APIs 334


atch output stops.
Range [10, 300]
++AlarmOutE
bool Yes Enable alarm output false
nable
List of alarm output channel numbers.
One-dimensional array. Each member
++AlarmOutC
int[] Yes indicates that the corresponding channel [0]
hannels
Da

needs to output alarm, and the channel


number starts from 0.
hu

+Enable bool Yes Enable alarm enabling false


+AlarmOutNu Alarm configuration number, which is
aH

integer Yes 1
mber unique.
Controlled device IP (which is optional and
TT

+SDLinkIP char[32] No reserved. Ignore this field due to business "192.168.1.108"


P

adjustment).
AP

Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarAnalyseRule
IV

Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method
2.
89

15.6.13 [Config]RadarCalibration
fo

RadarCalibration
r1

Parameter Type Required Description Example


00

Configuration of radar and PTZ


cameras calibration.
M

RadarCalibration object[] Yes One-dimensional array, with one


EG

configuration for each video


channel.
A

+SlopeAngle double Yes Slope compensation angle. 10.0


+InstallHeight double Yes Radar installation height (m). 10.5
Di

+CalibrationParas object[] Yes Calibration parameter. null


st

Vertical compensation angle of


rib

linked PTZ camera.


The range is -90° to 90°; 0° in the
ut

++TiltRecoupAngle double Yes horizontal direction; 0 to 90° 5.0


io

below the horizontal direction;


-90° to 0° above the horizontal
n

direction.
s.r

Installation height of linked PTZ


++LinkSDHeight double Yes 10.5
.o

camera (m).
++CalibrationPos object[] Yes Array of calibration points. null
.

PTZ value (normalized value) of


calibration points.
+++Ptz float[3] Yes [0.95, 0.43, 0.12]
The first element is the horizontal
angle, which is normalized to -1 to

Other APIs 335


1.
The second element is the
vertical angle, which is
normalized to -1 to 1.
The third element is the zoom
times, which is normalized to 0 to
1.
Da

Pixel coordinates of calibration


+++AlarmPixelPoint int[2] Yes [10, 20]
points.
hu

++SDLinkIP char[32] Yes Controlled device IP. "192.168.1.108"


Example
aH

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarCalibration
Note:
TT

Please refer to appendix in chapter 15.6.11 for configuration operation method


P
AP

15.6.14 [Config]RadarGuardLine
IV

RadarGuardLine
2.

Parameter Type Required Description Example


89

Two-dimensional array. The


first dimension indicates video
fo

RadarGuardLine object[][10] Yes channel, and the second


dimension indicates multiple
r1

rule lines (up to 10).


00

Alarm output configuration.


Configure the
M

+AlarmOutNumber integer Yes AlarmOutNumber field 1


EG

according to
RadarAnalyseRule.
A

Target filtering
bit0: Reserved
Di

bit1: Human.
st

+TargetFilter integer Yes 0x01


bit2: Vehicle.
rib

bit3: Animal
(Enable by setting it to 1)
ut

Rule point, pixel coordinates


io

[width, height]. [[0, 0], [128,


+Polygon integer Yes
Range of number of points [3, 128],…,[]]
n

24]
s.r

Rule type, alarm or shield type.


.o

High Alarm
+Type char[32] Yes "Alarm"
Alarm
.

Shield
+Enable bool Yes Whether to enable the rules true
Rule line number
+RegionNumber integer Yes 1
Range [1, 10]

Other APIs 336


Rule name, which cannot be
+Name char[128] Yes "GuardLine1"
repeated.
Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarGuardLine
Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method
Da

15.6.15 [Config]RadarLink
hu

RadarLink
aH

Parameter Type Required Description Example


One-dimensional array, with one configuration for each
TT

RadarLink object[] Yes


video channel
P

+RadarLink bool Yes Enable radar-PTZ linkage true


AP

Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name= RadarLink
IV

Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method
2.
89

15.6.16 [Config]RadarLinkDevice
fo

RadarLinkDevice
r1

Parameter Type Required Description Example


00

Remote device linkage


configuration.
M

object[][24]
EG

Two-dimensional array. The


RadarLinkDevice object[][] Yes
first dimension indicates video
A

channel, and the second


dimension indicates multiple
Di

remote linkage devices.


st

+DeviceName char[128] Yes Device name "Dahua North Gate"


rib

+DeviceType char[32] Yes Device type "200W PTZ camera"


+Vendor char[32] Yes Device source "DH"
ut

+SDLinkIP char[32] Yes Controlled device IP "192.168.1.108"


io

Example
n

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarLinkDevice
Note:
s.r

Please refer to appendix in chapter 15.6.11 for configuration operation method


.o
.

15.6.17 [Config]RadarPara
RadarPara
Parameter Type Required Description Example

Other APIs 337


Radar function configuration.
RadarPara object[] Yes One-dimensional array, with one configuration
for each video channel.
+Sensitivity object No Recognition sensitivity information. null
Optional. Skip if this field does not exist. The
range is -5 to 5; 0 is the default value; the
++Level integer No smaller the value, the higher the human 0
Da

recognition rate; the larger the value, the higher


the vehicle recognition rate.
hu

+TargetRatio object Yes Tracking screen ratio for radar-PTZ linkage. null
Reciprocal of screen ratio.
aH

Required. Calculate the reciprocal. For


++Ratio integer Yes 1
example, when the screen ratio is 0.5, Ratio =
TT

2; when the screen ratio is 0.25, Ratio = 4.


P

+RadarChannel object Yes Radar channel configuration. null


Channel selection.
AP

++Route integer Yes 1: Channel 1 1


IV

2: Channel 2
+Capacity object Yes Configuration of radar transmitting power. null
2.

Radar transmitting power is measured by


++Power integer Yes 300
89

detection distance (m).


+Structured object Yes Structured information configuration null
fo

++TrackDisplayTime integer No Range [1, 30] (s). 5


++TrackType integer No 0: Disable 1: Trajectory box 2: Trajectory 0
r1

++Enable bool Yes Enable structured information display false


00

+Scene object Yes Scene configuration null


Scene selection.
M

1: Default.
EG

++Type integer Yes 2: Shrub. 1


3: Spacious.
A

4: Custom.
Example
Di

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarPara
st

Note:
rib

Please refer to appendix in chapter 15.6.11 for configuration operation method


ut
io

15.6.18 [Config]RadarTrackGlobal
n

RadarTrackGlobal
s.r

Parameter Type Required Description Example


.o

One-dimensional array, with one


RadarTrackGlobal object[] Yes configuration for each video
.

channel
Tracking switching mode
+TrackSwitchMode char[32] Yes Tour/time priority/distance priority "Rotation"
Rotation/TimePriority/DistancePri

Other APIs 338


ority
Tracking switching time (s)
+TrackSwitchTime integer Yes 5
Range [1, 15]
Trajectory time (s)
+TrajectoryTime integer Yes 5
Range [3, 30]
+SectorDisable bool Yes Enable protection area hiding false
Example
Da

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarTrackGlobal
Note:
hu

Please refer to appendix in chapter 15.6.11 for configuration operation method


aH

15.6.19 [Config]RemoteSDLink
TT
P

RemoteSDLink
AP

Parameter Type Required Description Example


Remote device linkage enabling
IV

configuration.
Two-dimensional array. The first
2.

RemoteSDLink object[][24] Yes


dimension indicates video channel, and
89

the second dimension indicates multiple


remote linkage devices.
fo

+RadarLink bool Yes Enable linkage. true


+SDLinkIP char[32] Yes Controlled device IP. "192.168.1.108"
r1

Example
00

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RemoteSDLink
Note:
M

Please refer to appendix in chapter 15.6.11 for configuration operation method


EG
A

15.7 TemperCustom
Di

15.7.1 Set Environment Temperature


st
rib

Syntax http://<server>/cgi-bin/TemperCustom.cgi?action=setEnvTemp
ut

Method GET
Description Set environment temperature
io

[ Request Params ] (key=value format at URL )


n

Name Type R/O Param Description


s.r

EnvironmentTe environment temperature Magnified 100times,the unit is


int R
mp 0.01Celsius degree
.o

[ Response Params ] (key=value format )


.

Name Type R/O Param Description


[ Example ]
http://192.168.1.108/cgi-bin/TemperCustom.cgi?action=setEnvTemp&
Request
EnvironmentTemp=2800

Other APIs 339


Response ok

15.8 GpsControl
Da

15.8.1 getCaps
hu

Get the capability of position system.


aH

Syntax http://<ip>/cgi-bin/GpsControl.cgi?action=getCaps
Method GET
TT

Description Get GpsControl caps.


Example http://192.168.1.108/cgi-bin/ GpsControl.cgi?action=getCaps
P

Success caps. SUPPORTMODE[0]=”GPS”


AP

Return caps. SUPPORTMODE[1]=”BEIDOU”


IV
2.

15.8.2 GPS config


89

 getConfig of position system


fo

Syntax http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=GPS
Method GET
r1

Description Get the config of position system.


00

Example http://192.168.1.108/cgi-bin/global.cgi?action= getConfig&name=GPS


Success Table.GPS[0].Enable[0]=true
M

Return Table.GPS[1].Enable[1]=false
EG

Table.GPS[0].CurMode[0]="GPS"
Table.GPS[1].CurMode[1]="BEIDOU"
A

Table.GPS[0].SyncTime[0]=true
Di

Table.GPS[1].SyncTime[1]=false
st

 setConfig of position system.


rib

Syntax http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[
&<paramName>=<paramValue>...]
ut

Comment In below table, head =GPS


io

Success OK or ERROR
n

Return
s.r

Appendix:
.o

ParamName ParamVal Description


.

ue type
head.Enable bool true/false
head.CurMode string "GPS"/"BEIDOU"
head.SyncTime bool true/false

Other APIs 340


15.9 LensManager

15.9.1 resetAngle
 Reset camera lens angle

URL http://< server >/cgi-bin/LensManager.cgi?action=resetAngle


Da

Method GET
hu

Description Reset camera lens angle


aH

[ Request Params ] ( key=value format at URL )


TT

Name Type R/O Param Description


P

Channel uint R Video channel index which starts from 1.


AP

[ Response Params ] ( OK )
IV

[ Example ]
2.

Request http://172.27.1.153/cgi-bin/LensManager.cgi?action=resetAngle&Channel=1
89

Response OK
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

Other APIs 341


16 AI APIs
16.1 Video Analyse APIs
Da

16.1.1 People Counting


hu
aH

16.1.1.1 Get Summary


TT

Get summary information of people statistics in video.


P

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=getSummary


AP

Method GET
Request Params ( key=value format in URL )
IV

Name Type R/O Description Example


channel int O Video channel index which starts from 1, default is 1. 1
2.

Request Example
89

http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getSummary&channel=1
fo

Response Params ( key=value format in body )


r1

Name Type R/O Description Example


summary object R Summary information of people statistics in video .
00

+Channel int R Video channel index which starts from 0. 1


M

Rule type, it can be: "NumberSta


 "ManNumDetection": count the people num in t"
EG

region, and the detail stat is in "InsideSubtotal"


+RuleName string R param.
A

 "NumberStat": count the people entering and


Di

leaving the region, and the detail stat is in


st

"EnteredSubtotal" and "ExitedSubtotal"param.


rib

+EnteredSubto
object O People enter stat.
tal
ut

++Total int R Total enter num. 14


++Today int R Today enter num. 0
io

++Hour int R This hour enter num. 0


n

++TotalInTime 0
int O Today enter num after call clearSectionStat.
s.r

Section
+ExitedSubtota
.o

object O People leave stat.


l
.

++Total int R Total leave num. 32


++Today int R Today leave num. 0
++Hour int R This hour leave num. 0
++TotalInTime int O Today leave num after call clearSectionStat. 0

AI APIs 342
Section
+InsideSubtota
object O People inside region stat.
l
++Total int R Today inside num. 65
array<obj
++ManStayStat O The entering and leaving stat of people that leaved.
ect>
2012-01-04
+++EnterTime string O People enter time.
Da

00:00:00
2012-01-04
hu

+++ExitTime string O People leave time.


00:00:45
Response Example
aH

summary.Channel=0
summary.RuleName=NumberStat
TT

summary.EnteredSubtotal.Today=0
P

summary.EnteredSubtotal.Total=14
AP

summary.EnteredSubtotal.TotalInTimeSection=0
summary.ExitedSubtotal.Today=0
IV

summary.ExitedSubtotal.Total=32
summary.ExitedSubtotal.TotalInTimeSection=0
2.

summary.InsideSubtotal.Total=65
89

summary.InsideSubtotal.ManStayStat[0].EnterTime=2012-01-04 00:00:00
summary.InsideSubtotal.ManStayStat[0].ExitTime=2012-01-04 00:00:45
fo

summary.InsideSubtotal.ManStayStat[1].EnterTime=2012-01-04 00:00:00
summary.InsideSubtotal.ManStayStat[1].ExitTime=2012-01-04 00:00:45
r1
00

16.1.1.2 Query the Count of People


M

 Start to find
EG

Start to find video stat info, in response, there is a token for further info finding process, and there is
A

a totalCount shows how many data count(s).


Di

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=startFind


st

Method GET
Request Params ( key=value format in URL )
rib

Name Type R/O Description Example


ut

Video channel index which starts from 1, 1


channel int O
default is 1.
io

condition object R Find condition.


n

2012-01-04
+StartTime string R Find time range start
s.r

00:00:00
2012-01-04
.o

+EndTime string R Find time range end


00:02:00
.

The information granularity returned by the Hour


query requirements. The range is { Hour, Day,
+Granularity string R
Week, Month, Season, Year } (Note: Most
devices only support Hour, Day, Week.)

AI APIs 343
Rule type, it can be: NumberStat, NumberStat
+RuleType string O ManNumDetection. If omit, default is
NumberStat
Valid when ruleType is ManNumDetection, 20
+MinStayTime int O
report people stay over this minimal time.
+PlanID int O The plan id, only valid for dome camera. 2
The ptz preset index which starts from 1, only 1
Da

+PtzPresetId int O valid for dome camera. Note: new device


should use PtzPresetId instead of PlanID.
hu

Array<i The area id which starts from 1, max array size [1,2]
+AreaID O
nt> is 20.
aH

The other search rule, can be : AverageStayTime


+OtherRule string O
AverageStayTime
TT

Request Example
P

http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=startFind&channel=1&condition.StartTime=201
AP

1-01-01%2012:00:00&condition.EndTime=2011-01-10%2012:00:00&condition.Granularity=Hour&condit
ion.RuleType=NumberStat&condition.MinStayTime=20&condition.AreaID[0]=2&condition.AreaID[1]=3
IV

Response Params ( key=value format in body )


2.

Name Type R/O Description Example


89

Token for this search, use this token to get result 12345
token int R
and stop search.
fo

totalCount int R Number of find result. 56


r1

Response Example
token=12345
00

totalCount=56
M

 Get the find result


EG

Get the find result of Video Stat info with channel, token, begin Number and count.
A

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=doFind


Method GET
Di

Request Params ( key=value format in URL )


st

Name Type R/O Description Example


rib

Video channel index which starts from 1, 1


channel int O default is 1.
ut

NOTE: must be the same as startFind.


Token for this search, use this token to get 12345
io

token int R
result and stop searching.
n

The start count. It must be between 0 and 0


s.r

beginNumber int R
totalCount -1.
count int R The count of info for this query. 20
.o

Request Example
.

http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=doFind&channel=1&token=12345&beginNumb
er=0&count=20

Response Params ( key=value format in body )

AI APIs 344
Name Type R/O Description Example
found int R Number of result that return. 20
array<obj
info R Result information of video Stat.
ect>
+Channel int R Video channel index which starts from 0. 0
+PlanID int O The plan id, only valid for dome camera. 2
The ptz preset index which starts from 1, only valid 1
+PtzPresetId int O
Da

for dome camera.


+AreaID int O The area id which starts from 1. 3
hu

The average stay time, only valid when startFind 20


+AverageStayT
int O with OtherRule param’s value is
aH

ime
“AverageStayTime”.
Rule name, it can be: NumberStat
TT

 "ManNumDetection": count people num in


P

region, detail stat is in "InsideSubtotal"param


+RuleName string R
AP

 "NumberStat": count people enter and leave


region, detail stat is in "EnteredSubtotal"and
IV

"ExitedSubtotal"param.
2012-01-04
2.

+StartTime string O Find time range start


00:00:00
89

2012-01-04
+EndTime string O Find time range end
00:02:00
fo

+EnteredSubto 14
int O Total enter num.
tal
r1

+ExitedSubtota 5
int O Total leave num.
00

l
+InsideSubtota 65
M

int O Total inside num.


l
EG

Response Example
found=20
A

info[0].Channel=0
info[0].AreaID=2
Di

info[0].RuleName=NumberStat
st

info[0].StartTime=2012-03-14 00:00:00
rib

info[0].EndTime=2012-04-14 00:00:00
info[0].EnteredSubtotal=14
ut

info[0].ExitedSubtotal=5
io

info[0].InsideSubtotal=65
info[1].Channel=0
n

info[1].AreaID=3
s.r

info[1].RuleName=NumberStat
.o

info[1].StartTime=2012-03-14 00:00:00
info[1].EndTime=2012-04-14 00:00:00
.

info[1].EnteredSubtotal=14
info[1].ExitedSubtotal=5
info[1].InsideSubtotal=65

AI APIs 345
 Stop the searching session
Stop query video stat by channel and token.

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=stopFind


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Da

Video channel index which starts from 1, 1


channel int O default is 1.
hu

NOTE: must be the same as startFind.


Token for this search, use this token to get 12345
aH

token int R
result and stop searching.
Request Example
TT

GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=stopFind&channel=1&token=12345
P
AP

Response Params ( OK in body )


Response Example
IV

OK
2.

16.1.1.3 Clear the People Count Information


89

Clear the people count information.


fo
r1

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=clearSectionStat


Method GET
00

Request Params ( key=value format in URL )


Name Type R/O Description Example
M

Video channel index which starts from 1, 1


channel int O
EG

default is 1.
Request Example
A

GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=clearSectionStat&channel=1
Di
st

Response Params ( OK in body )


Response Example
rib

OK
ut
io

16.1.1.4 Subscribe the People Count Information


n

Subscribe the people count information.


s.r

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=attach


.o

Method GET
.

Request Params ( key=value format in URL )


Name Type R/O Description Example
Video channel index which starts from 1, 1
channel int O
default is 1.
heartbeat int O Send heartbeat interval, range is [1, 60],unit is 5

AI APIs 346
second. If the URL contains this parameter,
and the value is 5, it means every 5 seconds
the device should send the heartbeat message
to the client, the heartbeat message is an
string "Heartbeat". If this parameter is not
present, its default value is 60.
Request Example
Da

http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=attach&channel=1&heartbeat=5
hu

Response Params ( key=value format in body )


aH

Name Type R/O Description Example


summary object R Summary information of video Stat.
+Channel int R Video channel index which starts from 0. 0
TT

Rule type, it can be: NumberStat


P

 "ManNumDetection": Count people num in


AP

region, detail stat is in "InsideSubtotal" param.


+RuleName string R
 "NumberStat": Count people entering and
IV

leaving region, detail stat is in


"EnteredSubtotal" and "ExitedSubtotal" param.
2.

+EnteredSubto
object O People enter stat.
89

tal
++Total int R Total enter num. 14
fo

++Today int R Today enter num. 2


r1

++Hour int R This hour enter num. 1


++TotalInTime 0
int O Today enter num after call clearSectionStat.
00

Section
+ExitedSubtota
M

object O People leave stat.


l
EG

++Total int R Total leave num. 32


++Today int R Today leave num. 3
A

++Hour int R This hour leave num. 2


Di

++TotalInTime 0
int O Today leave num after call clearSectionStat.
Section
st

+InsideSubtota
rib

object O People inside region stat.


l
++Total int R Today inside num. 65
ut

array<obj
++ManStayStat O The entering and leaving stat of people that leaved.
io

ect>
n

2012-01-04
+++EnterTime string O People enter time
s.r

00:00:00
2012-01-04
+++ExitTime string O People leave time
.o

00:00:45
.

Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

AI APIs 347
--<boundary>
Content-Type: text/plain
Content-Length: <length>

summary.Channel=0
summary.RuleName=NumberStat
Da

summary.EnteredSubtotal.Today=2
summary.EnteredSubtotal.Total=14
hu

summary.EnteredSubtotal.TotalInTimeSection=1
summary.ExitedSubtotal.Today=3
aH

summary.ExitedSubtotal.Total=32
summary.ExitedSubtotal.TotalInTimeSection=2
TT

summary.InsideSubtotal.Total=65
P

summary.InsideSubtotal.ManStayStat[0].EnterTime=2012-01-04 00:00:00
summary.InsideSubtotal.ManStayStat[0].ExitTime=2012-01-04 00:00:45
AP

summary.InsideSubtotal.ManStayStat[1].EnterTime=2012-01-04 00:00:00
IV

summary.InsideSubtotal.ManStayStat[1].ExitTime=2012-01-04 00:00:45
--<boundary>
2.

Content-Type: text/plain
89

Content-Length: 11
fo

Heartbeat
--<boundary>
r1

Content-Type: text/plain
00

Content-Length: <length>
M

summary.Channel=0
EG

summary.RuleName=NumberStat
summary.EnteredSubtotal.Today=2
A

summary.EnteredSubtotal.Total=14

Di
st

16.1.1.5 [Event] NumberStat


rib
ut

Table 16-1
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
io

Description When people number triggers the rule, send this event.
n

[ Event Params ] ( JSON format )


s.r

Name Type R/O Param Description


Number int R Total number in detect region.
.o

EnteredNumber int R Total number that enter the detect region.


.

ExitedNumber int R Total number that leave the detect region.


Number overrun type, it can be: "EnterOver", "ExitOver",
Type string R
"InsideOver".
AreaID int O The area id, begin from 1, if omit, means single area.

AI APIs 348
PresetID int O The preset id, if omit, means preset is unknown.
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=NumberStat;action=Start;index=0;data={
Da

"Number": 120,
Event
"EnteredNumber": 180,
hu

"ExitedNumber": 60,
aH

"Type": "EnterOver",
"Area": 2
}
TT

--<boundary>
P
AP

16.1.1.6 [Event] ManNumDetection


IV

Table 16-2
2.

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When people number triggers the rule, send this event.
89

[ Event Params ] ( JSON format )


Name Type R/O Param Description
fo

Array<obje
r1

ManList R The people info list.


ct>
The detected people bounding box, 4 interge, refer to x's value
00

of left-top point, y's value of left-top point, x's value of


+BoundingBox Array<int> R
M

right-bottom point, y's value of right-bottom point. Coordinate


remap to 0 — 8192.
EG

+Stature int R The people's stature, unit is cm.


A

AreaID int O The area id, begin from 1, if omit, means single area.
PresetID int O The preset id, if omit, means preset is unknown.
Di

[ Example ]
st

--<boundary>
rib

Content-Type: text/plain
Content-Length: <length>
ut
io

Code=ManNumDetection;action=pulse;index=0;data={
Event "ManList": [ { "BoundingBox": [2992,1136,4960,5192], "Stature": 170 },
n

{ "BoundingBox": [4392,4136,6960,6512], "Stature": 175 },


s.r

{…}, … ],
.o

"AreaID" : 2
}
.

--<boundary>

AI APIs 349
16.1.1.7 [Event] CrowdDetection

Table 16-3
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Description When crowd density overrun, send this event.
[ Event Params ] ( JSON format )
Da

Name Type R/O Param Description


Array<obje
CrowdList O The global crowd density overrun list.
hu

ct>
The center point, must be two int, means x and y value,
aH

+Center Array<int> R
coordinate remap to 0 — 8192.
+Radius int R The radius length.
TT

Array<obje
RegionList O The people num overrun region list.
ct>
P

+RegionID int R The region index.


AP

+PeopleNum int R The people count in region.


IV

[ Example ]
--<boundary>
2.

Content-Type: text/plain
89

Content-Length: <length>
fo

Event Code=CrowdDetection;action=start;index=0;data={
"CrowdList": [ { "Center" : [5734,2377],"Radius" : 10}, …{} ],
r1

"RegionList" : [ { "RegionID" : 0, "PeopleNum" : 100 },…{} ]


}
00

--<boundary>
M

16.1.2 FaceRecognitionServer
EG
A

16.1.2.1 Create Face Group


Di
st

Table 16-4
rib

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=createGroup
Method GET
ut

Description Create a face group.


io

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
n

groupName string R The face group name, max string length is 127.
s.r

The description detail of the face group, max string length is


groupDetail string O
.o

255.
[ Response Params ] ( key=value format )
.

Name Type R/O Param Description


groupID string R The identity of the created face group, max string length is 63.
[ Example ]
Request GET

AI APIs 350
http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=createGroup&groupName
=Test1&groupDetail=ForTest1
Response groupID=10000

16.1.2.2 Modify Face Group


Da

Table 16-5
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyGroup
hu

Method GET
Description Modify a face group.
aH

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
TT

groupID string R The identity of the face group, max string length is 63.
groupName string R The name of the the face group, max string length is 127.
P

groupDetail string O Description detail of the face group, max string length is 255.
AP

[ Response Params ] ( OK )
IV

[ Example ]
GET
2.

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=modifyGroup&groupID=10
89

000&groupName=Test1&groupDetail=ForTest1
Response OK
fo
r1

16.1.2.3 Delete Face Group


00

Table 16-6
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deleteGroup
M

Method GET
EG

Description Delete a face group.


[ Request Params ] ( key=value format at URL )
A

Name Type R/O Param Description


Di

groupID string R The identity of the face group, max string length is 63.
st

[ Response Params ] ( OK )
rib

[ Example ]
GET
ut

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deleteGroup&groupID=100
00
io

Response OK
n
s.r

16.1.2.4 Deploy Face Group


.o

There are two ways to deploy the group. One is based on the group (putDisposition), and the
.

another one is based on the channel (setGroup).


 Put disposition to group

Table 16-7

AI APIs 351
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=putDisposition
Method GET
Deploy the face group to some video channels. If the video channel has been deployed
Description
already, it will change the similary.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
groupID string R The identity of the face group, max string length is 63.
Da

list Array<object> R List of disposition info.


+channel int R Video channel index which starts from 1.
hu

+similary int R The threshold of the face similary, 0 — 100.


aH

[ Response Params ] ( key=value format )


Name Type R/O Param Description
TT

report array<bool> R Result of putting disposition for each request channel.


[ Example ]
P

GET
AP

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=putDisposition&groupID=1
0000&list[0].channel=1&list[0].similary=80&list[1].channel=2&list[1].similary=70
IV

report[0]=true
Response
report[1]=false
2.

 Delete some disposition from group


89

Table 16-8
fo

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deleteDisposition
Method GET
r1

Descripti
Remove the deployment of face group from some video channels.
00

on
[ Request Params ] ( key=value format at URL )
M

Name Type R/O Param Description


EG

groupID string R The identity of the face group, max string length is 63.
channel Array<int> R Video channel index which starts from 1.
A

[ Response Params ] ( key=value format )


Di

Name Type R/O Param Description


report array<bool> R Result of deleting disposition for each request channel.
st

[ Example ]
rib

GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deleteDisposition&groupID
ut

=10000&channel[0]=1&channel[1]=2
io

report[0]=true
Response
n

report[1]=false
s.r

 set disposition group to channel


.o

Table 16-9
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=setGroup
.

Method GET
Deploy some face groups to one video channel. If the video channel has been deployed
Descripti
already, it will change the similary.
on
Note: This method will do an overwrite operation.

AI APIs 352
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
channel int R Video channel index which starts from 1.
List of disposition info, if not exist, remove all disposition from
list Array<object> O
channel.
+groupID int R The identity of the face group, max string length is 63.
+similary int R The threshold of the face similary, 0 — 100.
Da

[ Response Params ] ( OK )
[ Example ]
hu

GET
aH

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=setGroup&channel=1&list
[0].groupID=10000&list[0].similary=80&list[1].groupID=10002&list[1].similary=75
TT

Response OK
 get disposition group from channel
P

Table 16-10
AP

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=getGroup
IV

Method GET
Get the Deployment about the video channel.
Descripti
2.

Note: If the video channel does not deploy any group, then the response will be success
on
89

with empty http body.


[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


channel int R Video channel index which starts from 1.
r1

[ Response Params ] (key=value format)


00

Name Type R/O Param Description


groupID Array<int> R The identity of the face group, max string length is 63.
M

similary Array<int> R The threshold of the face similary, 0 — 100.


EG

[ Example ]
Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=getGroup&channel=1
A

groupID[0]=10001
Di

groupID[1]=10003
groupID[2]=10006
st

….
rib

Response
similary[0]=80
similary[1]=75
ut

similary[2]=85
io

….
n
s.r

16.1.2.5 Find Face Group


.o

Table 16-11
.

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=findGroup
Method GET
Description Find the face group. If the groupID is not present in the URL, it will return all the groups.
[ Request Params ] ( key=value format at URL )

AI APIs 353
Name Type R/O Param Description
groupID string O The identity of the face group, max string length is 63.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
GroupList Array<object> R The face group information list.
+groupID string R The identity of the face group, max string length is 63.
+groupName string R Name of the face group, max string length is 127.
Da

+groupDetail string O Description detail of the face group, max string length is 255.
+groupSize int R The number of face in this face group.
hu

+channels Array<int> O Video channel index which starts from 0.


aH

+similarity Array<int> O The threshold of the face similary.


+groupType string O The type of face group
TT

Array<Array<s
+TimeSection O The time section of face group
tring>>
P

[ Example ]
AP

Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=findGroup


GroupList[0].groupID=00001
IV

GroupList[0].groupName=Test1
GroupList[0].groupDetail=ForTest1
2.

GroupList[0].groupSize=30
89

GroupList[0].channels[0]=1
GroupList[0].channels[1]=2
fo


r1

GroupList[0].similarity[0]=80
GroupList[0].similarity[1]=75
00


GroupList[0].groupType=BlackListDB
M

GroupList[0].TimeSection[0][0]=1 00:00:00-23:59:59
EG

GroupList[0].TimeSection[0][1]=0 00:00:00-23:59:59
GroupList[0].TimeSection[0][2]=0 00:00:00-23:59:59
A

GroupList[0].TimeSection[0][3]=0 00:00:00-23:59:59
Di

Response GroupList[0].TimeSection[0][4]=0 00:00:00-23:59:59


st

GroupList[0].TimeSection[0][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][0]=1 00:00:00-23:59:59
rib

GroupList[0].TimeSection[1][1]=0 00:00:00-23:59:59
ut

GroupList[0].TimeSection[1][2]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][3]=0 00:00:00-23:59:59
io

GroupList[0].TimeSection[1][4]=0 00:00:00-23:59:59
n

GroupList[0].TimeSection[1][5]=0 00:00:00-23:59:59
s.r

GroupList[0].TimeSection[2][0]=1 00:00:00-23:59:59
GroupList[0].TimeSection[2][1]=0 00:00:00-23:59:59
.o

GroupList[0].TimeSection[2][2]=0 00:00:00-23:59:59
.

GroupList[0].TimeSection[2][3]=0 00:00:00-23:59:59
GroupList[0].TimeSection[2][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[2][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[3][0]=1 00:00:00-23:59:59
GroupList[0].TimeSection[3][1]=0 00:00:00-23:59:59

AI APIs 354
GroupList[0].TimeSection[3][2]=0 00:00:00-23:59:59
GroupList[0].TimeSection[3][3]=0 00:00:00-23:59:59
GroupList[0].TimeSection[3][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[3][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[4][0]=1 00:00:00-23:59:59
GroupList[0].TimeSection[4][1]=0 00:00:00-23:59:59
GroupList[0].TimeSection[4][2]=0 00:00:00-23:59:59
Da

GroupList[0].TimeSection[4][3]=0 00:00:00-23:59:59
GroupList[0].TimeSection[4][4]=0 00:00:00-23:59:59
hu

GroupList[0].TimeSection[4][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][0]=1 00:00:00-23:59:59
aH

GroupList[0].TimeSection[5][1]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][2]=0 00:00:00-23:59:59
TT

GroupList[0].TimeSection[5][3]=0 00:00:00-23:59:59
P

GroupList[0].TimeSection[5][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][5]=0 00:00:00-23:59:59
AP

GroupList[0].TimeSection[6][0]=1 00:00:00-23:59:59
IV

GroupList[0].TimeSection[6][1]=0 00:00:00-23:59:59
GroupList[0].TimeSection[6][2]=0 00:00:00-23:59:59
2.

GroupList[0].TimeSection[6][3]=0 00:00:00-23:59:59
89

GroupList[0].TimeSection[6][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[6][5]=0 00:00:00-23:59:59
fo

GroupList[1].groupID=00003
r1

GroupList[1].groupName=Test3
00

GroupList[1].groupDetail=ForTest3
GroupList[1].groupSize=50
M

GroupList[1].channels[0]=1
EG

GroupList[1].channels[1]=2

A

GroupList[1].similarity[0]=70
GroupList[1].similarity[1]=85
Di


st
rib

16.1.2.6 Re-Abstract Feature By Group


ut

 Start ReAbstract
io

Table 16-12
n

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=groupReAbstract
s.r

Method GET
Abstract features for the groups.
.o

Description About the process of the re-extract, the device will use an event named
.

"FaceFeatureAbstract" to report the process.


[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
groupID Array<int> R The identity of the face group, max string length is 63.

AI APIs 355
[ Response Params ] (key=value format)
Name Type R/O Param Description
token int R The identity of this operation.
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=groupReAbstract&groupID[
0]=10000&groupID[1]=10001
Da

Response token=12345
Stop ReAbstract
hu

Table 16-13
aH

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopGroupReAbstract
Method GET
TT

Descripti
Stop the abstract features process.
on
P

[ Request Params ] ( key=value format at URL )


AP

Name Type R/O Param Description


IV

token int R The identity of this operation.


[ Response Params ] ( OK )
2.

[ Example ]
89

GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=stopGroupReAbstract&tok
fo

en=12345
Response OK
r1
00

16.1.2.7 Add Person


M

Table 16-14
EG

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=addPerson
Method POST
A

Description Add a person to a group.


Di

[ Request Params ] ( key=value format in URL )


st

Name Type R/O Param Description


rib

The identity of the face group that this person to add. Max string
groupID string R
length is 63.
ut

name string R The person name, max string length is 63.


birthday string O The person's birthday, ex: "1980-01-01".
io

sex string O Sex, it can be "Male", "Female", "Unknown".


n

The country name, length must be 2, and value should be


s.r

country string O
according to ISO3166.
province string O The province name, max string length is 63.
.o

city string O The city name, max string length is 63.


.

The certificate type. It can be: "IC', "Passport", "Military",


certificateType string O
"Unknown".
id string O The ID of certificate type, max string length is 31.
[ Response Params ] (key=value format )

AI APIs 356
Name Type R/O Param Description
uid string R The id for this Person, max string length is 31.
[ Example ]
POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=addPerson&groupID=10000&na
me=ZhangSan&birthday=1980-01-05&sex=Male&country=CN&province=ZheZhang&city=
Hangzhou HTTP/1.1
Da

Request
Content-Type: image/jpeg
Content-Length: <image size>
hu
aH

<JPEG image data>


Response uid=0005
TT

16.1.2.8 Modify Person


P
AP

Table 16-15
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyPerson
IV

Method POST
2.

Modify a person's info.


89

Note: If you do not want to change the image about the person, the request should not
Description
contain the image data.
Note: You should provide at lease one optional param to update.
fo

[ Request Params ] ( key=value format in URL )


r1

Name Type R/O Param Description


uid string R The identity of the Person, max string length is 31.
00

The identity of the Face Group that this Person in. max string
groupID string R
M

length is 63.
name string O The person's name, max string length is 63.
EG

birthday string O The person's birthday, ex: "1980-01-01".


A

sex string O Sex, it can be "Male", "Female", "Unknown".


The country name, length must be 2, and value should be
Di

country string O
according to ISO3166.
st

province string O The province name, max string length is 63.


rib

city string O The city name, max string length is 63.


The certificate type. It can be: "IC', "Passport", "Military",
ut

certificateType string O
"Unknown".
io

id string O The ID of certificate type, max string length is 31.


n

[ Response Params ] ( OK )
[ Example ]
s.r

POST
.o

http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyPerson&uid=0005&grou
.

pID=10000&name=ZhangSan&birthday=1980-01-05&sex=Male&country=CN&province=
Request ZheZhang&city=Hangzhou HTTP/1.1
Content-Type: image/jpeg
Content-Length: <image size>

AI APIs 357
<JPEG image data>
Response OK

16.1.2.9 Delete Person

Table 16-16
Da

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deletePerson
Method GET
hu

Description Delete a person from a group.


[ Request Params ] ( key=value format in URL )
aH

Name Type R/O Param Description


uid string R The identity of the person, max string length is 31.
TT

The identity of the face group that this Person in. max string
groupID string R
length is 63.
P

[ Response Params ] ( OK )
AP

[ Example ]
IV

GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deletePerson&uid=001&gr
2.

oupID=10000
89

Response OK
fo

16.1.2.10 Find Person


r1

 Start to find
00

Table 16-17
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFind
M

Method GET
EG

Start to find person in face groups.


Description
Note: the returned token will be expired after 60 seconds without any doFind call.
A

[ Request Params ] ( key=value format in URL )


Di

Name Type R/O Param Description


st

condition Object R Search scope condition.


rib

+GroupID Array<string> R The list of identity of the face group, max string length is 63.
person object O Person condition.
ut

+Name string O Person Name, max string length is 63.


+Sex string O Sex, it can be "Male", "Female", "Unknown".
io

string O Country name, length must be 2, and value should be


n

+Country
according to ISO3166.
s.r

+Province string O Province name, max string length is 63.


+City string O City name, max string length is 63.
.o

string O Certificate Type. It can be: "IC', "Passport", "Military",


.

+CertificateType
"Unknown".
+ID string O Person ID of CertificateType, max string length is 31.
+FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.
[ Response Params ] ( key=value format )

AI APIs 358
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.
totalCount int R Result num, return -1 means still searching.
[ Example ]
GET
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFind&condition.GroupID[0]
Da

Request
=10000&condition.GroupID[1]=10003&person.Sex=Male&person.Country=CN&person.F
eatureState=1
hu

token=123456789
Response
aH

totalCount=24
 Get find result
TT

Table 16-18
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFind
P

Method GET
AP

Descripti Get one result of person's information from the search result set.
on Note: the returned token will be expired after 60 seconds without any doFind call.
IV

[ Request Params ] ( key=value format in URL )


2.

Name Type R/O Param Description


89

Token for this search, use this token to get result and stop
token uint R
search.
fo

The index in search result, should between 0 and totalCount


index uint R
–1.
r1

[ Response Params ] ( JSON format )


00

Name Type R/O Param Description


person object R Person condition.
M

+UID string R The identity of the person, max string length is 31.
EG

string R The identity of the face group that this Person in. max string
+GroupID
length is 63.
A

+Name string R The person name, max string length is 63.


Di

+Sex string O Sex, it can be "Male", "Female", "Unknown".


+Birthday string O The person's birthday, ex: "1980-01-01".
st

string O Country name, length must be 2, and value should be


rib

+Country
according to ISO3166.
+Province string O Province name, max string length is 63.
ut

+City string O City name, max string length is 63.


io

string O Certificate Type, can be: "IC', "Passport", "Military",


+CertificateType
n

"Unknown".
s.r

+ID string O Person ID of CertificateType, max string length is 31.


+FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.
.o

[ Example ]
.

GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFind&token=123456789&in
dex=0
HTTP/1.1 200 OK
Response
Server: Device/1.0

AI APIs 359
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Content-Length: <length>

--<boundary>
Content-Type: text/plain
Content-Length: <length>
Da

person.UID=0005
person.GroupID=10000
hu

person.Name=ZhangSan
person.Birthday=1980-01-01
aH

person.Sex=Male
person.Country=CN
TT

person.Province=ZheJiang
P

person.City=HangZhou
person.CertificateType=IC
AP

person.ID=1234567890
IV

person.FeatureState=0
--<boundary>
2.

Content-Type: image/jpeg
89

Content-Length: <image size>


fo

< jpeg image data ... >


r1

--<boundary>--
 Stop finding
00

Table 16-19
M

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFind
Method GET
EG

Descripti
Stop the search session.
on
A

[ Request Params ] ( key=value format in URL )


Di

Name Type R/O Param Description


st

The token for this search, use this token to get result and stop
token uint R
rib

search.
[ Response Params ] ( OK )
ut

[ Example ]
GET
io

Request
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFind&token=123456789
n

Response OK
s.r
.o

16.1.2.11 Re-Abstract Features By Person


.

 Start ReAbstract

Table 16-20
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=reAbstract
Method GET

AI APIs 360
Abstract features for the persons.
Description About the process of the re-extract, the device will use an event named
"FaceFeatureAbstract"to report the process.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
UID Array<int> O The list of identity of person, max string length is 31.
[ Response Params ] ( OK )
Da

[ Example ]
GET
hu

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=reAbstract&uid[0]=001&ui
aH

d[1]=002
Response OK
TT

 Stop ReAbstract
P

Table 16-21
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopReAbstract
AP

Method GET
IV

Descripti
Stop the abstract features process.
on
2.

[ Request Params ] ( None )


89

[ Response Params ] ( OK )
[ Example ]
fo

Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=stopReAbstract


Respons
r1

OK
e
00

16.1.2.12 [Config] Face Recognition AlarmOut Setting


M
EG

 Get FaceRecognitionAlarm config

Table 16-22
A

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionAlar
URL
Di

m
st

Method GET
Description Get the Face Recognition Alarm Out Setting.
rib

[ Request Params ] ( None )


ut

[ Response Params ] ( key=value format )


Name Type R/O Param Description
io

table object R Config info table.


n

+FaceRecognitio
array<object> R Each face group has one config object in this array.
s.r

nAlarm
++GroupID String R The face group ID, max string length is 63.
.o

++GroupName String R The face group name, max string length is 127.
.

++AlarmOutEna
Bool R Enable AlarmOut or not.
ble
++AlarmChannel Array<object> R Each AlarmOut channel has one config object in this array.

AI APIs 361
Alarm rule mask.
+++AlarmRuleM
Int R  Bit 0 : recognition success
ask
 Bit 1 : recognition failed
+++AlarmOutLat
Int R Alarm out delay, unit is second, value between 1 anf 300.
ch
[ Example ]
GET
Da

Request http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionAlar
m
hu

table.FaceRecognitionAlarm[0].GroupID=0017
aH

table.FaceRecognitionAlarm[0].GroupName=wsd
table.FaceRecognitionAlarm[0].AlarmOutEnable=true
table.FaceRecognitionAlarm[0].AlarmChannel[0].AlarmRuleMask=0
TT

table.FaceRecognitionAlarm[0].AlarmChannel[0].AlarmOutLatch=5
P

table.FaceRecognitionAlarm[0].AlarmChannel[1].AlarmRuleMask=0
AP

table.FaceRecognitionAlarm[0].AlarmChannel[1].AlarmOutLatch=8

Response
IV

table.FaceRecognitionAlarm[1].GroupID=0018
table.FaceRecognitionAlarm[1].GroupName=cst
2.

table.FaceRecognitionAlarm[1].AlarmOutEnable=true
89

table.FaceRecognitionAlarm[1].AlarmChannel[0].AlarmRuleMask=0
table.FaceRecognitionAlarm[1].AlarmChannel[0].AlarmOutLatch=10
fo

table.FaceRecognitionAlarm[1].AlarmChannel[1].AlarmRuleMask=0
table.FaceRecognitionAlarm[1].AlarmChannel[1].AlarmOutLatch=15
r1


00

 Set FaceRecognitionAlarm config


URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
M

Method GET
EG

Descripti
Set the Face Recognition Alarm Out Setting.
on
A

[ Request Params ] ( key=value format at URL )


Di

Name Type R/O Param Description


FaceRecognition
st

array<object> R Each face group has one config object in this array.
Alarm
rib

+GroupID String R The face group ID, max string length is 63.
+GroupName String R The face group name, max string length is 127.
ut

+AlarmOutEnabl
io

Bool R Enable AlarmOut or not.


e
n

+AlarmChannel Array<object> R Each AlarmOut channel has one config object in this array.
s.r

Alarm rule mask.


++AlarmRuleMa
Int R  Bit 0 : recognition success
.o

sk
 Bit 1 : recognition failed
.

++AlarmOutLatc
Int R Alarm out delay, seconds, value between 1 and 300.
h
[ Response Params ] ( OK )
[ Example ]

AI APIs 362
GET
http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&FaceRecognitionAlarm[0].Gr
Request oupID=0017&FaceRecognitionAlarm[0].GroupName=wsd&FaceRecognitionAlarm[0].Ala
rmOutEnable=true&FaceRecognitionAlarm[0].AlarmChannel[0].AlarmRuleMask=0&Face
RecognitionAlarm[0].AlarmChannel[0].AlarmOutLatch=5
Response OK
Da

16.1.2.13 Find Person by Picture


hu

 Start to find
aH

Table 16-23
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindByPic
TT

Method POST
Start to find person in face groups by picture. The search may last for some time, so the
P

response may push at regular intervals until 100% Progress


AP

Description Note: If you want to find person in face groups by person info, see above "Find
Person"API.
IV

Note: The returned token will be expired after 60 seconds without any doFind call.
2.

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
89

GroupID array<string> R Face groups to find, max string length is 63.


fo

Similarity int R Similarity percent, 1 — 100.


MaxCandidate int O Max Candidate result number.
r1

[ Response Params ] ( JSON format )


Name Type R/O Param Description
00

The token of this search, use this token to get result and stop
token uint R
M

search.
EG

progress uint R Search Progress, 100 means finished.


totalCount int R Result num, return -1 means still searching.
A

[ Example ]
POST
Di

http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindByPic&GroupID[0]=0000
st

1&GroupID[1]=00003&Similarity=80&MaxCandidate=500
rib

Request Content-Type: image/jpeg


Content-Length: <image size>
ut
io

<JPEG data>
n

HTTP/1.1 200 OK
Server: Device/1.0
s.r

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


.o

Connection: closed
Respons
.

e
--<boundary>
Content-Type: application/json
Content-Length: <length>

AI APIs 363
{ "token": 123456789,
"progress": 20
"totalCount": -1
}
--<boundary>
Content-Type: application/json
Content-Length: <length>
Da

{ "token": 123456789,
hu

"progress": 60
"totalCount": -1
aH

}
--<boundary>
TT

Content-Type: application/json
P

Content-Length: <length>
AP

{ "token": 123456789,
IV

"progress": 100
"totalCount": 350
2.

}
89

--<boundary>--
 Get the find result
fo

Table 16-24
r1

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindByPic
Method GET
00

Get the find result, reply using multipart format, first part is json string to describe all
M

Descripti candidate person, then the following parts are the person's pictures, refer by UID and
on GroupID in part header Content-Info.
EG

Note: the returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
A

Name Type R/O Param Description


Di

Token for this search, use this token to get result and stop
token uint R
st

search.
rib

The index in search result, should between 0 and totalCount


index uint R
–1.
ut

count uint R Number of result person to get.


[ Response Params ] ( JSON format )
io

Name Type R/O Param Description


n

Found int R Number of result person that return.


s.r

Candidates Array<object> R Candidates Person.


.o

+Person object R Person Info.


++UID string R System id for this Person, max string length is 31.
.

The identity of the Face Group that this Person in. max string
++GroupID string R
length is 63.
++Name string R Person Name, max string length is 63.
++Birthday string O Birthday ex: "1980-01-01".

AI APIs 364
++Sex string O Sex, it can be "Male", "Female", "Unknown".
Country name, length must be 2, value should be according
++Country string O
to ISO3166.
++Province string O Province name, max string length is 63.
++City string O City name, max string length is 63.
++CertificateTy Certificate Type. It can be "IC', "Passport", "Military" or
string O
pe "Unknown".
Da

++ID string O Person ID of CertificateType, max string length is 31.


++FeatureStat
hu

int O Feature State, 0:Unknown, 1:Failed, 2:OK.


e
aH

+Similarity int R Similarity.


[ Example ]
TT

GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindByPic&token=12345678
P

9&index=0&count=10
AP

HTTP/1.1 200 OK
Server: Device/1.0
IV

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


Connection: closed
2.
89

--<boundary>
Content-Type: application/json
fo

Content-Length: <length>
r1

{ "Found" : 10,
00

"Candidates" : [
{
M

"person" : {
EG

"UID" : "0001",
"GroupID" : "001",
A

"Name" : "ZhangSan",
Response
Di

"Birthday" : "1980-01-05",
"Sex" : "Male",
st

...
rib

},
"Similarity" : 85
ut

},
io

{
n

"person" : {
s.r

"UID" : "0002",
"GroupID" : "002",
.o

"Name" : "LiSi",
.

"Birthday" : "1980-01-06",
"Sex" : "Male",
...
},
"Similarity" : 80

AI APIs 365
},
{ ... }, ...
]
}
--<boundary>
Content-Info: UID=0001&GroupID=001
Content-Type: image/jpeg
Da

Content-Length: <length>
hu

< jpeg image data ... >


aH

--<boundary>
Content-Info: UID=0002&GroupID=002
Content-Type: image/jpeg
TT

Content-Length: <length>
P

< jpeg image data ... >


AP

--<boundary>
IV

...
 Stop finding
2.

Table 16-25
89

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindByPic
Method GET
fo

Descripti
Stop the search session.
r1

on
[ Request Params ] ( key=value format in URL )
00

Name Type R/O Param Description


M

Token for this search, use this token to get result and stop
token uint R
search.
EG

[ Response Params ] ( OK )
A

[ Example ]
GET
Di

Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindByPic&token=12345678
st

9
rib

Response OK
ut

16.1.2.14 Find History Person by Picture


io

 Start to find
n
s.r

Table 16-26
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindHistoryByPic
.o

Method POST
.

Start to find person in capture history by picture. The search may last for some time, so
the response may push at regular intervals until 100% Progress.
Description Note: If you want to find person in capture history by person info, please refer to
"mediaFileFind"API.
Note: the returned token will be expired after 60 seconds without any doFind call.

AI APIs 366
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Channel int R Video channel index which starts from 0.
StartTime string R Start time to search, ex: 2018-01-13T00:00:00Z.
EndTime string R End time to search, ex: 2018-01-14T00:00:00Z.
Similarity int R Similarity percent, 1 — 100.
MaxCandidate int O Max Candidate result number.
Da

[ Response Params ] ( JSON format )


Name Type R/O Param Description
hu

Token for this search, use this token to get result and stop
token uint R
aH

search.
progress uint R Search Progress, 100 means finished.
TT

totalCount int R Result num, return -1 means still searching.


[ Example ]
P

POST
AP

http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindHistoryByPic&Channe
l=0&StartTime=2018-01-13T00:00:00Z&EndTime=2018-01-14T00:00:00Z&Type=All&Si
IV

milarity=80&MaxCandidate=500
Request
Content-Type: image/jpeg
2.

Content-Length: <image size>


89

<JPEG data>
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

AI APIs 367
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/json
Da

Content-Length: <length>
hu

{ "token": 123456789,
"progress": 20
aH

"totalCount": -1
}
TT

--<boundary>
P

Content-Type: application/json
Response
Content-Length: <length>
AP
IV

{ "token": 123456789,
"progress": 60
2.

"totalCount": -1
89

}
--<boundary>
fo

Content-Type: application/json
Content-Length: <length>
r1
00

{ "token": 123456789,
"progress": 100
M

"totalCount": 350
EG

}
--<boundary>--
A

 Get find result


Di

Table 16-27
st

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindHistoryByPic
Method GET
rib

Get the find result, reply by multipart, first part is json string to describe all candidate person,
Descripti
ut

then the following part is the person's picture, refer by UID in part header Content-Info.
on
Note: the returned token will be expired after 60 seconds without any doFind call.
io

[ Request Params ] ( key=value format in URL )


n

Name Type R/O Param Description


s.r

Token for this search, use this token to get result and stop
token uint R
search.
.o

The index in search result, should between 0 and totalCount


.

index uint R
–1.
count uint R Number of result person to get, start from Index.
[ Response Params ] ( JSON format )
Name Type R/O Param Description

AI APIs 368
Found int R Number of result person that return.
Candidates Array<object> R Candidates Person.
+Person object R Person Info.
++UID string R System id for this Person, max string length is 63.
++Sex string O Sex. It can be "Male", "Female" or "Unknown".
++Age int O Age.
++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear.
Da

+Similarity int R Similarity.


[ Example ]
hu

GET
aH

Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindHistoryByPic&token=12
3456789&index=0&count=12
TT

HTTP/1.1 200 OK
Server: Device/1.0
P

Content-Type: multipart/x-mixed-replace; boundary=<boundary>


AP

Connection: closed
IV

--<boundary>
Content-Type: application/json
2.

Content-Length: <length>
89

{ "Found" : 12,
fo

"Candidates" : [
r1

{
"person" : {
00

"UID" : "0001",
"Sex" : "Male",
M

"Age" : 30,
EG

"Glasses": 1
Response },
A

"Similarity" : 85
Di

},
{
st

"person" : {
rib

"UID" : "0002",
"Sex" : "Male",
ut

"Age" : 50,
io

"Glasses": 2
n

},
s.r

"Similarity" : 80
},
.o

{ ... }, ...
.

]
}
--<boundary>
Content-Info: UID=0001
Content-Type: image/jpeg

AI APIs 369
Content-Length: <length>

< jpeg image data ... >


--<boundary>
Content-Info: UID=0002
Content-Type: image/jpeg
Content-Length: <length>
Da

< jpeg image data ... >


hu

--<boundary>
...
aH

 Stop finding
TT

Table 16-28
URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindHistoryByPic
P

Method GET
AP

Descripti
Stop finding.
on
IV

[ Request Params ] ( key=value format in URL )


2.

Name Type R/O Param Description


Token for this search, use this token to get result and stop
89

token uint R
searching.
[ Response Params ] ( OK )
fo

[ Example ]
r1

GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindHistoryByPic&token=1
00

23456789
M

Response OK
EG

16.1.2.15 [Event] FaceDetection


A
Di

Table 16-29
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
st

When the video channel disposition with some face group, and the video channel detect
rib

Description
a face, send this event.
ut

[ Event Params ] ( JSON format )


Name Type R/O Param Description
io

Faces Array<object> R The detected faces info.


n

The detected face bounding box, 4 interge, refer to x's value


s.r

of left—top point, y's value of left—top point, x's value of right


+BoundingBox Array<int> R
—bottom point, y's value of right—bottom point. Coordinate
.o

remap to 0 — 8192.
.

+Sex string O Sex, it can be "Man", "Woman".


+Age int O Age.

AI APIs 370
+Feature array<string> O Face feature, can be some of the following: "WearGlasses",
"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
"Confused", "Scream".
+Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
+Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth.
+Mask int O Mask status, 0: not detected, 1: not wearing mask, 2: wearing
Da

mask.
+Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.
hu

[ Example ]
aH

--<boundary>
Content-Type: text/plain
Content-Length: <length>
TT
P

Code=FaceDetection;action=Start;index=0;data={
AP

"Faces": [ { "BoundingBox": [2992,136,6960,8192],


"Sex": "Man",
IV

"Age": 40,
Event
"Feature": [ "WearGlasses", "Smile"],
2.

"Eye": 2,
89

"Mouth": 1,
"Mask": 1,
fo

"Beard": 2
r1

}, {…}, … ]
}
00

--<boundary>
M

16.1.2.16 [Event] FaceRecognition


EG
A

Table 16-30
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
Di

When the video channel disposition with some face group, and the video channel detect
Description
st

a face, after recognize in the face groups, send this event.


rib

[ Event Params ] ( key=value format )


Name Type R/O Param Description
ut

Events array<object> R Event info array.


io

+EventBaseInf
object R Base info of event.
o
n

++Code String R Event Code. It should be FaceRecognition.


s.r

++Action String R Event Action. It can be "Start", "Stop" or "Pulse".


.o

++Index int O The channel index relate to this event, start from 0.
+UID String R The identity of the Person, max string length is 31.
.

+Candidates array<object> O The Candidates person list.


++Person object O The information of candidate person.
+++UID string R The identity of the Person, max string length is 31.
+++GroupID string R The identity of the Face Group that this Person in. max string

AI APIs 371
length is 63.
+++Name string O Person Name, max string length is 63.
+++Birthday string O Birthday ex: "1980-01-01".
+++Sex string O Sex, it can be "Male", "Female", "Unknown".
Country name. The length must be 2, and value should be
+++Country string O
according to ISO3166.
+++Province string O Province name, max string length is 63.
Da

+++City string O City name, max string length is 63.


+++CertificateT Certificate Type. It can be: "IC', "Passport", "Military",
hu

string O
ype "Unknown".
aH

+++ID string O Person ID of CertificateType, max string length is 31.


Similarity of the Candidates person and the detected person,
++Similarity int O
TT

value between 1 — 100.


+Face object O The attribute information of face.
P

++Sex string O Sex, it can be "Man", "Woman".


AP

++Age int O Age.


Face feature, can be some of the following : "WearGlasses",
IV

"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",


++Feature array<string> O
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
2.

"Confused", "Scream".
89

++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
++Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth.
fo

Mask status, 0: not detected, 1: not wearing mask, 2: wearing


++Mask int O
r1

mask.
++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.
00

[ Example ]
M

--<boundary>
Content-Type: text/plain
EG

Content-Length: <length>
A

Events[0].EventBaseInfo .Code=FaceRecognition
Di

Events[0].EventBaseInfo .Action=Pulse
st

Events[0].EventBaseInfo .Index=0
Events[0].UID=00105
rib

Events[0].Candidates[0].Person.UID=0012
ut

Events[0].Candidates[0].Person.GroupID=10000
Event
Events[0].Candidates[0].Person.Name=ZhangSan
io

Events[0].Candidates[0].Person.Birthday=1980-01-02
n

Events[0].Candidates[0].Person.Sex=Male
s.r


Events[0].Candidates[0].Similarity=80
.o

Events[0].Candidates[1].Person.UID=0014
.

Events[0].Candidates[1].Person.GroupID=10000
Events[0].Candidates[1].Person.Name=Lisi
Events[0].Candidates[1].Person.Birthday=1980-01-05
Events[0].Candidates[1].Person.Sex=Male

AI APIs 372

Events[0].Candidates[1].Similarity=75

Events[0].Face.Sex=Man
Events[0].Face.Age=20
Events[0].Face.Feature[0]=SunGlasses
Events[0].Face.Feature[1]=Smile
Da

Events[0].Face.Eye=2
Events[0].Face.Mouth=1
hu

Events[0].Face.Mask=1
Events[0].Face.Beard=2
aH

--<boundary>
Content-Type: image/jpeg
TT

Content-Length: <image size>


P

<Jpeg image data>


AP

--<boundary>
IV

16.1.2.17 [Event] FaceFeatureAbstract


2.
89

Table 16-31
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
fo

When Re-Abstract Feature By Group or By Person, the abstract progress detail will send
Description
r1

in this event.
[ Event Params ] ( JSON format )
00

Name Type R/O Param Description


M

Infos Array<object> R Abstrace detail Info, max size is 100.


Abstract state, it can be :
EG

 "Success" : Abstract success,


+State String R
"False" : Failed to abstract;
A


 "Process" : In Process;
Di

+Process int O The abstract progress.


st

+UID string O The identity of the person, max string length is 31.
rib

+GroupID string O The identity of the face group, max string length is 63.
[ Example ]
ut
io
n
s.r
.o
.

AI APIs 373
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=FaceFeatureAbstract;action=Start;index=0;data={
"Infos": [ { "State": "Progress",
Event
"Progress": 30,
Da

"UID": "20005",
"GroupID": "10000"
hu

}, {…}, … ]
}
aH

--<boundary>
TT

16.1.2.18 [Config] Face Recognition Event Handler Setting


P
AP

 Get FaceRecognitionEventHandler config

Table 16-32
IV

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionEve
URL
2.

ntHandler
Method GET
89

Description Get the Face Recognition Event Handler Setting.


[ Request Params ] ( None )
fo

[ Response Params ] ( key=value format )


r1

Name Type R/O Param Description


table object R Config info table.
00

+FaceRecognitio
array<object> R Each face group has one config object in this array.
M

nEventHandler
++GroupID String R The face group ID, max string length is 63.
EG

++GroupName String R The face group name, max string length is 127.
A

Report event mask, 0 means not to report event.


++EventEnable
int R  Bit 0 : recognition success
Di

Mask
 Bit 1 : recognition failed
st

Record media file mask., 0 means not to record.


++RecordEnable
rib

int R  Bit 0 : recognition success


Mask
 Bit 1 : recognition failed
ut

++RecordLatch Int R Record latch time, unit is second.


io

Snap picture mask., 0 means not to snap picture


++SnapEnableM
Int R Bit 0 : recognition success
n


ask
 Bit 1 : recognition failed
s.r

Send mail mask., 0 means not to send mail.


++MailEnableMa
.o

Int R  Bit 0 : recognition success


sk
 Bit 1 : recognition failed
.

[ Example ]
GET
Request http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionEve
ntHandler

AI APIs 374
table.FaceRecognitionEventHandler[0].GroupID=0017
table.FaceRecognitionEventHandler[0].GroupName=wsd
table.FaceRecognitionEventHandler[0].EventEnableMask=3
table.FaceRecognitionEventHandler[0].RecordEnableMask=0
table.FaceRecognitionEventHandler[0].RecordLatch=10
table.FaceRecognitionEventHandler[0].SnapEnableMask=3
table.FaceRecognitionEventHandler[0].MailEnableMask=0
Da


Response
table.FaceRecognitionEventHandler[1].GroupID=0018
hu

table.FaceRecognitionEventHandler[1].GroupName=cst
table.FaceRecognitionEventHandler[1].EventEnableMask=3
aH

table.FaceRecognitionEventHandler[1].RecordEnableMask=0
table.FaceRecognitionEventHandler[1].RecordLatch=10
TT

table.FaceRecognitionEventHandler[1].SnapEnableMask=3
P

table.FaceRecognitionEventHandler[1].MailEnableMask=0

AP

 Set FaceRecognitionEventHandler config


IV

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
2.

Descripti
Set the Face Recognition Event Handler Setting.
89

on
[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


r1

FaceRecognition
array<object> R Each face group has one config object in this array.
Alarm
00

+GroupID String R The face group ID, max string length is 63.
+GroupName String R The face group name, max string length is 127.
M

Report event mask, 0 means not to report event.


+EventEnableM
EG

int R  Bit 0 : recognition success


ask
 Bit 1 : recognition failed
A

Record media file mask., 0 means not to record.


+RecordEnable
Di

int R  Bit 0 : recognition success


Mask
Bit 1 : recognition failed
st


+RecordLatch Int R Record latch time, unit is second.
rib

Snap picture mask., 0 means not to snap picture


+SnapEnableMa
Int R Bit 0 : recognition success
ut


sk
 Bit 1 : recognition failed
io

Send mail mask., 0 means not to send mail.


+MailEnableMas
n

Int R  Bit 0 : recognition success


k
s.r

 Bit 1 : recognition failed


[ Response Params ] ( OK )
.o

[ Example ]
.

AI APIs 375
GET
http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&FaceRecognitionEventHandl
er[0].GroupID=0017&FaceRecognitionEventHandler[0].GroupName=wsd&FaceRecognit
Request
ionEventHandler[0].EventEnableMask=3&FaceRecognitionEventHandler[0].RecordEnab
leMask=0&FaceRecognitionEventHandler[0].RecordLatch=10&FaceRecognitionEventHa
ndler[0].SnapEnableMask=3&FaceRecognitionEventHandler[0].MailEnableMask=0
Response OK
Da

16.1.3 Video Analyse Event


hu
aH

16.1.3.1 [Event] LeftDetection


TT

Table 16-33
P

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


AP

Description When detect some object left, send this event.


[ Event Params ] ( JSON format )
IV

Name Type R/O Param Description


Object object R The object that left.
2.

The detected object bounding box, 4 interge, refer to x's value


89

of left—top point, y's value of left—top point, x's value of right—


+BoundingBox Array<int> R
bottom point, y's value of right — bottom point. Coordinate
fo

remap to 0 — 8192.
r1

[ Example ]
--<boundary>
00

Content-Type: text/plain
Content-Length: <length>
M

Event
EG

Code=LeftDetection;action=pulse;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] }
A

}
Di

--<boundary>
st
rib

16.1.3.2 [Event] TakenAwayDetection


ut

Table 16-34
io

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect some object was taken away, send this event.
n

[ Event Params ] ( JSON format )


s.r

Name Type R/O Param Description


.o

Object object R The object that was taken away.


The detected object bounding box, 4 interge, refer to x's value
.

of left—top point, y's value of left—top point, x's value of right—


+BoundingBox Array<int> R
bottom point, y's value of right — bottom point. Coordinate
remap to 0 — 8192.
[ Example ]

AI APIs 376
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Event
Code=TakenAwayDetection;action=pulse;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] }
}
Da

--<boundary>
hu

16.1.3.3 [Event] WanderDetection


aH

Table 16-35
TT

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect some object was wandering, send this event
P

[ Event Params ] ( JSON format )


AP

Name Type R/O Param Description


Objects Array<object> R The objects that was wandering.
IV

The detected object bounding box, 4 interge, refer to x's value


2.

of left—top point, y's value of left—top point, x's value of right


+BoundingBox Array<int> R
—bottom point, y's value of right—bottom point. Coordinate
89

remap to 0 — 8192.
The object wandering tracks, array of polyline, one polyline
fo

Array<Array<
Tracks O for one object, polyline is array of points, point is array of two
r1

Array<int>>>
int, x's value and y's value. Coordinate remap to 0 — 8192.
The detection region, the first array is point list, max item is
00

Array<Array<i
DetectRegion R 20, the second array is point, must be two int, means x and y
nt>>
M

value, coordinate remap to 0 — 8192.


[ Example ]
EG

--<boundary>
A

Content-Type: text/plain
Content-Length: <length>
Di
st

Code=WanderDetection;action=start;index=0;data={
rib

"Objects": [ { "BoundingBox": [2992,1136,4960,5192] },


{ "BoundingBox": [4392,4136,6960,6512] },
Event
ut

{…}, … ],
io

"Tracks": [ [ [1202, 576], [1456, 863], [1921, 1204], [2341, 1823], [3512, 2314] ],
[ [2214, 3412], [3153, 3674], [4512, 4213] ],
n

[…], … ],
s.r

"DetectRegion": [ [1292,3469], [6535,3373], … ]


}
.o

--<boundary>
.

16.1.3.4 [Event] StayDetection

Table 16-36

AI APIs 377
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
Description When detect some object was stay, send this event
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Object object O The object that was stay.
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
Da

+BoundingBox Array<int> O
—bottom point, y's value of right—bottom point. Coordinate
remap to 0 — 8192.
hu

Objects array<object> O If detect several object, store in this array.


aH

The detected object bounding box, 4 interge, refer to x's value


of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> O
TT

—bottom point, y's value of right—bottom point. Coordinate


remap to 0 — 8192.
P

The detection region, the first array is point list, max item is
Array<Array<i
AP

DetectRegion O 20, the second array is point, must be two int, means x and y
nt>>
value, coordinate remap to 0 — 8192.
IV

AreaID int O The area id, begin from 1, if omit, means single area.
PresetID int O The preset id, if omit, means preset is unknown.
2.

[ Example ]
89

--<boundary>
Content-Type: text/plain
fo

Content-Length: <length>
r1

Code=StayDetection;action=start;index=0;data={
00

"Object": { "BoundingBox": [2992,1136,4960,5192] },


Event "Objects": [ { "BoundingBox": [2992,1136,4960,5192] },
M

{ "BoundingBox": [4392,4136,6960,6512] },
EG

{…}, … ],
"DetectRegion": [ [1292,3469], [6535,3373], … ],
A

"AreaID" : 2
Di

}
st

--<boundary>
rib

16.1.3.5 [Event] HumanTrait


ut
io

Table 16-37
Usage Refer to "4.4.3 Subscribe to Snapshot "for how to subscribe event
n

Description When detect a human trait, send this event.


s.r

[ Event Params ] ( key=value format )


.o

Name Type R/O Param Description


Events array<object> O Event info array.
.

+EventBaseInfo object R Base info of event.


++Code String R Event Code. It should be HumanTrait.
++Action String R Event Action. It can be: "Start", "Stop", "Pulse".
++Index int O The channel index relate to this event, start from 0.

AI APIs 378
+HumanAttribute
object O The human attributes.
s
The detected human bounding box, 4 interge, refer to x's
value of left-top point, y's value of left-top point, x's value of
++BoundingBox Array<int> O
right-bottom point, y's value of right-bottom point.
Coordinate remap to 0 — 8192.
++Sex string O Sex, can be "Man", "Woman", "Unknown".
Da

++Age int O Age.


++Angle int O Angle, 0: unknown, 1: front, 2: side, 3: back.
hu

Coat color, can be: "White", "Orange", "Pink", "Black",


aH

"Red", "Yellow", "Gray", "Blue", "Green", "Purple", "Brown",


"Sliver", "Darkviolet", "Maroon", "Dimgray", "Whitesmoke",
++CoatColor string O "Darkorange", "Mistyrose", "Tomato", "Olive", "Gold",
TT

"Darkolivegreen", "Chartreuse", "Greenyellow",


P

"Forestgreen", "Seagreen", "Chartreuse", "Deepskyblue",


AP

"Cyan", "Other".
++CoatType int O Coat type, 0: unknown, 1: long sleeve, 2: short sleeve.
IV

++TrousersColor string O Trousers color, value can be that of CoatColor.


Trousers type, 0: unknown, 1: long pants, 2: short pants, 3:
2.

++TrousersType int O
skirt.
89

++HasHat int O Has hat or not, 0: unknown, 1: not has hat, 2: has hat.
++HasBag int O Has bag or not, 0: unknown, 1: not has bag, 2: has bag.
fo

Has umbrella or not, 0: unknown, 1: not has umbrella, 2: has


++HasUmbrella int O
r1

umbrella.
Bag type, 0: unknown, 1: handbag, 2: shoulder bag, 3:
++Bag int O
00

knapsack, 4: draw-bar box.


Upper clothes pattern, 0: unknown, 1: pure color, 2: stripe,
M

++UpperPattern int O
3: pattern, 4: gap, 5: grid.
EG

Hair style, 0: unknown, 1: long hair, 2: short hair, 3: ponytail,


++HairStyle int O
4: updo, 5: hiddened.
A

++Cap int O Cap style, 0: unknown, 1: normal cap, 2: helmet.


Di

+FaceAttributes object O If the human's face can be detected, find it's attributes.
st

The detected face bounding box, 4 interge, refer to x's value


of left-top point, y's value of left-top point, x's value of
rib

++BoundingBox Array<int> O
right-bottom point, y's value of right-bottom point.
ut

Coordinate remap to 0 — 8192.


++Sex string O Sex, it can be "Man", "Woman", "Unknown".
io

++Age int O Age.


n

Face feature, can be some of the following : "WearGlasses",


s.r

"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",


++Feature array<string> O
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
.o

"Confused", "Scream".
.

++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
Mouth status, 0: not detected, 1: close mouth, 2: open
++Mouth int O
mouth.

AI APIs 379
Mask status, 0: not detected, 1: not wearing mask, 2:
++Mask int O
wearing mask.
++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.
Glasses status, 0: unknown, 1: not wearing, 2: normal
++Glass Int O
Glasses, 3: sun glasses, 4: black frame glasses.
[ Example ]
--<boundary>
Da

Content-Type: text/plain
Content-Length: <length>
hu
aH

Events[0].EventBaseInfo .Code=HumanTrait
Events[0].EventBaseInfo .Action=Pulse
Events[0].EventBaseInfo .Index=0
TT

Events[0].HumanAttributes.BoundingBox[0]=1341
P

Events[0].HumanAttributes.BoundingBox[1]=2451
AP

Events[0].HumanAttributes.BoundingBox[2]=4513
Events[0].HumanAttributes.BoundingBox[3]=4135
IV

Events[0].HumanAttributes.Sex=Man
Events[0].HumanAttributes.Age=30
2.

Events[0].HumanAttributes.CoatColor=White
89

Events[0].HumanAttributes.CoatType=1
Events[0].HumanAttributes.TrousersColor=Black
fo

Events[0].HumanAttributes.TrousersType=1
Event Events[0].HumanAttributes.HasHat=1
r1

Events[0].HumanAttributes.HasBag=2
00

Events[0].FaceAttributes.BoundingBox[0]=1341
Events[0].FaceAttributes.BoundingBox[1]=2451
M

Events[0].FaceAttributes.BoundingBox[2]=4513
EG

Events[0].FaceAttributes.BoundingBox[3]=4135
Events[0].FaceAttributes.Sex=Man
A

Events[0].FaceAttributes.Age=30
Di

Events[0].FaceAttributes.Feature[0]=Smile
Events[0].FaceAttributes.Eye=2
st

Events[0].FaceAttributes.Mouth=1
rib

Events[0].FaceAttributes.Glass=1
--<boundary>
ut

Content-Type: image/jpeg
io

Content-Length: <image size>


n

<Jpeg image data>


s.r

--<boundary>
.o
.

16.1.3.6 [Event] CrossLineDetection

Table 16-38
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event

AI APIs 380
Description When detect some object cross the line, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Object object R The object that cross the line.
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
Da

remap to 0 — 8192.
Objects array<object> O If detect several object, store in this array.
hu

The detected object bounding box, 4 interge, refer to x's value


aH

of left—top point, y's value of left—top point, x's value of right


+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
remap to 0 — 8192.
TT

The detection line, the first array is point list, max item is 20,
Array<Array<i
P

DetectLine R the second array is point, must be two int, means x and y
nt>>
AP

value, coordinate remap to 0 — 8192.


The crossline direction, can be : “LeftToRight”, “RightToLeft”,
Direction string O
IV

“Any”.
[ Example ]
2.

--<boundary>
89

Content-Type: text/plain
Content-Length: <length>
fo
r1

Code=CrossLineDetection;action=pulse;index=0;data={
Event
"Object": { "BoundingBox": [2992,1136,4960,5192] },
00

"DetectLine": [ [1292,3469], [6535,3373], … ],


"Direction" : "LeftToRight"
M

}
EG

--<boundary>
A

16.1.3.7 [Event] CrossRegionDetection


Di
st

Table 16-39
rib

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect some object cross the region, send this event
ut

[ Event Params ] ( JSON format )


io

R/
Name Type Param Description
O
n

Object object R The object that cross the region.


s.r

The detected object bounding box, 4 interge, refer to x's value


.o

of left—top point, y's value of left-top point, x's value of right


+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
.

remap to 0 — 8192.
Objects array<object> O If detect several object, store in this array.

AI APIs 381
The detected object bounding box, 4 interge, refer to x's value
of left—top point, y's value of left—top point, x's value of right
+BoundingBox Array<int> R
—bottom point, y's value of right-bottom point. Coordinate
remap to 0 — 8192.
The detection region, the first array is point list, max item is
Array<Array<i
DetectRegion R 20, the second array is point, must be two int, means x and y
nt>>
value, coordinate remap to 0 — 8192.
Da

The cross action, can be : "Appear", "Disappear",


Action string R
"Cross","Inside"
hu

The cross direction, valid on if the “Action” is “Cross”, can be :


Direction string O
aH

"Enter", "Leave", "Both".


[ Example ]
TT

--<boundary>
Content-Type: text/plain
P

Content-Length: <length>
AP

Code=CrossRegionDetection;action=pulse;index=0;data={
IV

Event "Object": { "BoundingBox": [2992,1136,4960,5192] },


"DetectRegion": [ [1292,3469], [6535,3373], … ],
2.

“Action” : “Cross”,
89

"Direction" : "Enter"
}
fo

--<boundary>
r1

16.1.3.8 [Event] QueueStayDetection


00
M

Table 16-40
Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event
EG

Description When detect the queue stay time too long, send this event
A

[ Event Params ] ( JSON format )


Name Type R/O Param Description
Di

Object object O The object that was stay.


st

The detected object bounding box, 4 interge, refer to x's value


rib

of left—top point, y's value of left—top point, x's value of right


+BoundingBox Array<int> O
—bottom point, y's value of right—bottom point. Coordinate
ut

remap to 0 — 8192.
io

Objects array<object> O If detect several object, store in this array.


The detected object bounding box, 4 interge, refer to x's value
n

of left—top point, y's value of left—top point, x's value of right


s.r

+BoundingBox Array<int> O
—bottom point, y's value of right—bottom point. Coordinate
.o

remap to 0 — 8192.
The detection region, the first array is point list, max item is
.

Array<Array<i
DetectRegion O 20, the second array is point, must be two int, means x and y
nt>>
value, coordinate remap to 0 — 8192.
AreaID int O The area id, begin from 1, if omit, means single area.
PresetID int O The preset id, if omit, means preset is unknown.

AI APIs 382
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=QueueStayDetection;action=start;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] },
Da

Event "Objects": [ { "BoundingBox": [2992,1136,4960,5192] },


{ "BoundingBox": [4392,4136,6960,6512] },
hu

{…}, … ],
"DetectRegion": [ [1292,3469], [6535,3373], … ],
aH

"AreaID" : 2
}
TT

--<boundary>
P
AP

16.1.3.9 [Event] QueueNumDetection


IV

Table 16-41
2.

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect the queue people number exceed limit, send this event
89

[ Event Params ] ( JSON format )


Name Type R/O Param Description
fo

ManList Array<object> R The people info list.


r1

The detected people bounding box, 4 interge, refer to x's


value of left-top point, y's value of left-top point, x's value of
00

+BoundingBox Array<int> R
right-bottom point, y's value of right-bottom point. Coordinate
M

remap to 0 — 8192.
+Stature int R The people's stature, unit is cm.
EG

AreaID int O The area id, begin from 1, if omit, means single area.
A

PresetID int O The preset id, if omit, means preset is unknown.


[ Example ]
Di

--<boundary>
st

Content-Type: text/plain
rib

Content-Length: <length>
ut

Code=QueueNumDetection;action=pulse;index=0;data={
io

Event "ManList": [ { "BoundingBox": [2992,1136,4960,5192], "Stature": 170 },


{ "BoundingBox": [4392,4136,6960,6512], "Stature": 175 },
n

{…}, … ],
s.r

"AreaID" : 2
}
.o

--<boundary>
.

AI APIs 383
16.2 Intelligent Traffic APIs

16.2.1 Traffic Record

16.2.1.1 Insert Traffic BlackList/RedList Record


Da

Table 16-42
hu

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=<RecordName>
Method GET
aH

Description Insert traffic BlackList/Red record.


[ Request Params ] ( key=value format in URL )
TT

Name Type R/O Param Description


P

The record table name, "TrafficBlackList" for BlackList and


name string R
AP

"TrafficRedList" for RedList.


The number of car plate, max string length is 31. It must be
PlateNumber string R
IV

unique.
MasterOfCar string O The car owner, max string length is 15
2.

PlateColor string O Plate color, max string length is 31, ex: "Yellow", "Blue", … etc.
89

PlateType string O Plate type, max string length is 31.


VehicleType string O Vehicle type, max string length is 31.
fo

Vehicle color, max string length is 31. ex: "Yellow", "Blue", …


VehicleColor string O
r1

etc.
BeginTime string O Begin time, ex: "2010-05-25 00:00:00".
00

CancelTime string O Cancel time, ex: "2010-06-25 00:00:00".


AuthorityList object O Authority list, only valid for "TrafficRedList" table.
M

+OpenGate bool O Authority to open the gate.


EG

[ Response Params ] (key=value format)


Name Type R/O Param Description
A

The new record’s id, return -1 if the device handles


RecNo int R
Di

asynchronously.
st

[ Example ]
GET
rib

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=TrafficBlackList&Pla
Request
ut

teNumber=AC00001&MasterOfCar=ZhangSan&PlateColor=Yellow&VehicleColor=Blue&
BeginTime=2011-01-01%2012:00:00&CancelTime=2011-01-10%2012:00:00
io

Response RecNo=12345
n
s.r

16.2.1.2 Update Traffic BlackList/RedList Record


.o
.

Table 16-43
URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=<RecordName>
Method GET

AI APIs 384
Update Traffic BlackList/Red record.
Descripti
Note: Besides action, name, recno, there should be at least one more parameter to be
on
updated.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The record table name, "TrafficBlackList" for BlackList and
name string R
"TrafficRedList"for RedList.
Da

recno int R record id


The number of car plate, max string length is 31. It must be
hu

PlateNumber string R
unique.
aH

MasterOfCar string O The car owner, max string length is 15


…<See above insert command for other params of the record.
…<other param> - -
TT

They are all optional.>


[ Response Params ] ( OK )
P

[ Example ]
AP

GET
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=TrafficBlackList&re
IV

Request cno=12345&PlateNumber=AC00001&MasterOfCar=ZhangSan&PlateColor=Yellow&Vehi
cleColor=Blue&BeginTime=2011-01-01%2012:00:00&CancelTime=2011-01-10%2012:00
2.

:00
89

Response OK
fo

16.2.1.3 Remove Traffic BlackList/RedList Record


r1
00

Table 16-44
URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=<RecordName>
M

Method GET
EG

Descripti
Remove Traffic BlackList/Red record.
on
A

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
Di

The record table name, "TrafficBlackList"for BlackList and


st

name string R
"TrafficRedList"for RedList.
rib

recno int R The record id.


[ Response Params ] ( OK )
ut

[ Example ]
io

GET
n

Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=TrafficBlackList&r
ecno=12345
s.r

Response OK
.o
.

16.2.1.4 Find Traffic BlackList/RedList Record

Table 16-45
URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=<RecordName>

AI APIs 385
Method GET
Description Find Traffic BlackList/RedList record.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The record table name, "TrafficBlackList"for BlackList and
name string R
"TrafficRedList"for RedList.
count int O Max result to return, default is 1024.
Da

StartTime string O The start of the record's CreateTime.


EndTime string O The end of the record's CreateTime.
hu

condition object O Search condition.


aH

+PlateNumber string O Car plate number, max string length is 47.


+PlateNumberV Car plate number substring, match any car plate number that
string O
TT

ague contain this substring, max string length is 47.


+PlateNumberV array<string
P

O Car plate number substring array, max string length is 47.


agueGroup >
AP

+QueryCount int O Query count, default is 1000.


+QueryResultBe
IV

int O Begin number in the result set, default is 0.


gin
[ Response Params ] (key=value format)
2.

Name Type R/O Param Description


89

totalCount int O Total record num that find.


found int O Record num that returned.
fo

array<object
records R The records that returned.
r1

>
+RecNo int R Record id.
00

+CreateTime int R The create time of record.


M

+PlateNumber string R Car plate number.


+MasterOfCar string O Car owner.
EG

+…<other …<see above insert command for other params of the


- -
param> record>
A

[ Example ]
Di

GET
st

Request http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=TrafficBlackList&condition.
rib

PlateNumber=AC00001&StartTime=123456700&EndTime=123456800&count=100
totalCount=1000
ut

found=100
records[0].RecNo=12345
io

records[0].CreateTime=123456789
n

records[0].PlateNumber=AC00001
s.r

Respons records[0].MasterOfCar=ZhangSan
e …
.o

records[1].RecNo=13579
.

records[1].CreateTime=123456799
records[1].PlateNumber=AC00001
records[1].MasterOfCar=LiSi

AI APIs 386
16.2.1.5 RemoveEx Traffic BlackList/RedList Record

Table 16-46
URL http://<server>/cgi-bin/recordUpdater.cgi?action=removeEx&name=<RecordName>
Method GET
Descripti
RemoveEx Traffic BlackList/Red record.
Da

on
[ Request Params ] ( key=value format in URL )
hu

Name Type R/O Param Description


The record table name, "TrafficBlackList"for BlackList and
aH

name string R
"TrafficRedList"for RedList.
RecNo int O The record id.
TT

PlateNumber string O The number of car plate, max string length is 31. It must be
unique.
P

[ Response Params ] ( OK )
AP

[ Example ]
IV

GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=removeEx&name=TrafficBlackList
2.

&PlateNumber=AC00001
89

Response OK
fo

16.2.2 Intelligent Traffic Event


r1
00

16.2.2.1 [Event] TrafficJunction


M
EG

Table 16-47
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
A

Description When detects vehicle passing, send this event.


[ Event Params ] ( key=value format )
Di

Name Type R/O Param Description


st

Events array<object> R Event info array.


rib

+EventBaseInfo object R Base info of event.


++Code String R Event Code. It should be TrafficJunction.
ut

++Action String R Event Action. It can be "Start", "Stop" or "Pulse".


io

++Index int O The channel index relate to this event.


n

+GroupID int O The id of event group.


+CountInGroup int O Event count in the event group.
s.r

+IndexInGroup int O The index of this event in the event group, start from 1.
.o

+Lane int O Lane number, start from 0.


.

Trigger type. It can be: 0—car detector, 1—radar, 2—


+TriggerType int O
video.
+Speed int O Vehicle speed, unit is km/hour.
+Vehicle Object O The information of vehicle object.
++BoundingBox Array<int> R The detected car bounding box, 4 interge, refer to x's

AI APIs 387
value of left-top point, y's value of left-top point, x's value
of right-bottom point, y's value of right-bottom point.
Coordinate remap to 0 — 8192.
++Text string O Vehicle logo.
++SubText string O Vehicle sub logo.
++SubBrand int O Vehicle sub brand index.
++BrandYear int O Vehicle brand year index.
Da

+TrafficCar object O Traffic Car info.


++RecNo int R The record id.
hu

++PlateNumber string R Car plate number.


aH

++PlateType string O Plate type.


++PlateColor string O Plate color, ex: "Yellow", "Blue", … etc.
TT

++VehicleColor string O Vehicle color, ex: "Yellow", "Blue", … etc.


The detected plate bounding box, 4 interge, refer to x's
P

value of left-top point, y's value of left-top point, x's value


++BoundingBox Array<int> R
AP

of right-bottom point, y's value of right-bottom point.


Coordinate remap to 0 — 8192.
IV

++Country string O Country info. Max string length is 19.


++Speed int O Vehicle speed, unit is km/hour.
2.

++Event string O The event info, ex: "TrafficJunction".


89

+CommInfo object O Traffic event common info.


++Seat array<object> O Vehicle front seat info.
fo

+++Type string O Front seat type. It can be: "Main""Slave".


r1

Some driver status. It can be some of the following:


+++Status array<string> O
"Smoking", "Calling".
00

Sunshade status. It can be: "Unknow", "WithSunShade",


+++SunShade string O
M

"WithoutSunShade".
The detected sun shade bounding box, 4 interge, refer to
EG

x's value of left-top point, y's value of left-top point, x's


+++ShadePos Array<int> O
value of right-bottom point, y's value of right-bottom point.
A

Coordinate remap to 0 — 8192.


Di

SafeBelt status. It can be: "Unknow", "WithSafeBelt",


+++SafeBelt string O
st

"WithoutSafeBelt".
rib

[ Example ]
--<boundary>
ut

Content-Type: text/plain
Content-Length: <length>
io
n

Events[0].EventBaseInfo.Code=TrafficJunction
s.r

Events[0].EventBaseInfo.Action=Pulse
Event
Events[0].EventBaseInfo.Index=0
.o

Events[0].GroupID=123
.

Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Events[0].Lane=0
Events[0].Vehicle.BoundingBox[0]=1341

AI APIs 388
Events[0].Vehicle.BoundingBox[1]=2451
Events[0].Vehicle.BoundingBox[2]=4513
Events[0].Vehicle.BoundingBox[3]=4135
Events[0].Vehicle.Text=Audi
Events[0].Vehicle.SubText=A6L
Events[0].Vehicle.SubBrand=5
Events[0].Vehicle.BrandYear=2
Da

Events[0].TrafficCar.RecNo=123
Events[0].TrafficCar.PlateNumber=AC00003
hu

Events[0].TrafficCar.PlateColor=Yellow
Events[0].TrafficCar.VehicleColor=Blue
aH

Events[0].TrafficCar.BoundingBox[0]=1341
Events[0].TrafficCar.BoundingBox[1]=2451
TT

Events[0].TrafficCar.BoundingBox[2]=4513
P

Events[0].TrafficCar.BoundingBox[3]=4135
Events[0].TrafficCar.Country=China
AP

Events[0].CommInfo.Seat[0].Type=Main
IV

Events[0].CommInfo.Seat[0].Status[0]=Smoking
Events[0].CommInfo.Seat[0].SunShade=WithSunShade
2.

Events[0].CommInfo.Seat[0].ShadePos[0]=2021
89

Events[0].CommInfo.Seat[0].ShadePos[1]=3041
Events[0].CommInfo.Seat[0].ShadePos[2]=2151
fo

Events[0].CommInfo.Seat[0].ShadePos[3]=3661
Events[0].CommInfo.Seat[0].SafeBelt=WithoutSafeBelt
r1


00

--<boundary>
Content-Type: image/jpeg
M

Content-Length: <image size>


EG

<Jpeg image data>


A

--<boundary>
Di

16.2.2.2 [Event] TrafficRetrograde


st
rib

When detects vehicle retrograde, send this event.


Event params is the same as TrafficJunction, except for event Code is TrafficRetrograde.
ut
io

16.2.2.3 [Event] TrafficJam


n
s.r

Table 16-48
.o

Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event


Description When detects traffic jam, send this event.
.

[ Event Params ] ( key=value format )


Name Type R/O Param Description
Events array<object> R Event info array.
+EventBaseInfo object R Base info of event.

AI APIs 389
++Code String R Event Code. It should be TrafficJam.
++Action String R Event Action. It can be "Start", "Stop" or "Pulse".
++Index int O The channel index relate to this event.
+GroupID int O The id of event group.
+CountInGroup int O Event count in the event group.
+IndexInGroup int O The index of this event in the event group, start from 1.
+Lane int O Lane number, start from 0.
Da

+StartJaming int O Start jam time, UTC seconds.


+AlarmInterval int O Alarm interval, unit is second.
hu

+JamLenght int O Jam length, percentage of the lane.


aH

+JamRealLengt
int O Jam real length, unit is metre.
h
TT

[ Example ]
--<boundary>
P

Content-Type: text/plain
AP

Content-Length: <length>
IV

Events[0].EventBaseInfo.Code=TrafficJam
Events[0].EventBaseInfo.Action=Pulse
2.

Events[0].EventBaseInfo.Index=0
89

Events[0].GroupID=123
Events[0].CountInGroup=3
fo

Events[0].IndexInGroup=1
r1

Events[0].Lane=0
Event
Events[0].StartJaming=123456789
00

Events[0].AlarmInterval=180
Events[0].JamLenght=70
M

Events[0].JamRealLength=120
EG


--<boundary>
A

Content-Type: image/jpeg
Di

Content-Length: <image size>


st

<Jpeg image data>


rib

--<boundary>
ut

16.2.2.4 [Event] TrafficUnderSpeed


io
n

When detects vehicle under speed, send this event.


s.r

Event params is the same as TrafficJunction, except for event Code is TrafficUnderSpeed, and
add following params:
.o
.

Table 16-49
[ Extra Event Params ] ( key=value format )
Name Type R/O Param Description
+SpeedLimit array<int> O Speed limit, 2 integer, min speed and max speed.
+UnderSpeeding int O Percentage of under speed.

AI APIs 390
Percentage

16.2.2.5 [Event] TrafficOverSpeed


When detects vehicle over speed, send this event.
Event params is the same as TrafficJunction, except for event Code is TrafficOverSpeed, and add
following params:
Da

Table 16-50
hu

[ Extra Event Params ] ( key=value format )


Name Type R/O Param Description
aH

+SpeedLimit array<int> O Speed limit, 2 integer, min speed and max speed.
+SpeedingPerce
int O Percentage of over speed.
TT

ntage
P
AP

16.2.2.6 [Event] TrafficPedestrain


IV

Table 16-51
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
2.

Description When detects human in the lane, send this event


89

[ Event Params ] ( key=value format )


Name Type R/O Param Description
fo

Events array<object> R Event info array.


r1

+EventBaseInfo object R Base info of event.


++Code String R Event Code. It should be TrafficPedestrain.
00

++Action String R Event Action. It can be "Start", "Stop" or "Pulse".


++Index int O The channel index relate to this event.
M

+GroupID int O The id of event group.


EG

+CountInGroup int O Event count in the event group.


+IndexInGroup int O The index of this event in the event group, start from 1.
A

+Lane int O Lane number, start from 0.


Di

+Vehicle object O Actually this is the human that detected, not vehicle.
st

++Category string R Must be "Passerby", means this actually is a human.


rib

++BoundingBox Array<int> R The detected car bounding box, 4 interge, refer to x's value
of left-top point, y's value of left-top point, x's value of
ut

right-bottom point, y's value of right-bottom point.


Coordinate remap to 0 — 8192.
io

[ Example ]
n

Event --<boundary>
s.r

Content-Type: text/plain
Content-Length: <length>
.o
.

Events[0].EventBaseInfo.Code=TrafficPedestrain
Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].GroupID=123

AI APIs 391
Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Events[0].Lane=0
Events[0].Vehicle.Category=Passerby
Events[0].Vehicle.BoundingBox[0]=1341
Events[0].Vehicle.BoundingBox[1]=2451
Events[0].Vehicle.BoundingBox[2]=4513
Da

Events[0].Vehicle.BoundingBox[3]=4135

hu

--<boundary>
Content-Type: image/jpeg
aH

Content-Length: <image size>


TT

<Jpeg image data>


P

--<boundary>
AP

16.2.2.7 [Event] TrafficParking


IV

When detects vehicle illegal parking, send this event.


2.

Event params is the same as TrafficJunction, except for event Code is TrafficParking, and
89

remove param "speed", add following params:


fo

Table 16-52
[ Extra Event Params ] ( key=value format )
r1

Name Type R/O Param Description


00

+StartParking int O The start time of parking, UTC seconds.


+AlarmInterval int O The alarm interval.
M

+ParkingAllowed
int O The allowed time of parking.
EG

Time
A

16.2.3 Traffic Flow


Di
st

16.2.3.1 [Event] TrafficFlowStat


rib

Table 16-53
ut

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


io

Description When traffic flow trigger the rule, send this event
n

[ Event Params ] ( JSON format )


Name Type R/O Param Description
s.r

FlowStates array<object> R Traffic flow info, each object in list is traffic flow info about
.o

one lane.
.

+Lane int R Lane number, start from 0.


+Flow int R Traffic flow number.
+Period int R Traffic stat time, unit is minute.
+PeriodByMili int O Traffic stat time, unit is millisecond, value should
between 0 and 59999.

AI APIs 392
+DrivingDirectio array<string> O Driving direction, should be an array of three strings:
n  1st string: direction, can be: "Approach", "Leave"
 2nd string: Approach position name
 3rd string: Leave position name
[ Example ]
Event --<boundary>
Content-Type: text/plain
Da

Content-Length: xxxx
hu

Code=TrafficFlowStat;action=Pulse;index=0;data={
aH

"FlowStates": [ { "Lane": 0,
"Flow": 50,
"Period": 5,
TT

"DrivingDirection": [ "Approach", "Hangzhou", "Shanghai"]


P

}, {…}, … ]
AP

}
--<boundary>
IV

16.2.3.2 Find Traffic Flow History


2.
89

Table 16-54
URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=TrafficFlow
fo

Method GET
r1

Description Find traffic flow history record.


[ Request Params ] ( key=value format in URL )
00

Name Type R/O Param Description


M

name string R The name of record table. It should be "TrafficFlow".


count int O Max result to return, default is 1024.
EG

StartTime string O The start of the record's CreateTime.


A

EndTime string O The End of the record's CreateTime.


condition object O Search condition.
Di

+Channel int O Video channel index which starts from 0.


st

+Lane int O Lane index, starts from 0.


rib

[ Response Params ] (key=value format)


Name Type R/O Param Description
ut

totalCount int O Total record num that find.


io

found int O Record num that returned.


n

records array<object> R The records that returned.


+RecNo int R Record id.
s.r

+CreateTime int R The create time of record.


.o

+StatisticsTime int R Traffic flow statistics time, UTC seconds.


.

+Period string R Statistics period, unit is second.


+Channel int R Video channel index which starts from 0.
+Lane int R Lane index, starts from 0.
+Vehicles int R Total vehicle num.
+AverageSpeed float O Average speed of the vehicle, -1 means no vehicle, 0

AI APIs 393
means congestion.
[ Example ]
Request GET
http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=TrafficFlow&condition.Cha
nnel=0&condition.Lane=0&StartTime=123456700&EndTime=123456800&count=100
Respons totalCount=1000
e found=100
Da

records[0].RecNo=12345
records[0].CreateTime=123456789
hu

records[0].StaticsticsTime=123456789
aH

records[0].Period=300
records[0].Channel=0
records[0].Lane=0
TT

records[0].Vehicles=250
P

records[0].AverageSpeed=25.4
AP


records[1].RecNo=13579
IV

records[1].CreateTime=123456799
records[1].StaticsticsTime=123456799
2.

records[1].Period=300
89

records[1].Channel=0
records[1].Lane=0
fo

records[1].Vehicles=220
records[1].AverageSpeed=21.8
r1


00

16.3 Access Control APIs


M
EG

16.3.1 Access User


A
Di

16.3.1.1 Add Access User


st
rib

Table 16-55
URL http://<server>/cgi-bin/Attendance.cgi?action=addUser
ut

Method GET
Description Add an access user. ( This api is supported by attendance machine. )
io

[ Request Params ] ( key=value format in URL )


n

Name Type R/O Param Description


s.r

UserID string R The user's id.


UserName string O The user's name.
.o

CardNo string O The user's card number.


.

Password string O The user's password.


[ Response Params ] ( OK )
[ Example ]

AI APIs 394
GET
Request http://<server>/cgi-bin/Attendance.cgi?action=addUser&UserID=102&UserName=Zhang
San&Password=123456
Response OK

16.3.1.2 Modify Access User


Da

Table 16-56
hu

URL http://<server>/cgi-bin/Attendance.cgi?action=modifyUser
Method GET
aH

Modify an access user. ( This api is supported by attendance machine. )


Description
Note: You should provide at lease one optional param to update.
TT

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
P

UserID string R The user's id.


AP

UserName string O The user's name.


IV

CardNo string O The user's card number.


Password string O The user's password.
2.

[ Response Params ] ( OK )
89

[ Example ]
GET
fo

Request http://<server>/cgi-bin/Attendance.cgi?action=modifyUser&UserID=102&UserName=Zhan
gSan&Password=123456
r1

Response OK
00

16.3.1.3 Delete Access User


M
EG

Table 16-57
URL http://<server>/cgi-bin/Attendance.cgi?action=deleteUser
A

Method GET
Di

Description Delete an access user. ( This api is supported by attendance machine. )


st

[ Request Params ] ( key=value format in URL )


rib

Name Type R/O Param Description


UserID string R The user's id.
ut

[ Response Params ] ( OK )
[ Example ]
io

Request GET http://<server>/cgi-bin/Attendance.cgi?action=deleteUser&UserID=102


n

Response OK
s.r
.o

16.3.1.4 Find Access User


.

 Find access user by UserID

Table 16-58
URL http://<server>/cgi-bin/Attendance.cgi?action=getUser
Method GET

AI APIs 395
Description Get an access user's information. ( This api is supported by attendance machine. )
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
UserID string R The user's id
[ Response Params ] ( JSON format )
Name Type R/O Param Description
UserInfo object R The user's info
Da

+UserID string R The user's id


+UserName string O The user's name
hu

+CardNo string O The user's card number


aH

+Password string O The user's password


[ Example ]
TT

Request GET http://<server>/cgi-bin/Attendance.cgi?action=getUser&UserID=102


{ "UserInfo": {
P

"UserID": 102,
AP

Response "UserName": "ZhangSan",


"Password": "123456"
IV

}
Find all access user
2.


89

Table 16-59
URL http://<server>/cgi-bin/Attendance.cgi?action=findUser
fo

Method GET
Description Get all information of access user.
r1

[ Request Params ] ( key=value format in URL )


00

Name Type R/O Param Description


Offset int R The offset of the user record table
M

Count int R The count of user info record, max is 100.


EG

[ Response Params ] ( JSON format )


Name Type R/O Param Description
A

Total int R Total user num


Di

UserInfo array<object> R The user's info


+UserID string R The user's id
st

+UserName string O The user's name


rib

+CardNo string O The user's card number


+Password string O The user's password
ut

[ Example ]
io

Request GET http://<server>/cgi-bin/Attendance.cgi?action=findUser&Offset=0&Count=100


n

{ "Total": 1000,
s.r

"UserInfo": [ {
"UserID": 102,
.o

Response "UserName": "ZhangSan",


.

"Password": "123456"
}, { … } … ]
}

AI APIs 396
16.3.1.5 Add Access User Face

Table 16-60
URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=add
Method POST
Description Add an access user face.
Da

[ Request Params ] ( JSON format in body )


Name Type R/O Param Description
hu

UserID string R The user's id.


Info object R The user's info.
aH

+UserName string O The user's name.


The user's room num list, max array size is 32, max string
TT

+RoomNo array<string> O
size is 12. ( This param is not supported by access control. )
The user's face feature, encode with base64, max array size
P

is 20, and max string size is 2k.


AP

+FaceData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
IV

The user's face photo, encode with base64, max array size is
2.

5, and max string size is 200k.


+PhotoData array<string> O
89

Note: There must be at least one between FaceData and


PhotoData.
fo

[ Response Params ] ( OK )
[ Example ]
r1

POST http://<server>/cgi-bin/FaceInfoManager.cgi?action=add
00

Content-Type: application/json
Content-Length: <length>
M

{ "UserID": "102",
EG

"Info": {
Request
A

"UserName": "ZhangSan",
"RoomNo": [ "301", "303", … ],
Di

"FaceData": [ "xxxx", "xxxx", … ],


st

"PhotoData": [ "yyyy", "yyyy", … ]


rib

}
}
ut

Response OK
io
n

16.3.1.6 Modify Access User Face


s.r

Table 16-61
.o

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=update
.

Method POST
Description Update an access user face.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description

AI APIs 397
UserID string R The user's id.
Info object R The user's info.
+UserName string O The user's name.
The user's room num list, max array size is 32, max string
+RoomNo array<string> O
size is 12. ( This param is not supported by access control. )
The user's face feature, encode with base64, max array size
is 20, and max string size is 2k.
Da

+FaceData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
hu

The user's face photo, encode with base64, max array size is
aH

5, max string size is 200k.


+PhotoData array<string> O
Note: There must be at least one between FaceData and
PhotoData.
TT

[ Response Params ] ( OK )
P

[ Example ]
AP

POST http://<server>/cgi-bin/FaceInfoManager.cgi?action=update
Content-Type: application/json
IV

Content-Length: <length>
2.

{ "UserID": "102",
89

"Info": {
Request
"UserName": "ZhangSan",
fo

"RoomNo": ["301", "303", …],


r1

"FaceData": ["xxxx", "xxxx", …],


"PhotoData": ["yyyy", "yyyy", …]
00

}
}
M

Response OK
EG

16.3.1.7 Delete Access User Face


A
Di

Table 16-62
st

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=remove
rib

Method GET
Description Delete an access user face.
ut

[ Request Params ] ( key=value format in URL )


io

Name Type R/O Param Description


UserID string R The user's id.
n

[ Response Params ] ( OK )
s.r

[ Example ]
.o

Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=remove&UserID=102


Response OK
.

16.3.1.8 Find Access User Face


 Start to find access user face

AI APIs 398
Table 16-63
URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=startFind
Method GET
Descripti
Start to find access user face.
on
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Da

Condition object O Search condition.


+UserID string O The user's id.
hu

[ Response Params ] ( JSON format )


aH

Name Type R/O Param Description


The token of this search, use this token to get result and stop
Token int O
TT

search.
Total int O Result num, return 0 if not found.
P

[ Example ]
AP

Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=startFind


{ "Token": 1234,
IV

Response "Total": 20
}
2.

 Get the find result


89

Table 16-64
fo

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=doFind
Method GET
r1

Descripti
Get the find result.
00

on
[ Request Params ] ( key=value format in URL )
M

Name Type R/O Param Description


EG

The token of this search, use this token to get result and stop
Token int R
search.
A

Offset int R Offset in the result record set, range is [0, Total – 1].
Di

Count int R Count of result to get.


[ Response Params ] ( JSON format )
st

Name Type R/O Param Description


rib

Info array<object> R The face information of user.


+UserID string R The user's id.
ut

The user's face photo's MD5 hash string, max array size is 5,
io

+MD5 array<string> O
max string size is 33.
n

[ Example ]
s.r

GET
Request http://<server>/cgi-bin/FaceInfoManager.cgi?action=doFind&Token=1234&Offset=0&Coun
.o

t=20
.

{ "Info": [ {
"UserID": "102",
Response "MD5": [ "xxxx", "xxxx", … ]
}, { … }, … ]
}

AI APIs 399
 Stop the find session

Table 16-65
URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=stopFind
Method GET
Description Stop the find session.
[ Request Params ] ( key=value format in URL )
Da

Name Type R/O Param Description


Token for this search, use this token to get result and stop
Token int R
hu

search.
[ Response Params ] ( OK )
aH

[ Example ]
Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=stopFind&Token=1234
TT

Response OK
P
AP

16.3.1.9 Add Access User Card and Fingerprint


IV

 Add Access user card only

Table 16-66
2.

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard
89

Method GET
Description Insert access user card info.
fo

[ Request Params ] ( key=value format in URL )


r1

Name Type R/O Param Description


Access user card and fingerprint record name, should be
00

name string R
"AccessControlCard".
M

CardName string R Access user card name, max string length is 32.
CardNo string R Access user card number.
EG

UserID string R The user's id.


Card status, 0 means normal, and abnormal status can be sum
A

of following:
Di

 1 << 0: report the loss of the card


st

 1 << 1: the card is withdrawed


CardStatus int R 1 << 2: the card is frozen
rib


 1 << 3: the card is arrearage
ut

 1 << 4: the card exceeds the time limit


 1 << 5: the card is arrearage but still can open the door, and
io

there will be voice prompts.


n

The card type:


s.r

CardType int O 0 : Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
Blacklist Card, 5: Stress Card, 0xff: Mother Card
.o

The Access card's password. ( This param is not supported by


.

Password string O
video talk device )
The index of the doors that this card can open. ( This param is
Doors array<int> O
not supported by video talk device )

AI APIs 400
The index of the time sections of each door that this card can
TimeSections array<int> O
open. ( This param is not supported by video talk device )
VTO position number. ( This param is not supported by access
VTOPosition string O
control device )
ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".
ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".
Is the card still valid. ( This param is not supported by video talk
Da

IsValid bool O
device )
[ Response Params ] (key=value format)
hu

R/
Name Type Param Description
aH

O
RecNo int R The record id.
TT

[ Example ]
GET
P

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard&
AP

Request CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&CardType=0&Pass
word=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&VTOPosition=01018001&ValidDateS
IV

tart=20151022%20093811&ValidDateEnd=20151222%20093811
Response RecNo=12345
2.

 Add access user card with fingerprint


89

Table 16-67
fo

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insertEx&name=AccessControlCard
Method POST
r1

Description Insert access user card and fingerprint. ( This api is not supported by video talk device )
00

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
M

Access user card and fingerprint record name, should be


name string R
EG

"AccessControlCard".
CardName string R Access user card name, max string length is 32.
A

CardNo string R Access user card number.


Di

UserID string R The user's id.


Card status, 0 means normal, and abnormal status can be sum
st

of following:
rib

 1 << 0: report the loss of the card


 1 << 1: the card is withdrawed
ut

CardStatus int R  1 << 2: the card is frozen


io

 1 << 3: the card is arrearage


n

 1 << 4: the card exceeds the time limit


1 << 5: the card is arrearage but still can open the door,
s.r


and there will be voice prompts.
.o

The card type:


.

CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
Blacklist Card, 5: Stress Card, 0xff: Mother Card
Password string O The Access card's password.
Doors array<int> O The index of the doors that this card can open.

AI APIs 401
The index of the time sections of each door that this card can
TimeSections array<int> O
open.
VTO position number. ( This param is not supported by access
VTOPosition string O
control device )
ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".
ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".
IsValid bool O Is the card still valid.
Da

FingerprintPack
object O The fingerprint packet info.
et
hu

+Length int O The length of each fingerprint packet.


aH

+Count int O The count of fingerprint packet.


[ Response Params ] (key=value format)
TT

R/
Name Type Param Description
O
P

RecNo int R The record id.


AP

[ Example ]
POST
IV

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insertEx&name=AccessControlCar
d&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&Password=1234
2.

56&Doors[0]=1&Doors[1]=3&Doors[2]=5&VTOPosition=01018001&ValidDateStart=20151
89

022%20093811&ValidDateEnd=20151222%20093811&FingerprintPacket.Length=500&Fi
Request
ngerprintPacket.Count=3
fo

Content-Type: application/octet-stream
r1

Content-Length: <length>
00

<fingerprint packet binary data>


Response RecNo=12345
M
EG

16.3.1.10 Modify Access User Card and Fingerprint


A

 Update Access user card only


Di

Table 16-68
st

URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCard
rib

Method GET
Update access user card info.
ut

Description
Note: You should provide at lease one optional param to update.
io

[ Request Params ] ( key=value format in URL )


n

Name Type R/O Param Description


Access user card and fingerprint record name, should be
s.r

name string R
"AccessControlCard".
.o

recno int R The record id.


.

CardName string O Access user card name, max string length is 31.
Access user card number.
CardNo string O
Primary key, modification is not allowed in principle
The user's id.
UserID string O
Primary key, modification is not allowed in principle

AI APIs 402
…<See above insert command for other params of the record,
…<other param> — —
They are all optional.>
[ Response Params ] ( OK )
[ Example ]
GET
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCar
Request d&recno=12345&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&
Da

CardType=0&Password=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&ValidDateStart=
20151022%20093811&ValidDateEnd=20151222%20093811
hu

Response OK
aH

 Update access user card and fingerprint

Table 16-69
TT

URL http://<server>/cgi-bin/recordUpdater.cgi?action=updateEx&name=AccessControlCard
Method POST
P

Update access user card info and fingerprint. ( This api is not supported by video talk
AP

Description device )
Note: You should provide at lease one optional param to update.
IV

[ Request Params ] ( key=value format in URL )


2.

Name Type R/O Param Description


89

Access user card and fingerprint record name, should be


name string R
"AccessControlCard".
fo

recno int R The record id.


CardName string O Access user card name, max string length is 32.
r1

Access user card number.


CardNo string O
00

Primary key, modification is not allowed in principle


The user's id.
UserID string O
M

Primary key, modification is not allowed in principle


EG

…<See above insert command for other params of the record.


…<other param>
They are all optional.>
A

FingerprintPack
object O The fingerprint packet info.
et
Di

+Length int O The length of each fingerprint packet.


st

+Count int O The count of fingerprint packet.


rib

[ Response Params ] ( OK )
[ Example ]
ut

POST
io

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=updateEx&name=AccessControlC
n

ard&recno=12345&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0
&CardType=0&Password=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&ValidDateStart
s.r

=20151022%20093811&ValidDateEnd=20151222%20093811&FingerprintPacket.Length
Request
.o

=500&FingerprintPacket.Count=3
.

Content-Type: application/octet-stream
Content-Length: <length>

<fingerprint packet binary data>


Response OK

AI APIs 403
16.3.1.11 Delete Access User Card and Fingerprint
 Delete Access user card and fingerprint record by recno

Table 16-70
URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCard
Method GET
Da

Descriptio Remove the access user card and fingerprint record. ( The video talk device can not delete
n fingerprint data.)
hu

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
aH

Access user card and fingerprint record name, should be


name string R
"AccessControlCard".
TT

recno int R The record id.


[ Response Params ] ( OK )
P

[ Example ]
AP

GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCar
IV

d&recno=12345
2.

Response OK
89

 Delete all Access user card and fingerprint records

Table 16-71
fo

URL http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCard
r1

Method GET
Descriptio Remove all the access user card and fingerprint records. ( The video talk device can not
00

n delete fingerprint data.)


[ Request Params ] ( key=value format in URL )
M

Name Type R/O Param Description


EG

Access user card and fingerprint record name, should be


name string R
"AccessControlCard".
A

[ Response Params ] ( OK )
Di

[ Example ]
st

GET
Request
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCard
rib

Response OK
ut
io

16.3.1.12 Find Access User Card and Fingerprint


n

 Find Access user card by condition


s.r

Table 16-72
.o

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
.

Method GET
Description Find Access user card record by condition.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R Record Name, should be "AccessControlCard".

AI APIs 404
count int O Max result to return, default is 1024.
StartTime string O The start of the record's CreateTime.
EndTime string O The End of the record's CreateTime.
condition object O Search condition.
+CardNo string O Access user card number.
+UserID string O The user's id.
+IsValid bool O The access card valid or not.
Da

[ Response Params ] (key=value format)


Name Type R/O Param Description
hu

totalCount int O The total record num that find.


aH

found int O The record num that returned.


records array<object> R The records that returned.
TT

+RecNo int R The record id.


+CreateTime int O The create time of record.
P

+CardName string R The access user card name, max string length is 32.
AP

+CardNo string R The access user card number.


+UserID string R The user's id.
IV

Card status, 0 means normal, and abnormal status can be


2.

sum of following:
 1 << 0: report the loss of the card
89

 1 << 1: the card is withdrawed


+CardStatus int R  1 << 2: the card is frozen
fo

 1 << 3: the card is arrearage


r1

 1 << 4: the card exceeds the time limit


 1 << 5: the card is arrearage but still can open the door,
00

and there will be voice prompts.


M

The card type:


+CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
EG

Blacklist Card, 5: Stress Card, 0xff: Mother Card


The Access card's password. ( This param is not supported
A

+Password string O
by video talk device )
Di

The index of the doors that this card can open. ( This param is
+Doors array<int> O
st

not supported by video talk device )


rib

The index of the time sections of each door that this card can
+TimeSections array<int> O
open. ( This param is not supported by video talk device )
ut

VTO position number. ( This param is not supported by


+VTOPosition string O
access control device )
io

+ValidDateStar
n

string O The start of valid date, format is "yyyyMMdd hhmmss".


t
s.r

+ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


Is the card still valid. ( This param is not supported by video
.o

+IsValid bool O
talk device )
.

+Handicap bool O is the cad of disabled


+CitizenIDNo string O citizen card id
+RepeatEnter
integer O timeout of repeater enter route, unit: s
RouteTimeout

AI APIs 405
user type, it can be {
1: normal user
+UserType integer O
2: user in blacklist
}
+FirstEnter bool O is with first enter authority
+DynamicChec
string O dynamic check code
kCode
Da

+UseTime integer O count of use


[ Example ]
hu

GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
Request
aH

&condition.UserID=103&StartTime=123456700&EndTime=123456800&count=100
totalCount=1000
found=100
TT

records[0].RecNo=12345
P

records[0].CreateTime=123456789
AP

records[0].CardName=ZhangSan
records[0].CardNo=300
IV

records[0].UserID=103
records[0].CardStatus=0
2.

records[0].CardType=0
89

records[0].Doors[0]=1
records[0].Doors[1]=3
fo

records[0].Doors[2]=5
r1

records[0].VTOPosition=01018001
records[0].ValidStart=20151022 093811
00

records[0].ValidEnd=20151222 093811
records[0].IsValid=true
M

Response …
EG

records[1].RecNo=13579
records[1].CreateTime=123456799
A

records[1].StaticsticsTime=123456799
Di

records[1].CardName=ZhangSan
records[1].CardNo=302
st

records[1].UserID=103
rib

records[1].CardStatus=0
records[1].CardType=0
ut

records[1].Doors[0]=2
io

records[1].Doors[1]=4
n

records[1].Doors[2]=6
records[1].VTOPosition=01018002
s.r

records[1].ValidStart=20151022 093811
.o

records[1].ValidEnd=20151222 093811
records[1].IsValid=true
.


 Find Access user card by recno

Table 16-73

AI APIs 406
URL http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCard
Method GET
Description Find Access user card record by recno.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R Record Name, should be "AccessControlCard".
recno int R The record id.
Da

[ Response Params ] (key=value format)


Name Type R/O Param Description
hu

record object R The record that returned.


aH

+RecNo int R The record id.


+CreateTime int O The create time of record.
TT

+CardName string R The access user card name, max string length is 32.
+CardNo string R The access user card number.
P

+UserID string R The user's id.


AP

…<other param> — — …<See above find command for other params of the record.>
[ Example ]
IV

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCar
Request
2.

d&recno=4
record.RecNo=4
89

record.CreateTime=123456789
record.CardName=ZhangSan
fo

record.CardNo=300
r1

record.UserID=103
record.CardStatus=0
00

record.CardType=0
M

Response record.Doors[0]=1
record.Doors[1]=3
EG

record.Doors[2]=5
record.VTOPosition=01018001
A

record.ValidStart=20151022 093811
Di

record.ValidEnd=20151222 093811
st

record.IsValid=true

rib

 Find Access user card and fingerprint by recno


ut

Table 16-74
io

URL http://<server>/cgi-bin/recordUpdater.cgi?action=getEx&name=AccessControlCard
n

Method GET
Find Access user card and fingerprint record by recno. ( This api is not supported by
s.r

Description
video talk device )
.o

[ Request Params ] ( key=value format in URL )


.

Name Type R/O Param Description


name string R Record Name, should be "AccessControlCard".
recno int R The record id.
[ Response Params ] (key=value format)
Name Type R/O Param Description

AI APIs 407
record object R The record that returned.
+RecNo int R The record id.
+CreateTime int O The create time of record.
+CardName string R The access user card name, max string length is 32.
+CardNo string R The access user card number.
+UserID string R The user's id.
…<other param> — — …<See above find command for other params of the record.>
Da

+FingerprintPac
object O The fingerprint packet info.
ket
hu

++Length int O The length of each fingerprint packet.


aH

++Count int O The count of fingerprint packet.


[ Example ]
TT

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getEx&name=AccessControl
Request
Card&recno=4
P

HTTP/1.1 200 OK
AP

Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
IV

Content-Length: <length>
2.

--<boundary>
89

Content-Type: text/plain
Content-Length: <length>
fo
r1

record.RecNo=4
record.CreateTime=123456789
00

record.CardName=ZhangSan
record.CardNo=300
M

record.UserID=103
EG

record.CardStatus=0
record.CardType=0
A

Response
record.Doors[0]=1
Di

record.Doors[1]=3
record.Doors[2]=5
st

record.VTOPosition=01018001
rib

record.ValidStart=20151022 093811
record.ValidEnd=20151222 093811
ut

record.IsValid=true
io


n

record.FingerprintPacket.Length=500
s.r

record.FingerprintPacket.Count=3
--<boundary>
.o

Content-Type: application/octet-stream
.

Content-Length: <length>

<fingerprint packet binary data>


--<boundary>--

AI APIs 408
16.3.1.13 Get the Total Number of Records of Access User Card and

Fingerprint

Table 16-75
http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessControlCar
URL
d
Da

Method GET
hu

Description Get the total number of records of the access user card record.
[ Request Params ] ( key=value format in URL )
aH

Name Type R/O Param Description


Access user card and fingerprint record name, should be
name string R
TT

"AccessControlCard".
[ Response Params ] ( key=value )
P

count int R The total number of records.


AP

[ Example ]
GET
IV

Request http://192.168.1.108/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessContr
2.

olCard
89

Response count=150

16.3.2 Access control


fo
r1

16.3.2.1 [Event] AccessControl


00
M

Table 16-76
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
EG

Description When user trying to open the door, send this event.
A

[ Event Params ] ( key=value format )


Name Type R/O Param Description
Di

Events array<object> R Event info array


st

+EventBaseInfo object R Base info of event


rib

++Code String R Event Code. It should be AccessControl


++Action String R Event Action. It can be: "Start", "Stop", "Pulse"
ut

++Index int O The channel index relate to this event.


io

+RecNo int R The record id


n

+Name string O The name of the door


+Type string O The event type. It can be: "Entry", "Exit"
s.r

Open door result, can be: 0—failed, 1—success


+Status int O
.o

If this param does not exist, that means success.


.

AI APIs 409
Open door method, can be:
0: by password
1: by access card
2: by access card and then password
3: by password and then access card
6: by fingerprint
7: by password and access card and fingerprint together
Da

8 : by password and fingerprint together


9 : by access card and fingerprint together
hu

10: reserved
11: by multiple access user
aH

12: by key
13: by duress password
TT

14: by QR code, local


P

15: by face recognition, local


16: reserved
AP

17: by ID card
IV

18: by face and ID card


19: by Bluetooth
2.

20: by custom password


89

21: by UserId and password


22: by face and password
fo

23: by fingerprint and password


+Method int R 24: by fingerprint and face
r1

25: by access card and face


00

26: by face or password


27: by fingerprint or password
M

28: by fingerprint or face


EG

29: by access card or face


30: by access card or fingerprint
A

31: by fingerprint and face and password


32: by access card and face and password
Di

33: by access card and fingerprint and password


st

34: by access card and fingerprint and face


rib

35: by fingerprint or face or password


36: by access card or face or password
ut

37: by access card or fingerprint or face


io

38: by access card and fingerprint and face and password


39: by access card or fingerprint or face or password
n

40: by ID card and face, or access card or face


s.r

41: by ID card or QR code or face


.o

42: by DTMF(SIPINFO,RFC2833,INBAND)
43: by QR code, remote
.

44: by face recognition, remote


45: by ID card ( match with fingerprint in ID card )
46: by temporary password
47: by health code

AI APIs 410
+CardNo string O Card number if the door is opened by card
+UserID string R The user id
+ErrorCode integer O error code
+ObjectPropertie O
object Dynamic structure info
s
O is with mask, it can be {
0: unknow
Da

++Mask integer 1: without mask


2: with mask
hu

}
aH

+ManTemperatu O
object people’s temperature info
reInfo
++CurrentTempe O
TT

float people’s current temperature


rature
P

O temperature unit:{
AP

0: centigrade
++TemperatureU
integer 1: Fahrenheit
nit
IV

2: Kelvin
}
2.

++IsOverTemper O
89

bool is over temperature


ature
[ Example ]
fo

--<boundary>
r1

Content-Type: text/plain
Content-Length: <length>
00

Events[0].EventBaseInfo.Code=TrafficJam
M

Events[0].EventBaseInfo.Action=Pulse
EG

Events[0].EventBaseInfo.Index=0
Events[0].RecNo=123
A

Events[0].Name=Door1
Di

Events[0].Type=Entry
Event Events[0].Status=1
st

Events[0].Method=1
rib

Events[0].CardNo=09DDAABB
Events[0].UserID=101
ut


io

--<boundary>
n

Content-Type: image/jpeg
s.r

Content-Length: <image size>


.o

<Jpeg image data>


.

--<boundary>

AI APIs 411
16.3.2.2 [Event] CitizenPictureCompare

Table 16-77
Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event
Description When user trying to open the door, send this event.
[ Event Params ] ( key=value format )
Da

Name Type R/O Param Description


Events array<object> R Event info array
hu

+EventBaseInfo object R Base info of event


++Code String R Event Code. It should be CitizenPictureCompare
aH

++Action String R Event Action. It can be: "Pulse"


++Index int O The channel index relate to this event.
TT

+UTC uint32 O UTC 时间


P

+CompareResult bool O compare result. If the similarity is greater than or equal to


the threshold, the comparison is considered successful
AP

+Similarity integer O Similarity of two pictures, Unit: percentage


IV

range[1, 100]
+Threshold integer O check threshold
2.

range[1, 100]
89

+Citizen String O citzen name


+Sex integer O sex, it can be: {
fo

0 unknow
1 male
r1

2 female
00

9 not stated
}
M

+Ethnicity integer O ethnicity (refer to CitizenIDCard)


EG

+Birth String O birthday, such as "1980-01-01"


+Address String O address
A

+Number String O citizen ID


Di

+Authority String O signing and issuing organization


+Start String O Effective date
st

+End String O Expiration date, and "Endless" mens Long term


rib

effectiveness
+ImageInfo array<object> O Picture information, the first for the face cutout, the second
ut

for the ID card photo


io

++Offset integer O the offset in binary data


n

++Length integer O length of picture, unit: Byte


++Width integer O Picture width, pixels
s.r

++Height integer O Picture height, pixels


.o

+ImageInfoEx array<object> O extension of picture info, (The total number of images


.

uploaded is determined by imageinfo and imageinfoex)


6 at most
++Type integer O picture type
0 Local face database
1 Shooting scene map

AI APIs 412
++Offset integer O the offset in binary data
++Length integer O length of picture, unit: Byte
++Width integer O Picture width, pixels
++Height integer O Picture height, pixels
+CardNo String O IC card number (for building products)
+CellPhone String O phone number (input number before comparison) (for
building products)
Da

+BuildingNumbe String O building number (for building products)


r
hu

+BuildingUnitNu String O building entrance number (for building products)


aH

mber
+BuildingRoomN String O room number (for building products)
TT

umber
+PersonnelRelat String O relationship (for building products)
P

ionship
AP

+Method integer O method (refer to OpenDoorMethod)


+EventGroupID integer O event group id, used to associate different events are with
IV

same action. (Used with AccessControlevents)


+CallNumber String O phone number to be called.(called after compare succeed)
2.

(for building products)


89

+EventType integer O event type:


0: compare result
fo

1: Face acquisition
r1

2: visitor registration
3: Face permission distribution
00

4: inquirement of ID card face group


+UserID String O user ID
M

+FaceIndex integer O face index, range [0,4]


EG

+Mask integer O is with mask, it can be {


0: unknow
A

1: without mask
Di

2: with mask
st

}
default 0.
rib

[ Example ]
ut

--<boundary>
Content-Type: text/plain
io

Content-Length: <length>
n
s.r

Events[0].EventBaseInfo.Code= CitizenPictureCompare
Event Events[0].EventBaseInfo.Action=Pulse
.o

Events[0].EventBaseInfo.Index=0
.

Events[0].UTC=1999999999
Events[0].CompareResult=true
Events[0].Similarity=80
Events[0].Threshold=75

AI APIs 413

--<boundary>
Content-Type: image/jpeg
Content-Length: <image size>

<Jpeg image data>


--<boundary>
Da
hu

16.3.2.3 Find AccessControl Record


aH

Table 16-78
URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=<RecordName>
TT

Method GET
Description Find AccessControl record.
P

[ Request Params ] ( key=value format in URL )


AP

Name Type R/O Param Description


The record table name. It should be
IV

name string R
"AccessControlCardRec".
2.

count int O Max result to return, default is 1024.


89

StartTime string O The start of the record's CreateTime.


EndTime string O The end of the record's CreateTime.
fo

condition object O Search condition.


+CardNo string O Access user card number.
r1

[ Response Params ] (key=value format)


00

Name Type R/O Param Description


totalCount int O Total record num that find.
M

found int O Record num that returned.


EG

array<object
records R The records that returned.
>
A

+RecNo int R Record id.


Di

+CreateTime int O Record create time, UTC time.


+CardNo int R Access user card number.
st

+CardName string O Access user card name, max string length is 31.
rib

The card type:


+CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card,
ut

4: Blacklist Card, 5: Stress Card, 0xff: Mother Card


io

+Password string O The Access card's password.


n

+UserID string R The user's id.


+Type string O
s.r

The event type. It can be: "Entry", "Exit".


Open door result. It can be: 0—failed, 1—success.
+Status int O
.o

If this param does not exist, that means success.


.

AI APIs 414
Open door method. It can be:
 0: by password
 1: by access card
+Method int R  2: by access card and then password
 3: by password and then access card
 6: by fingerprint
 15: by face recognition
Da

The index of the door. ( This param is not supported by


+Door int O
video talk device )
hu

The access user card ID of reader. ( This param is not


+ReaderID string O
aH

supported by video talk device )


+ErrorCode int O The error code, valid only when Status is 0.
The picture's URL, max string length is 127. ( This param is
TT

+URL string O
not supported by access control device )
P

The record video's URL, max string length is 127. ( This


+RecordURL string O
AP

param is not supported by access control device )


+IsOverTempera
bool O is over temperature
IV

ture
O temperature unit:{
2.

0: centigrade
+TemperatureUn
89

integer 1: Fahrenheit
it
2: Kelvin
fo

}
r1

+CurrentTemper O
float current temperature
ature
00

+CitizenIDResult bool O citizen ID compare result


+CitizenIDName string O citizen name
M

+CitizenIDNo string O citizen ID number


EG

O sex:{
0: unknow
A

1: male
+CitizenIDSex integer
Di

2: female
9: not stated
st

}
rib

+CitizenIDEthnic O
integer citizen ID ethnicity
ity
ut

+CitizenIDBirth string O birthday, format as "1980-01-01"


io

+CitizenIDAddre O
string address
n

ss
s.r

+CitizenIDAutho O
string signing and issuing organization
rity
.o

+CitizenIDStart string O Effective date


.

string O Expiration date, and "Endless" mens Long term


+CitizenIDEnd
effectiveness
[ Example ]
Request GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard

AI APIs 415
Rec&StartTime=123456700&EndTime=123456800&condition.CardNo=12001&count=100
totalCount=1000
found=100
records[0].RecNo=12345
records[0].CreateTime=123456789
records[0].CardNo=12001
records[0].CardName=ZhangSan
Da

records[0].UserID=ZhangSan
records[0].Type=Entry
hu

records[0].Method=1
Response

aH

records[1].RecNo=13579
records[1].CreateTime=123456799
TT

records[1].CardNo=12001
P

records[1].CardName=ZhangSan
AP

records[1].UserID=ZhangSan
records[1].Type=Exit
IV

records[1].Method=1

2.
89
fo
r1
00
M
EG
A
Di
st
rib
ut
io
n
s.r
.o
.

AI APIs 416

You might also like