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

Intelbras HTTP API v3.10

This document provides an overview of recommendations to improve cybersecurity for network video systems. It outlines both mandatory and optional security best practices including changing default passwords, updating firmware, enabling HTTPS/SSL, adjusting network port settings, restricting user permissions, and physically securing devices. Regular password changes, access logs, isolating camera networks, and disabling unneeded features are also recommended to help protect against unauthorized access.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
731 views

Intelbras HTTP API v3.10

This document provides an overview of recommendations to improve cybersecurity for network video systems. It outlines both mandatory and optional security best practices including changing default passwords, updating firmware, enabling HTTPS/SSL, adjusting network port settings, restricting user permissions, and physically securing devices. Regular password changes, access logs, isolating camera networks, and disabling unneeded features are also recommended to help protect against unauthorized access.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 551

API of HTTP Protocol Specification

DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

V3.10
2022-04-20
Cybersecurity Recommendations
Mandatory actions to be taken towards cybersecurity
1. Change Passwords and Use Strong Passwords:
The number one reason systems get "hacked" is due to having weak or default passwords. It is
recommended to change default passwords immediately and choose a strong password whenever
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.
2. Update Firmware
As is standard procedure in the tech-industry, we recommend keeping NVR, DVR, and IP camera
firmware up-to-date to ensure the system is current with the latest security patches and fixes.
"Nice to have" recommendations to improve your network security
DA

1. Change Passwords Regularly


HU

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

access the system.


HT

2. Change Default HTTP and TCP Ports:


TP

● Change default HTTP and TCP ports for systems. These are the two ports used to communicate and
to view video feeds remotely.
_A

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

reduces the risk of outsiders being able to guess which ports you are using.
3. Enable HTTPS/SSL:
fo

Set up an SSL Certificate to enable HTTPS. This will encrypt all communication between your devices
r

and recorder.
In

4. Enable IP Filter:
te

Enabling your IP filter will prevent everyone, except those with specified IP addresses, from accessing
lb

the system.
5. Change ONVIF Password:
ra

On older IP Camera firmware, the ONVIF password does not change when you change the system's
s

credentials. You will need to either update the camera's firmware to the latest revision or manually
change the ONVIF password.
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
to the device. Do not DMZ the device's IP address.
● You do not need to forward any ports for individual cameras if they are all connected to a recorder on
site; just the NVR is needed.
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:
Disable SNMP if you are not using it. If you are using SNMP, you should do so only temporarily, for
tracing and testing purposes only.
10. Multicast:
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.
11. Check the Log:
If you think 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
DA

accessed.
HU

12. Physically Lock Down the Device:


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

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

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


TP

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

cannot be accessed directly.


14. Isolate NVR and IP Camera Network
PI

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

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.
r
In
te
lb
ra
s

Cybersecurity Recommendations II
Foreword

Purpose

Welcome to use API of HTTP protocol specification.

Reader

 API software development engineers


 Project managers
 Product managers
DA

Safety Instructions
HU

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

Signal Words Meaning


HT

Indicates a high potential hazard which, if not avoided, will result in death
TP

DANGER or serious injury.


_A

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


PI

WARNING result in slight or moderate injury.


fo

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


r

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


In

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

Provides additional information as the emphasis and supplement to the


NOTE
ra

text.
s

Revision History

No. Version Revision Content Release Time


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

2 V2.60 Add find media file with TrafficCar info. September 12, 2018
Add the "错误!未找到引用源。 错误!未找到引用源。"
3 V2.61 October 24, 2018
chapter.
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
13 V2.71 Add get the max and min temperature values June 3, 2019
14 V2.72 Add smart motion detection config June 27, 2019
15 V2.73 Add ecrypted download media file July 16, 2019
Adjust Camera Image, Exposure, Backlight, White
16 V2.74 Balance, Day-Night, Zoom and Focus, Lighting, Video July 25, 2019
in Options config.
17 V2.75 Add adjust angle and depth field August 13, 2019
DA

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


HU

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


A_

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

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


TP

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


_A

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


PI

24 V2.82 Add Radar Adaptor March 23, 2020


fo

Add Radar Adaptor getCapsEx


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

26 V2.84 Add AccessControl getLockStatus June 12, 2020


In

27 V2.85 Add GlobalDeviceParam SupportGlobalDeviceParam July 2, 2020


te

Add ObjectPlacementDetection
lb

28 V2.86 November 5,2020


ObjectRemovalDetection
ra

Add Radar Adaptor addRadarLinkSD, delRadarLinkSD


29 V2.87 November 6,2020
s

Add VideoInAnalyse getTemplateRule


30 V2.88 Add LensManager, resetAngle November 26,2020
31 V2.89 Add config to Radar Adaptor December 3, 2020
32 V2.90 Add Get Heat Map Info January 7, 2021
33 V2.91 Add export Encryped Log January 12, 2021
34 V2.92 Add controller related February 23, 2021
35 V2.93 Add config to objectdetect DirectionStats March 1,2021
36 V2.94 Add Camera to a Specific NVR Channel March 11, 2021
37 V2.95 Add add and remove configure March 26, 2021
38 V2.96 Add Add WorkSuitCompareServer April 22,2021

Foreword IV
No. Version Revision Content Release Time
Add VideoAnalyseRule head. Type add ObjectPlacement
39 V2.97 April 25,2021
and ObjectRemoval
40 V2.98 Modify WorkSuitCompareServer May 11,2021
41 V2.99 Modify WorkSuitCompareServer doFind May 11,2021
Add trafficFlowStat stopFind, trafficFlowStat doFind and
42 V3.00 May 27,2021
trafficFlowStat startFind
Add configManager setConfig
43 V3.01 June 3,2021
IntelliSchemeTour.Enable
44 V3.02 Add configManager getConfig IntelliSchemeTour June 11,2021
45 V3.03 Add method cancel upgrade June 21, 2021
46 V3.04 doFindHistoryByPic Add Time Sept 29, 2021
47 V3.05 Add Cloud Upgrade, add find smd data December 22, 2021
48 V3.06 Add OpenAI January 11,2022
DA

49 V3.07 Add correctScene api January 21, 2022


HU

50 V3.08 Add SSHD config February 16, 2022


A_

51 V3.09 Add Water Data Analyse February 17, 2022


HT

52 V3.10 Add Http Uploading api April 20, 2022


TP
_A

Privacy Protection Notice


PI

As the device user or data controller, you might collect personal data of other such as face,
fo

fingerprints, car plate number, Email address, phone number, GPS and so on. You need to be in
r

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
In

visible identification to inform data subject the existence of surveillance area and providing related
te

contact.
lb
ra

About the Manual


s

 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
website. If there is inconsistency between paper manual and the electronic version, the
electronic version shall prevail.
 All the designs and software are subject to change without prior written notice. The product
updates might cause some differences between the actual product and the Manual. Please
contact the customer service for the latest program and supplementary documentation.
 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.

Foreword V
 Upgrade the reader software or try other mainstream reader software if the Manual (in PDF
format) cannot be opened.
 All trademarks, registered trademarks and the company names in the Manual are the
properties of their respective owners.
 Please visit our website, contact the supplier or customer service if there is any problem
occurred when using the device.
 If there is any uncertainty or controversy, please refer to our final explanation.
DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

Foreword VI
Table of Contents
Cybersecurity Recommendations ........................................................................................................... I
Foreword .................................................................................................................................................. III
1 Overview................................................................................................................................................. 1
2 References........................................................................................................................................... 2
3 Definitions ........................................................................................................................................... 3
3.1 Abbreviations................................................................................................................................. 3
3.2 Syntax Convention ........................................................................................................................ 3
3.3 API Request Format...................................................................................................................... 3
3.4 Server Response Format .............................................................................................................. 4
3.5 Authentication................................................................................................................................ 5
DA

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


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

4 General APIs........................................................................................................................................ 7
A_

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


HT

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


TP

4.1.2 Get Playback Stream .......................................................................................................... 9


4.1.3 Get File Stream................................................................................................................... 9
_A

4.1.4 Get MJPG Stream ............................................................................................................ 10


PI

4.1.5 Configuring Local Playback Status................................................................................... 10


4.1.6 Acquiring Local Playback Status .......................................................................................11
fo

4.2 Configure Manager ..................................................................................................................... 12


r

4.2.1 Get and Set Configure ...................................................................................................... 12


In

4.2.2 Add and Remove Configure ............................................................................................. 13


4.2.3 Backup of Config .............................................................................................................. 14
te

4.2.4 Restore the Config ............................................................................................................ 14


lb

4.2.5 Restore except the Config ................................................................................................ 15


ra

4.3 Audio ........................................................................................................................................... 15


s

4.3.1 Get Audio Input Channel Numbers................................................................................... 15


4.3.2 Get Audio Output Channel Numbers ................................................................................ 16
4.3.3 Post Audio Stream ............................................................................................................ 16
4.3.4 Get Audio Stream ............................................................................................................. 17
4.3.5 [Config] Volume Control .................................................................................................... 18
4.4 Snapshot ..................................................................................................................................... 19
4.4.1 [Config] Snap .................................................................................................................... 19
4.4.2 Get a Snapshot ................................................................................................................. 20
4.4.3 Subscribe to Snapshot ..................................................................................................... 21
4.5 Video Attributes ........................................................................................................................... 23
4.5.1 Get Max Extra Stream Numbers ...................................................................................... 23
4.5.2 Get Encode Capability ...................................................................................................... 24
4.5.3 Get Encode Config Capability .......................................................................................... 25
4.5.4 Encode of Media ............................................................................................................... 29

Table of Contents VII


4.5.5 Encode of Region Interested ............................................................................................ 33
4.5.6 [Config] Channel Title ....................................................................................................... 34
4.5.7 Get Video Input Channels Device Supported .................................................................. 35
4.5.8 Get Video Output Channels Device Supported ................................................................ 35
4.5.9 Get Max Remote Input Channels ..................................................................................... 36
4.5.10 Video Standard ............................................................................................................... 36
4.5.11 Video Widget ................................................................................................................... 36
4.5.12 Get Video Input Capability .............................................................................................. 39
4.5.13 Get Coordinates of Current Window .............................................................................. 43
4.5.14 Set Coordinates of Current Window ............................................................................... 43
4.5.15 Video Out ........................................................................................................................ 43
4.5.16 Smart Code ..................................................................................................................... 45
4.5.17 Get Decoder Caps .......................................................................................................... 46
4.5.18 [Config] PrivacyMasking ................................................................................................. 46
4.5.19 Get Privacy Masking ....................................................................................................... 48
4.5.20 Set Privacy Masking ....................................................................................................... 49
DA

4.5.21 Goto Privacy Masking ..................................................................................................... 50


4.5.22 Delete Privacy Masking .................................................................................................. 51
HU

4.5.23 Clear Privacy Masking .................................................................................................... 51


A_

4.5.24 Get Privacy Masking Rect .............................................................................................. 51


HT

4.5.25 [Config] Motion Detection Settings ................................................................................. 52


TP

4.5.26 [Config] SmartMotionDetect ........................................................................................... 58


4.5.27 [Config] LAEConfig ......................................................................................................... 59
_A

4.5.28 Enable/Disable all privacy masking covers .................................................................... 61


PI

4.5.29 Get enable/disable state of all privacy masking covers ................................................. 61


4.6 System ........................................................................................................................................ 61
fo

4.6.1 General ............................................................................................................................. 61


r

4.6.2 Get Current Time .............................................................................................................. 62


In

4.6.3 Set Current Time............................................................................................................... 63


4.6.4 Locales.............................................................................................................................. 63
te

4.6.5 Get Language Capability .................................................................................................. 65


lb

4.6.6 Language .......................................................................................................................... 65


ra

4.6.7 Get Client Access Filter .................................................................................................... 66


s

4.6.8 Auto Maintain .................................................................................................................... 67


4.6.9 Holiday Management ........................................................................................................ 68
4.6.10 Get Device Type ............................................................................................................. 69
4.6.11 Get Hardware Version..................................................................................................... 69
4.6.12 Get Serial Number of Device .......................................................................................... 69
4.6.13 Get Machine Name ......................................................................................................... 70
4.6.14 Get System Information1 ................................................................................................ 70
4.6.15 Get System Information2 ................................................................................................ 70
4.6.16 Get Vendor Information .................................................................................................. 72
4.6.17 Get Software Information................................................................................................ 72
4.6.18 Get Version of Onvif ....................................................................................................... 72
4.6.19 Get Version of HTTP API ................................................................................................ 72
4.6.20 Get Device Class ............................................................................................................ 73
4.6.21 Reboot ............................................................................................................................ 73

Table of Contents VIII


4.6.22 Shutdown ........................................................................................................................ 73
4.6.23 FactoryReset .................................................................................................................. 74
4.6.24 Get Tracing Code of Device ........................................................................................... 74
4.6.25 Add Camera to Specified Channel ................................................................................. 74
4.6.26 Acquiring All Available Resources .................................................................................. 75
4.6.27 Subscribing for Device Online/Offline Status ................................................................. 83
4.7 User management ...................................................................................................................... 85
4.7.1 Get Information of a Particular User ................................................................................. 85
4.7.2 Get Information of All Users.............................................................................................. 85
4.7.3 Get Information of All Active Users ................................................................................... 85
4.7.4 Get Information of a Particular Group .............................................................................. 86
4.7.5 Get Information of All Groups ........................................................................................... 86
4.7.6 Add a New User ................................................................................................................ 87
4.7.7 Delete a User .................................................................................................................... 87
4.7.8 Modify User Information ................................................................................................... 87
4.7.9 Modify User's Password ................................................................................................... 88
DA

4.7.10 Manager Modify Common User's Password .................................................................. 88


4.7.11 [Config] Set User Login Authentication Policy ................................................................ 89
HU

4.8 Network ....................................................................................................................................... 89


A_

4.8.1 Get Network Interfaces ..................................................................................................... 89


HT

4.8.2 Network Basic Config ....................................................................................................... 90


TP

4.8.3 PPPoE .............................................................................................................................. 91


4.8.4 DDNS ................................................................................................................................ 92
_A

4.8.5 Email ................................................................................................................................. 95


PI

4.8.6 WLan................................................................................................................................. 96
4.8.7 Scan Wlan Devices........................................................................................................... 97
fo

4.8.8 UPnP................................................................................................................................. 98
r

4.8.9 Get UPnP Status .............................................................................................................. 99


In

4.8.10 NTP ................................................................................................................................. 99


4.8.11 RTSP ............................................................................................................................. 100
te

4.8.12 Alarm Server ................................................................................................................. 101


lb

4.8.13 Device Network Packet Capture .................................................................................. 102


ra

4.8.14 Onvif Service Authorization .......................................................................................... 104


s

4.8.15 SSHD Config ............................................................................................................... 105

4.9 Event ......................................................................................................................................... 106


4.9.1 Event Handler ................................................................................................................. 106
4.9.2 Alarm Event .................................................................................................................... 109
4.9.3 Alarm Out .........................................................................................................................110
4.9.4 Get Alarm Input Channels ............................................................................................... 111
4.9.5 Get Alarm Output Channels............................................................................................. 111
4.9.6 Get States of Alarm Input Channels ................................................................................112
4.9.7 Get States of Alarm Output Channels .............................................................................112
4.9.8 Video Blind Event ............................................................................................................112
4.9.9 Video Loss Event .............................................................................................................113
4.9.10 Login Failure Event ........................................................................................................114
4.9.11 Storage Not Exist Event .................................................................................................115

Table of Contents IX
4.9.12 Storage Access Failure Event .......................................................................................116
4.9.13 Storage Low Space Event .............................................................................................116
4.9.14 Net Abort Event..............................................................................................................117
4.9.15 IP Conflict Event ............................................................................................................118
4.9.16 Get Channels Event Happened .....................................................................................118
4.9.17 Subscribe to Event Message .........................................................................................119
4.9.18 Get Capability of Event Management........................................................................... 121
4.9.19 [Config] Net Alarm Event .............................................................................................. 122
4.9.20 Set Net Alarm State ...................................................................................................... 123
4.9.21 GetSupportedEvents .................................................................................................... 124
4.10 Record ..................................................................................................................................... 124
4.10.1 Get Capability of Recording.......................................................................................... 124
4.10.2 Record Config ............................................................................................................... 125
4.10.3 Record Mode ................................................................................................................ 126
4.10.4 Media Global ................................................................................................................. 127
4.10.5 Find Media Files ........................................................................................................... 128
DA

4.10.6 Find media files with FaceDetection info ...................................................................... 131


4.10.7 Find media files with FaceRecognition info .................................................................. 133
HU

4.10.8 Find media files with HumanTrait info .......................................................................... 137


A_

4.10.9 Find media files with TrafficCar info ............................................................................. 140


HT

4.10.10 Find media files with IVS info ..................................................................................... 143


TP

4.10.11 Find media files with NonMotor info ........................................................................... 145


4.10.12 Download Media File with the File Name ................................................................... 147
_A

4.10.13 Download Media File between Times......................................................................... 148


PI

4.10.14 Encrypted Download Media File with the File Name ................................................. 149
4.11 Log........................................................................................................................................... 149
fo

4.11.1 Find Logs ...................................................................................................................... 149


r

4.11.2 Clear All the Logs .......................................................................................................... 151


In

4.11.3 Backup Logs ................................................................................................................. 151


4.11.4 Seek Find Logs ............................................................................................................. 152
te

4.11.5 Export Encryped Log .................................................................................................... 152


lb

4.12 Upgrader ................................................................................................................................. 153


ra

4.12.1 Strat to Upgrade ........................................................................................................... 153


s

4.12.2 Get Upgrade State ........................................................................................................ 153


4.12.3 Set upgrader url ............................................................................................................ 154
4.12.4 Cancel Upgrade ............................................................................................................ 154
4.12.5 Checking Cloud Update Version .................................................................................. 155
4.12.6 Performing Online Update ............................................................................................ 157
4.12.7 Canceling Online Update.............................................................................................. 158
4.13 Http Uploading ........................................................................................................................ 159
4.13.1 [Config] Active Image and Event Uploading ................................................................. 159
4.13.2 Active Image and Event Uploading .............................................................................. 160
4.13.3 [Config] Active Event Uploading ................................................................................... 161
4.13.4 Active Event Uploading................................................................................................. 162
4.13.5 [Config] Active Report Data Uploading ......................................................................... 163
4.13.6 People Counting Report Data Uploading ..................................................................... 164
4.13.7 Video Structuring Report Data Upload ......................................................................... 167

Table of Contents X
4.13.8 People Flow Heat Map Report Data Upload ................................................................ 168
4.13.9 ANPR Report Data Upload ........................................................................................... 169
4.13.10 Crowd Distribution Report Data upload ...................................................................... 170
4.13.11 Vehicle Density Report Data Upload .......................................................................... 171
5 Camera APIs ...................................................................................................................................... 173
5.1 Image ........................................................................................................................................ 173
5.1.1 Brightness, Contrast and Saturation .............................................................................. 173
5.1.2 Sharpness ....................................................................................................................... 174
5.1.3 Flip, Mirror and Rotate90 ................................................................................................ 175
5.2 Exposure ................................................................................................................................... 176
5.2.1 Exposure Config ............................................................................................................. 176
5.3 Backlight .................................................................................................................................... 178
5.3.1 Backlight Config .............................................................................................................. 178
5.4 White Balance ........................................................................................................................... 179
5.4.1 White Balance Config ..................................................................................................... 179
5.5 Day-Night .................................................................................................................................. 180
DA

5.5.1 Day-Night Config ............................................................................................................ 180


5.6 Zoom and Focus ....................................................................................................................... 181
HU

5.6.1 Adjust Focus ................................................................................................................... 181


A_

5.6.2 Adjust Focus Continuously ............................................................................................. 182


HT

5.6.3 Auto Focus ...................................................................................................................... 182


TP

5.6.4 Get Focus Status ............................................................................................................ 183


5.6.5 [Config] Zoom Config ...................................................................................................... 183
_A

5.6.6 [Config] Focus Config ..................................................................................................... 185


PI

5.7 Lighting ...................................................................................................................................... 186


5.7.1 Lighting Config ................................................................................................................ 186
fo

5.8 Video in Options ........................................................................................................................ 188


r

5.8.1 Video in Options Config .................................................................................................. 188


In

6 Storage APIs .................................................................................................................................... 197


6.1 Storage Devices ........................................................................................................................ 197
te

6.1.1 Get Hard Disk Information .............................................................................................. 197


lb

6.1.2 Get the Name of All Storage Devices ............................................................................. 198


ra

6.1.3 Get Storage Device Information ..................................................................................... 198


s

6.1.4 Get Storage Capability ................................................................................................... 199


6.1.5 Format Camera SD-Card ............................................................................................... 199
6.2 NAS ........................................................................................................................................... 200
6.2.1 NAS Information ............................................................................................................. 200
6.3 Storage Point ............................................................................................................................ 201
6.3.1 Record Storage Point ..................................................................................................... 201
6.3.2 Storage Group ................................................................................................................ 202
6.4 SDEncrypt ................................................................................................................................. 204
6.4.1 Encrypt SD Card ............................................................................................................. 204
6.4.2 Decrypt SD Card............................................................................................................. 204
6.4.3 Clear SD Card Password ............................................................................................... 204
6.4.4 Modify SD Card Password ............................................................................................. 205
6.4.5 Get SD Card Operate Error Policy ................................................................................. 205
6.4.6 Storage Health Alarm Settings ....................................................................................... 206

Table of Contents XI
7 Display APIs ..................................................................................................................................... 207
7.1 GUI ............................................................................................................................................ 207
7.1.1 GUISet ............................................................................................................................ 207
7.2 Split Screen ............................................................................................................................... 208
7.2.1 Split Screen Mode .......................................................................................................... 208
7.3 Moniter Tour .............................................................................................................................. 209
7.3.1 Moniter Tour .................................................................................................................... 209
7.3.2 Enable Tour ..................................................................................................................... 210
7.3.3 Monitor Collection ........................................................................................................... 210
8 Comm APIs ....................................................................................................................................... 212
8.1 PTZ............................................................................................................................................ 212
8.1.1 PTZ Config ...................................................................................................................... 212
8.1.2 Get PTZ Protocol List ..................................................................................................... 213
8.1.3 Get PTZ Capability of Current Protocol .......................................................................... 213
8.1.4 Get PTZ Status ............................................................................................................... 215
8.1.5 PTZ Control .................................................................................................................... 215
DA

8.1.6 Preset.............................................................................................................................. 220


8.1.7 Tour ................................................................................................................................. 222
HU

8.1.8 Scan ................................................................................................................................ 224


A_

8.1.9 Pattern ............................................................................................................................ 225


HT

8.1.10 Pan................................................................................................................................ 227


TP

8.1.11 PTZ Auto Movement ..................................................................................................... 227


8.1.12 PTZ Restart .................................................................................................................. 229
_A

8.1.13 PTZ Reset ..................................................................................................................... 229


PI

8.1.14 OSD Menu .................................................................................................................... 229


8.2 Wiper ......................................................................................................................................... 231
fo

8.2.1 Move Continuously ......................................................................................................... 231


r

8.2.2 Stop Move ....................................................................................................................... 231


In

8.2.3 Move Once...................................................................................................................... 232


8.3 Illuminator .................................................................................................................................. 232
te

8.3.1 Visible-light Illuminator .................................................................................................... 232


lb

8.4 Flashlight ................................................................................................................................... 232


ra

8.4.1 [Config] Flashlight Config ............................................................................................... 232


s

8.5 Coaxial Control IO ..................................................................................................................... 234


8.5.1 Control White Light or Speaker ...................................................................................... 234
8.5.2 Get White Light and Speaker Status .............................................................................. 234
8.6 Pir Alarm .................................................................................................................................... 235
8.6.1 Configure Pir Parameter ................................................................................................. 235
9 Video Analyse APIs ........................................................................................................................... 239
9.1 People Counting........................................................................................................................ 239
9.1.1 Get Summary.................................................................................................................. 239
9.1.2 Query the Count of People ............................................................................................. 240
9.1.3 Clear the People Count Information ............................................................................... 243
9.1.4 Subscribe the People Count Information ....................................................................... 243
9.1.5 [Event] NumberStat ........................................................................................................ 245
9.1.6 [Event] ManNumDetection.............................................................................................. 246
9.1.7 [Event] CrowdDetection .................................................................................................. 246

Table of Contents XII


9.2 FaceRecognitionServer ............................................................................................................ 247
9.2.1 Create Face Group ......................................................................................................... 247
9.2.2 Modify Face Group ......................................................................................................... 248
9.2.3 Delete Face Group ......................................................................................................... 248
9.2.4 Deploy Face Group......................................................................................................... 248
9.2.5 Find Face Group ............................................................................................................. 250
9.2.6 Re-Abstract Feature By Group ....................................................................................... 252
9.2.7 Add Person ..................................................................................................................... 253
9.2.8 Modify Person ................................................................................................................. 254
9.2.9 Delete Person ................................................................................................................. 255
9.2.10 Find Person .................................................................................................................. 255
9.2.11 Re-Abstract Features By Person .................................................................................. 257
9.2.12 [Config] Face Recognition AlarmOut Setting................................................................ 258
9.2.13 Find Person by Picture ................................................................................................. 260
9.2.14 Find History Person by Picture ..................................................................................... 264
9.2.15 [Event] FaceDetection .................................................................................................. 267
DA

9.2.16 [Event] FaceRecognition .............................................................................................. 268


9.2.17 [Event] FaceFeatureAbstract ........................................................................................ 270
HU

9.2.18 [Config] Face Recognition Event Handler Setting ........................................................ 271


A_

9.2.19 [Config] Face-ID Recognition Threshold ...................................................................... 273


HT

9.2.20 Exporting Face Database ............................................................................................. 273


TP

9.2.21 Importing Face Database ............................................................................................. 274


9.3 Video Analyse Event ................................................................................................................. 275
_A

9.3.1 [Event] LeftDetection ...................................................................................................... 275


PI

9.3.2 [Event] TakenAwayDetection .......................................................................................... 275


9.3.3 [Event] WanderDetection ................................................................................................ 276
fo

9.3.4 [Event] StayDetection ..................................................................................................... 276


r

9.3.5 [Event] HumanTrait ......................................................................................................... 277


In

9.3.6 [Event] CrossLineDetection ............................................................................................ 279


9.3.7 [Event] CrossRegionDetection ....................................................................................... 280
te

9.3.8 [Event] QueueStayDetection .......................................................................................... 281


lb

9.3.9 [Event] QueueNumDetection .......................................................................................... 282


ra

10 Video Analyse Extend APIs ............................................................................................................ 283


s

10.1 Video Analyse ......................................................................................................................... 283


10.1.1 Get Video Analyse Capability ....................................................................................... 283
10.1.2 Video Analyse Global.................................................................................................... 284
10.1.3 Video Analyse Rule....................................................................................................... 285
10.1.4 Get Last Event Info ....................................................................................................... 290
10.1.5 [Config] GlobalDeviceParam ........................................................................................ 290
10.1.6 getTemplateRule ........................................................................................................... 291
10.1.7 [Config] IntelliSchemeTourEnableSetting ..................................................................... 292
10.1.8 Getting Intelligent Tour Plan ......................................................................................... 293
10.1.9 Exporting Intelligent Diagnosis, Allowlist, and Blocklist Information ............................ 298
10.1.10 Importing Intelligent O&M, Allowlist, and Blocklist Information .................................. 299
10.1.11 Get Intelligent Caps .................................................................................................... 300
10.1.12 Subscribe Resource Usage Info................................................................................. 302
10.1.13 Exporting Encrypted Files........................................................................................... 303

Table of Contents XIII


10.2 Number of People ................................................................................................................... 304
10.2.1 [Config] Video Widget Number Status.......................................................................... 304
10.2.2 Get Heat Map Information ............................................................................................ 305
10.2.3 Get People Heat Map Information ................................................................................ 306
10.2.4 Subscribe People Realtime Trace Information ............................................................. 307
10.2.5 Get People Histroy Trace Information .......................................................................... 309
10.2.6 Subscribe Heat Map Raw Data .................................................................................... 310
10.2.7 Clear statistics in time section .......................................................................................311
10.3 CrowdDistriMap........................................................................................................................311
10.3.1 Get Channel Caps .........................................................................................................311
10.3.2 Subscribe to Realtime Crowd Stat ............................................................................... 312
10.3.3 Get Current Crowd Stat ................................................................................................ 313
10.4 WorkSuitCompareServer ........................................................................................................ 314
10.4.1 Creating Compliance Library ........................................................................................ 314
10.4.2 Deleting Compliance Library ........................................................................................ 314
10.4.3 Searching for Compliance Library ................................................................................ 314
DA

10.4.4 Getting Compliance Library Arming Information of Channels ....................................... 315


10.4.5 Modifying Compliance Group Information .................................................................... 316
HU

10.4.6 Arming Compliance Library by Video Channel ............................................................. 316


A_

10.4.7 Searching for Workwear Information in Compliance Library........................................ 317


HT

10.4.8 Getting Search Result .................................................................................................. 317


TP

10.4.9 Stopping Search ........................................................................................................... 318


10.4.10 Deleting Workwear Information .................................................................................. 318
_A

10.4.11 Re-extracting Features by Workwear ......................................................................... 319


PI

10.4.12 Stopping Re-extracting Workwear Features .............................................................. 319


10.5 SMD Query ............................................................................................................................. 319
fo

10.5.1 Start SMD Query .......................................................................................................... 319


r

10.5.2 Searching for SMD Data............................................................................................... 321


In

10.5.3 End SMD Search .......................................................................................................... 322


11 Intelligent Traffic APIs ..................................................................................................................... 323
te

11.1 Traffic Record .......................................................................................................................... 323


lb

11.1.1 Insert Traffic BlackList/RedList Record......................................................................... 323


ra

11.1.2 Update Traffic BlackList/RedList Record ...................................................................... 323


s

11.1.3 Remove Traffic BlackList/RedList Record .................................................................... 324


11.1.4 Find Traffic BlackList/RedList Record ........................................................................... 325
11.1.5 RemoveEx Traffic BlackList/RedList Record ................................................................ 326
11.2 Intelligent Traffic Event ............................................................................................................ 326
11.2.1 [Event] TrafficJunction................................................................................................... 326
11.2.2 [Event] TrafficRetrograde .............................................................................................. 328
11.2.3 [Event] TrafficJam ......................................................................................................... 329
11.2.4 [Event] TrafficUnderSpeed ............................................................................................ 330
11.2.5 [Event] TrafficOverSpeed .............................................................................................. 330
11.2.6 [Event] TrafficPedestrain ............................................................................................... 330
11.2.7 [Event] TrafficParking .................................................................................................... 331
11.3 Traffic Flow .............................................................................................................................. 332
11.3.1 [Event] TrafficFlowStat .................................................................................................. 332
11.3.2 Find Traffic Flow History ............................................................................................... 332

Table of Contents XIV


11.3.3 Start Traffic Statistics Search........................................................................................ 334
11.3.4 Get Traffic Statistics ...................................................................................................... 335
11.3.5 End Traffic Statistics Search ......................................................................................... 336
12 Intelligent Traffic Extend APIs ....................................................................................................... 337
12.1 Traffic Snap ............................................................................................................................. 337
12.1.1 Get the Specific Parking Space Status ........................................................................ 337
12.1.2 Open Strobe ................................................................................................................. 337
12.1.3 Open/Close Unlicensed Vehicle Detection ................................................................... 338
12.1.4 Snap.............................................................................................................................. 338
12.2 Traffic Parking ......................................................................................................................... 339
12.2.1 Get All Status of Parking Spaces ................................................................................. 339
12.2.2 Parking Space Light State ............................................................................................ 339
12.2.3 Set Order State ............................................................................................................. 341
12.2.4 Set Light State .............................................................................................................. 341
12.2.5 [Config] Parking Space Access Filter Setting ............................................................... 342
12.2.6 Set OverLine State ....................................................................................................... 343
DA

12.3 Traffic Record Import Export ................................................................................................... 343


12.3.1 Traffic BlackList / RedList ............................................................................................. 343
HU

12.3.2 Traffic Flow.................................................................................................................... 346


A_

12.3.3 Traffic Snap Event Info ................................................................................................. 347


HT

12.4 Vehicles Distribution................................................................................................................ 349


TP

12.4.1 Subscribe Vehicles Distribution Data ........................................................................... 349


13 Thermography and Radiometry APIs ............................................................................................ 351
_A

13.1 Thermography Manager ......................................................................................................... 351


PI

13.1.1 Get Capability of Thermography .................................................................................. 351


13.1.2 Thermography Options ................................................................................................. 352
fo

13.1.3 Get ExternSystem Information ..................................................................................... 354


r

13.1.4 Get Information of Preset Mode ................................................................................... 354


In

13.1.5 Get Optimized Region Information ............................................................................... 355


13.1.6 Enable Shutter .............................................................................................................. 355
te

13.1.7 Fix Focus ...................................................................................................................... 356


lb

13.1.8 Do Flat Field Correction................................................................................................ 356


ra

13.2 Radiometry .............................................................................................................................. 356


s

13.2.1 Get Capability of Radiometry........................................................................................ 356


13.2.2 Heat Image Thermometry............................................................................................. 357
13.2.3 Thermometry Rule ........................................................................................................ 359
13.2.4 Heat Image Temper Event ............................................................................................ 361
13.2.5 Get Temperature of Particular Point ............................................................................. 362
13.2.6 Get Temperature of Particular Condition ...................................................................... 363
13.2.7 Query Temperature Information.................................................................................... 363
13.2.8 Subscribe to Temperature Information ......................................................................... 365
13.2.9 Subscribe to Radiometry Data ..................................................................................... 366
13.2.10 To Fetch Radiometry Data .......................................................................................... 368
13.2.11 Get FireWarning Config .............................................................................................. 368
13.2.12 Set FireWarning Config .............................................................................................. 369
13.2.13 Get FireWarningMode Config ..................................................................................... 370
13.2.14 Set FireWarningMode Config ..................................................................................... 370

Table of Contents XV
13.2.15 Get Current Hot Cold Spot ......................................................................................... 370
13.2.16 Heat Image Temper PreAlarm Event.......................................................................... 371
13.2.17 Get Heat Map Info ...................................................................................................... 372
13.3 TemperCustom ........................................................................................................................ 374
13.3.1 Set Environment Temperature ...................................................................................... 374
14 Access Control APIs ..................................................................................................................... 375
14.1 Access User ............................................................................................................................ 375
14.1.1 Add Access User Face ................................................................................................. 375
14.1.2 Modify Access User Face ............................................................................................. 376
14.1.3 Delete Access User Face ............................................................................................. 376
14.1.4 Find Access User Face................................................................................................. 377
14.1.5 Add Access User Card and Fingerprint ........................................................................ 378
14.1.6 Modify Access User Card and Fingerprint.................................................................... 381
14.1.7 Delete Access User Card and Fingerprint .................................................................... 382
14.1.8 Find Access User Card and Fingerprint ....................................................................... 383
14.1.9 Get the Total Number of Records of Access User Card and Fingerprint ..................... 387
DA

14.2 Access control ......................................................................................................................... 388


14.2.1 [Event] AccessControl .................................................................................................. 388
HU

14.2.2 [Event] CitizenPictureCompare .................................................................................... 391


A_

14.2.3 [Event] Door Status Event ............................................................................................ 393


HT

14.2.4 Find AccessControl Record .......................................................................................... 394


TP

15 Access Control Extend APIs ........................................................................................................ 397


15.1 Door......................................................................................................................................... 397
_A

15.1.1 Open Door .................................................................................................................... 397


PI

15.1.2 Get Door Status ............................................................................................................ 397


15.1.3 Close Door .................................................................................................................... 398
fo

15.1.4 Capture Fingerprint ....................................................................................................... 398


r

15.1.5 Capture face picture ..................................................................................................... 399


In

15.2 Access Control ........................................................................................................................ 399


15.2.1 Add Access Control Custom Password ........................................................................ 399
te

15.2.2 Modify Access Control Custom Password ................................................................... 400


lb

15.2.3 Delete Access Control Custom Password .................................................................... 401


ra

15.2.4 Find Access Control Custom Password ....................................................................... 402


s

15.2.5 Get the Total Number of Records of Access Control Custom Password ..................... 404
15.2.6 Get Access Control Caps ............................................................................................. 404
15.2.7 Get Lock Status ............................................................................................................ 405
15.2.8 [Config] Access Control General Setting ...................................................................... 406
15.2.9 [Config] Access Control Setting .................................................................................... 408
15.2.10 [Config] Wiegand Setting ............................................................................................ 412
15.2.11 [Config] Access Time Schedule Setting ...................................................................... 413
15.2.12 [Config] Special Day Group Setting............................................................................ 414
15.2.13 [Config] Special Days Schedule Setting ..................................................................... 415
15.2.14 [Config] MeasureTemperature Setting ....................................................................... 417
15.2.15 [Config] CitizenPictureCompare Setting ..................................................................... 420
15.2.16 Sending User Information ........................................................................................... 421
15.2.17 Updating User Information.......................................................................................... 423
15.2.18 Deleting All User Information ...................................................................................... 425

Table of Contents XVI


15.2.19 Deleting Information of Multiple Users ....................................................................... 425
15.2.20 Searching for Information of Multiple Users ............................................................... 426
15.2.21 Sending Information of Multiple Card Numbers ......................................................... 428
15.2.22 Updating Information of Multiple Card Numbers ........................................................ 429
15.2.23 Removing All Card Number Information ..................................................................... 430
15.2.24 Removing Information of Multiple Card Numbers ...................................................... 430
15.2.25 Searching for Information of Multiple Card Numbers ................................................. 431
15.2.26 Sending Face Information .......................................................................................... 432
15.2.27 Updating Face Information ......................................................................................... 433
15.2.28 Deleting All Face Information ..................................................................................... 433
15.2.29 Deleting Multiple Face Information ............................................................................. 434
15.2.30 Searching for Multiple Face Information .................................................................... 434
15.2.31 Sending Fingerprint Information ................................................................................. 435
15.2.32 Updating Fingerprint Information ................................................................................ 436
15.2.33 Deleting All Fingerprint Information ............................................................................ 437
15.2.34 Deleting Fingerprint Information ................................................................................. 438
DA

15.2.35 Searching for Fingerprint Information ......................................................................... 438


15.2.36 Starting Searching for User Related Information ....................................................... 439
HU

15.2.37 Getting User Related Information ............................................................................... 441


A_

15.2.38 Stopping Searching for User Related Information ..................................................... 442


HT

15.2.39 Starting Searching for Card Number Related Information ......................................... 442
TP

15.2.40 Getting Card Number Related Information ................................................................. 443


15.2.41 Stopping Searching for Card Number Related Information ....................................... 444
_A

15.2.42 Starting Searching for Face Related Information ....................................................... 445


PI

15.2.43 Getting Face Related Information .............................................................................. 446


15.2.44 Stopping Searching for Face Related Information ..................................................... 446
fo

15.2.45 Get access control capability ...................................................................................... 447


r

15.2.46 Add SubController....................................................................................................... 447


In

15.2.47 Modify SubController .................................................................................................. 448


15.2.48 Remove SubController ............................................................................................... 448
te

15.2.49 Get SubController Info ................................................................................................ 449


lb

15.2.50 Get SubController States............................................................................................ 450


ra

15.2.51 Set RepeatEnter Route .............................................................................................. 450


s

15.2.52 Get RepeatEnter Route .............................................................................................. 451


15.2.53 Set ABLock Route ...................................................................................................... 451
15.2.54 Get ABLock Route ...................................................................................................... 452
15.2.55 Get Log Status ............................................................................................................ 453
15.2.56 Sync Offline Log ......................................................................................................... 453
15.2.57 Sync SubController Time ............................................................................................ 454
16 Intelligent Building APIs ................................................................................................................. 455
16.1 Video Talk ................................................................................................................................ 455
16.1.1 Subscribe Video Talk Status ......................................................................................... 455
16.1.2 Unsubscribe Video Talk Status ..................................................................................... 457
16.1.3 Invite Server on Video Talk ........................................................................................... 457
16.1.4 Cancel the Video Talk ................................................................................................... 459
16.1.5 Answer the Invitation .................................................................................................... 459
16.1.6 Refuse to Answer the Video Talk Invitation .................................................................. 460

Table of Contents XVII


16.1.7 Hang Up ........................................................................................................................ 461
16.2 Video Talk Log......................................................................................................................... 461
16.2.1 Query Video Talk Log ................................................................................................... 461
16.3 Announcement Record ........................................................................................................... 462
16.3.1 Insert Record ................................................................................................................ 462
16.4 Alarm Record .......................................................................................................................... 462
16.4.1 Query Alarm Record ..................................................................................................... 462
16.4.2 Query Access Control Alarm Record ............................................................................ 463
16.5 SIP........................................................................................................................................... 464
16.5.1 Get SIP Configuration ................................................................................................... 464
16.5.2 Modifying SIP Configuration ......................................................................................... 466
16.5.3 Get Registar Configuration ........................................................................................... 468
16.5.4 Modifying Registar Configuration ................................................................................. 469
16.6 Room Number Database Management .................................................................................. 470
16.6.1 Adding Room Number .................................................................................................. 470
16.6.2 Getting Records by recno ............................................................................................. 472
DA

16.6.3 Updating Room Number Records ................................................................................ 473


16.6.4 Deleting Records by recno ........................................................................................... 475
HU

16.6.5 Clearing All Room Numbers ......................................................................................... 475


A_

16.6.6 Getting Total Quantity of Room Number ...................................................................... 476


HT

16.7 ElevatorFloorCounter .............................................................................................................. 476


TP

setElevatorFloorInfo .................................................................................................. 476


16.7.1 getElevatorWorkInfo ..................................................................................................... 476
_A

16.7.2 getCaps......................................................................................................................... 477


PI

17 DVR Custom APIs............................................................................................................................ 478


17.1 File Finder ............................................................................................................................... 478
fo

17.1.1 Create a File Finder ...................................................................................................... 478


r

17.1.2 Create a Motion File Finder .......................................................................................... 479


In

17.1.3 Get the File Information Found by the Finder .............................................................. 480
17.1.4 Stop the Finder ............................................................................................................. 481
te

17.1.5 Get Bound Files ............................................................................................................ 481


lb

17.2 BandLimit ................................................................................................................................ 482


ra

17.2.1 Get Bandwidth Limit State ............................................................................................ 482


s

17.3 Record Files Protection........................................................................................................... 482


17.3.1 Add Protection .............................................................................................................. 482
17.3.2 Cancel Protection ......................................................................................................... 483
17.3.3 Remove Protection ....................................................................................................... 483
17.3.4 DownloadFile ................................................................................................................ 483
17.3.5 UploadFile ..................................................................................................................... 484
17.4 Daylight ................................................................................................................................... 485
17.4.1 Get Daylight .................................................................................................................. 485
18 Open Platform APIs ....................................................................................................................... 486
18.1 Open Platform ......................................................................................................................... 486
18.1.1 Application Start and Stop ............................................................................................ 486
18.1.2 Install Application .......................................................................................................... 486
18.1.3 Update Application and License ................................................................................... 487
18.1.4 Uninstall Application ..................................................................................................... 489

Table of Contents XVIII


18.1.5 Download Application Log ............................................................................................ 489
19 Other APIs ...................................................................................................................................... 490
19.1 Discover Devices .................................................................................................................... 490
19.1.1 Discover Devices on Internet........................................................................................ 490
19.2 positionManager ..................................................................................................................... 491
19.2.1 getStatus ....................................................................................................................... 491
19.3 GpsControl .............................................................................................................................. 491
19.3.1 getCaps......................................................................................................................... 491
19.3.2 GPS config .................................................................................................................... 491
19.4 LensFunc ................................................................................................................................ 492
19.4.1 getCaps......................................................................................................................... 492
19.4.2 adjustAngleContinuously .............................................................................................. 493
19.4.3 stopAdjustingAngle ....................................................................................................... 493
19.4.4 adjustDepthField ........................................................................................................... 493
19.4.5 adjustDepthFieldContinuously ...................................................................................... 494
19.4.6 getDepthFieldStatus ..................................................................................................... 494
DA

19.4.7 autoAdjustDepthField ................................................................................................... 495


19.4.8 Scene Correction .......................................................................................................... 495
HU

19.5 LensManager .......................................................................................................................... 496


A_

19.5.1 resetAngle ..................................................................................................................... 496


HT

19.6 FishEye ................................................................................................................................... 497


TP

19.6.1 Get FishEye Capability ................................................................................................. 497


19.6.2 FishEye Setting............................................................................................................. 497
_A

19.7 Radar Adaptor ......................................................................................................................... 498


PI

19.7.1 getCaps......................................................................................................................... 498


19.7.2 getCapsEx .................................................................................................................... 499
fo

19.7.3 getStatus ....................................................................................................................... 499


r

19.7.4 calculateRealSize ......................................................................................................... 500


In

19.7.5 attachAlarmPointInfo .................................................................................................... 500


19.7.6 getLinkSDState ............................................................................................................. 502
te

19.7.7 manualLocate ............................................................................................................... 502


lb

19.7.8 startRadarCalibration .................................................................................................... 502


ra

19.7.9 addRadarLinkSD .......................................................................................................... 503


s

19.7.10 delRadarLinkSD.......................................................................................................... 504


19.7.11 [Config]MapPara ......................................................................................................... 504
19.7.12 [Config]RadarAnalyseRule ......................................................................................... 506
19.7.13 [Config]RadarCalibration ............................................................................................ 507
19.7.14 [Config]RadarGuardLine............................................................................................. 508
19.7.15 [Config]RadarLink ....................................................................................................... 509
19.7.16 [Config]RadarLinkDevice ............................................................................................ 509
19.7.17 [Config]RadarPara ...................................................................................................... 510
19.7.18 [Config]RadarTrackGlobal ...........................................................................................511
19.7.19 [Config]RemoteSDLink ................................................................................................511
19.8 Advertisement ..........................................................................................................................511
19.8.1 Getting Ad Placement Capability ...................................................................................511
19.8.2 Acquiring Advertisement Resource List ........................................................................ 515
19.8.3 Deleting Advertisement Files ............................................................................................ 517

Table of Contents XIX


19.8.4 Sending Advertisement Resources .................................................................................... 517
19.8.5 Changing Stay Time of Advertisement Image..................................................................... 521
19.8.6 Acquiring Video and Image Files Played by the Device........................................................ 521
19.9 Water Quality Detection .......................................................................................................... 524
19.9.1 Report Search............................................................................................................... 524
19.9.2 Acquiring Capabilities ................................................................................................... 528
19.9.3 Acquiring Real-time Detection Data ............................................................................. 528
DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

Table of Contents XX
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,
controlling camera functions (for example, PTZ and focus), and getting and setting internal
parameter values.
The video products serve as a server. The client sends requests to server, and then server handles
requests and returns resources accordingly.
DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

Overview 1
[1] RFC 2326 Real Time Streaming Protocol (RTSP)
2 References

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


[3] RFC 3986 Uniform Resource Identifiers (URI) Generic Syntax
[4] RFC 7616 HTTP Digest Access Authentication
[5] RFC 8259 The JavaScript Object Notation (JSON) Data Interchange Format
DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

References 2
3 Definitions
3.1 Abbreviations
The following abbreviations are used throughout this document.
Application Programming Interface. In the document, it especially presents
API
application programming interface of video products.

3.2 Syntax Convention


 In URL syntax and in descriptions of API parameters, text in italic within angle brackets
denotes content that should be replaced with either a value or a string. When replacing the
text string, the angle brackets must also be replaced. For example, <server> in URL syntax
DA

is replaced with the IP number of server, e.g., 192.168.1.108.


HU

 String shown in bold face denotes a brief explanatory note of the string close to it.
A_

 Name-value pair in square brackets denotes content that is optional. For example,
"http ://<server>/cgi-bin/snapshot.cgi[?channel=1]" can be like this
HT

"http ://<server>/cgi-bin/snapshot.cgi".
TP

 The API syntax must follow the standard of URI. (RFC 3986: Uniform Resource Identifiers
_A

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

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

 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}"
r

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


In

 "[]" following a string denotes an array. The index is an integer and starts from 0. For
te

example, "Snap[channel]" may be "Snap[0]" "Snap[0]" etc.


lb

 The variable may be different types: string, integer, bool or float. Integer is 32 bits. The
range of bool is "true" and "false".
ra

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


s

"O"means optional.

3.3 API Request Format


This section defines the syntax and semantics for APIs.

<protocol>://<server><abs_path>[?query]

protocol: URL scheme for the particular request. The http and https protocols are both supported in
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

3.4 Server Response Format


The server uses the standard HTTP status codes.
Return:
HTTP/1.1 <HTTP code> <HTTP text>
With the following HTTP code and meanings

Table 3-1
DA

HTTP code HTTP text Description


HU

The request has succeeded. The requested


200 OK
A_

resource will be returned in the HTTP text.


The request had bad syntax or was inherently
HT

400 Bad Request


impossible to be satisfied.
TP

The request requires user authentication or the


401 Unauthorized
_A

authorization has been refused.


PI

The user does not have the right to access the


403 Forbidden
service.
fo

The server has not found anything matching the


404 Not Found
request.
r

The server encountered an unexpected condition


In

500 Internal Server Error


that prevented it from fulfilling the request.
te

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

If the HTTP code is 200, means the API execute success, and the response data in http body
ra

( maybe multipart ) can be a multiline key=value data, or a json object, or just a line with a word
"OK".
s

Example: success respose with multiline key=value


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

status.Focus=0.5
status.Zoom=0.5

Example: success respose with a word "OK"
HTTP/1.1 200 OK
Server: xxx
Content-Length: <length>

Definitions 4
OK
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.
HTTP/1.1 400 Bad Request
Server: xxx
Content-Length: <length>

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

would like this:


HTTP/1.1 500 Internal Server Error
HU

Server: xxx
A_

Content-Length: <length>
HT
TP

Error
Internal Server Error!
_A
PI

3.5 Authentication
fo

Video products support digest authentication, see RFC 7616 for detail. If the http request sent by
r

client does not provide valid "Authorization" header information, video products would return HTTP
In

status code 401 and some information for authentication, then client should calculate authentication
information according to RFC 7616, and sent request again with authentication information using
te

“Authorization” header. Video products return the required resource only if authorization information
lb

correct.
ra

For example:
s

1. When the client does not provoding digest authentication or the client calculates digest
authentication with expired "nonce" data, video product’s response is :
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="DH_00408CA5EA04", qop="auth"
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",
opaque="5ccc069c403ebaf9f0171e9517f40e41", stale=TRUE
The "stale=TRUE" indicates that the "nonce" data in the request is expired and the client should use
the new "nonce" data to calculate the digest authorization and request again.

2. Then the client generate "nc" and "cnonce", calculates the digest authorization using
"username" "password" "HTTP method" "URI" "nc" "cnonce" "realm" "nonce" , according to
RFC 7616, and then sends it to video product :

Definitions 5
GET /cgi-bin/magicBox.cgi?action=getLanguageCaps HTTP/1.1
Authorization: Digest username="admin", realm="DH_00408CA5EA04", qop="auth",
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",
opaque="5ccc069c403ebaf9f0171e9517f40e41"
nc=00000001, cnonce="0a4f113b",
uri="/cgi-bin/magicBox.cgi?action=getLanguageCaps",
response="65002de02df697e946b750590b44f8bf"
If the digest authorization is correct, the video product will reply HTTP status code 200 with the
response data. If digest authorization is not correct, the video product will reply HTTP status code
403 . If the "nonce" data used to calculates digest authentication is expired, the video product will
reply HTTP status code 401 with stale=TRUE and new "nonce" data, then the client should use the
new "nonce" data to calculate the digest authorization and request again .

3.6 Conventions
DA

3.6.1 Channels
HU
A_

For requests containing the param ‘channel’ like :


HT

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

ChannelNo: integer, must starts from 1. Default is 1 if not present. But for response, the ‘ChannelNo’
_A

should start from 0. In other words, the request channel 1 equals response channel 0.
PI
fo
r
In
te
lb
ra
s

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

4.1 APIs of RTSP

4.1.1 Get Real-Time Stream


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 supplies
digest authentication ways. The authentication process is similar with "3.5 Authentication".

The format of the RTSP URL parameter for getting real-time media stream is as follows.
DA

URL rtsp://<server>:[port]/cam/realmonitor
Method DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN, ...
HU

URL Params ( key=value format in URL )


A_

Name Type R/O Description Example


HT

channel int R Video channel number, starting from 1. 1


TP

The stream type, including main stream and sub 0


stream.
_A

Execute the "4.5.1 Getting Maximum Number of


PI

Sub Streams" command to get the number of sub


subtype int R streams.
fo

Optional values:
r

0: Main stream
In

1: Sub stream 1
2: Sub stream 2
te

URL Example
lb

rtsp://192.168.1.108:554/cam/realmonitor?channel=1&subtype=0
ra
s

Step 1: Obtain media description by executing the DESCRIBE command.


Request Example
DESCRIBE rtsp://192.168.1.108/cam/realmonitor?channel=1&subtype=0 RTSP/1.0
CSeq: 1
User-Agent: LibVLC/3.0.5

Response Example
RTSP/1.0 200 OK
CSeq: 1
Server: Rtsp Server/3.0
Content-Base: rtsp://192.168.1.108/cam/realmonitor?channel=1&subtype=0/
Content-Length: xxx
Content-Type: application/sdp

General APIs 7
v=0
o=- 2253484289 2253484289 IN IP4 0.0.0.0
s=Media Server
c=IN IP4 0.0.0.0
t=0 0
a=control:*
a=range:npt=now-
m=video 0 RTP/AVP 98
a=control:trackID=0
a=framerate:25.000000
a=rtpmap:98 H265/90000
a=recvonly

Step 2: Establish a transmission channel for each media by executing the SETUP command.
Take RTP over UDP as an example:
Establish the UDP socket for receiving and sending UDP packages on 63088 and 63089 interfaces.
DA

Request Example
HU

SETUP rtsp://192.168.1.108/cam/realmonitor?channel=1&subtype=0/trackID=0 RTSP/1.0


A_

CSeq: 2
HT

User-Agent: LibVLC/3.0.5
Transport: RTP/AVP;unicast;client_port=63088-63089
TP
_A

Response Example
PI

RTSP/1.0 200 OK
CSeq: 2
fo

Server: Rtsp Server/3.0


r

Session: 1546116282447;timeout=60
In

Transport: RTP/AVP/UDP;unicast;client_port=63088-63089;server_port=24764-24765;ssrc=71B0AFDC
te
lb

Step 3: Execute the play command to play the media, and receive and send RTP and RTCP data
ra

through the UDP socket established in step 2.


s

Request Example
PLAY rtsp://192.168.1.108/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
CSeq: 3
User-Agent: LibVLC/3.0.5
Session: 1546116282447
Range: npt=0.000-

Response Example
RTSP/1.0 200 OK
CSeq: 3
Server: Rtsp Server/3.0
Session: 1546116282447
Range: npt=0.000-
RTP-Info: url=trackID=0;seq=45020;rtptime=1907404764

General APIs 8
Step 4: Execute the TEARDOWN command to stop playing the media, and then disable the UDP
socket.
Request Example
TEARDOWN rtsp://192.168.1.108/cam/realmonitor?channel=1&subtype=0/ RTSP/1.0
CSeq: 4
User-Agent: LibVLC/3.0.5
Session: 1546116282447

Response Example
RTSP/1.0 200 OK
CSeq: 4
Server: Rtsp Server/3.0
Session: 1546116282447
DA
HU
A_

4.1.2 Get Playback Stream


HT

It's similar with "4.1.1 Get Real-Time Stream", except that there are parameters "starttime" and
TP

"endtime".
_A

URL rtsp://<server>:[port]/cam/playback
PI

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


URL Params ( key=value format in URL )
fo

Name Type R/O Description Example


r

The video channel index which starts 1


channel int R
In

from 1
te

starttime char[32] R The playback begin time 2012_09_15_12_37_05


endtime char[32] O The playback end time 2012_09_15_18_34_14
lb

URL Example
ra

rtsp://192.168.1.108:554/cam/playback?channel=1&starttime=2012_09_15_12_37_05&endtime=2012_
s

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.

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


Method DESCRIBE, SETUP, PLAY, PAUSE, TEARDOWN, ...
URL Params ( key=value format in URL )
Name Type R/O Description Example
URL Example
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

General APIs 9
4.1.4 Get MJPG Stream
Get a video stream encoded by mjpg ( motion jpeg ).

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


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The video channel index which starts from 1 1
The stream type, It can be the following value: 0
0-Main Stream
subtype int R
1-Extra Stream 1
2-Extra Stream 2
Request Example
http://192.168.1.108/cgi-bin/mjpg/video.cgi?channel=1&subtype=0
DA

Response Params ( multipart, binary in body )


HU

<binary data> : JPEG image data


Response Example
A_

HTTP/1.1 200 OK
HT

Server: Device/1.0
TP

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


_A
PI

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

<JPEG image data>


In

--<boundary>
te

Content-Type: image/jpeg
Content-Length:<image size>
lb
ra

<JPEG image data>


s

--<boundary>

4.1.5 Configuring Local Playback Status


Configure the local playback status when accessing the platform. The value of action can be Play, Pause,
Stop, Faster, Slower, Back, NextFile, PreFile, NetFrame, PrevFrame, Up, Down, Left, Right, Enter, and
Escape.
Request URL http://<server>/cgi-bin/api/localPlayback/set
Method POST
Request Params (JSON format in body)
Name Type R/O Description Example
action char[32] O Configure the status of playback, "Play"
fast play and slow play.
Available statuses: Play, Pause,

General APIs 10
Stop, Faster, Slower, Back,
NextFile, PreFile, NetFrame,
PrevFrame, Up, Down, Left,
Right, Enter, and Escape.
Request Example
{
"action": "Play"
}

Response Params ( JSON format in body )


Name Type R/O Description Example
Response Example
{}

4.1.6 Acquiring Local Playback Status


DA
HU

Configure the local playback status when accessing the platform.


Request URL http://<server>/cgi-bin/api/localPlayback/get
A_

Method POST
HT

Request Params (JSON format in body)


TP

Name Type R/O Description Example


_A

action char[32] O Configure the status of playback, "Slower"


PI

fast play, and slow play. The


value can be Play (acquire
fo

playback status), and Speed


(acquire the speed of fast and
r

slow play).
In

Request Example
te

{
lb

"action": "Speed"
}
ra
s

Response Params ( JSON format in body )


Name Type R/O Description Example
result char[64] O Returns the result of "Slower 1x"
getAction. Play
corresponds to three
results: Stopped, Pasued,
and Playing. Speed has
the following situations:
Faster 1×, Slower 1×,
Faster 2×, Slower 2×,
Faster 3×, Slower 3×,
Faster 4×, Slower 4×, and
Normal.

General APIs 11
Response Example
{
"result": "Slower 1×"
}

4.2 Configure Manager

4.2.1 Get and Set Configure


 Get Configure
Get configure detail by name. Each configure name has it’s specific configure detail. Please refer to
configure detail APIs in later [Config] chapters.

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


GET
DA

Method
Request Params ( key=value format in URL )
HU

Name Type R/O Description Sample


A_

name string R The name of the configure SmartEncode


HT

Request Example
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=General
TP
_A

Response Params ( key=value format in body )


PI

Name Type R/O Description Sample


table object R The configure table object.
fo

The configure detail of the requested


r

configure name. Each configure


In

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


detail. Please refer to configure detail
te

apis in later chapters.


lb

Response Example
ra

table.General.MachineID=20832748927
s

table.General.MachineName=DVR001
table.General.MachineAddress=XXX Road

 Set Configure
Set configure detail by name. Each configure name has it’s specific configure detail. Please refer to
configure detail APIs in later [Config] chapters.

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


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Sample
string/o The configure detail of the configure name.
<config name> R
bject/ob Each configure name has it’s specific

General APIs 12
ject[] configure detail. Please refer to configure
detail apis in later chapters.
Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&General.MachineID=20832748927&
General.MachineName=DVR001&General.MachineAddress=XXX%20Road

Response Params ( OK in body )


Response Example
OK

4.2.2 Add and Remove Configure


 Add configure
The configuration name is put in the URL in the form of key-value; the specific configuration field can be
obtained through getConfig. Each configure name has it’s specific configure detail. Please refer to
configure detail APIs in later [Config] chapters.
DA

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


HU

Method GET
A_

Request Params ( key=value format in URL )


HT

Name Type R/O Description Sample


The configure detail of the configure name.
TP

string/o
Each configure name has it’s specific
_A

<config name> bject/ob R


configure detail. Please refer to configure
ject[]
PI

detail apis in later chapters.


Request Example
fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=addConfig&General.MachineAddress=XXX%20
r

Road
In

Response Params ( OK in body )


te

Response Example
lb

OK
ra

 Remove configure
s

Specific configuration fields can be obtained through getConfig. Only configuration fields can be deleted,
not configuration items. Each configure name has it’s specific configure detail. Please refer to configure
detail APIs in later [Config] chapters.

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


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Sample
name string R configuration param name VSP_CGI.ServiceStart
Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=removeConfig&General.MachineAddress

Response Params ( OK in body )


Response Example

General APIs 13
OK

4.2.3 Backup of Config


Download all configurations of the device and save them to a file. The default name of the file is
Config.Backup.
Request URL http://<server>/cgi-bin/Config.backup?action=All
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
http://<server>/cgi-bin/Config.backup?action=All

Response Params ( JSON format in body )


Name Type R/O Description Example
DA

The field name is the configuration name.


HU

The field value is the corresponding


char[32]/object/
A_

<config name> R configuration data. For configuration details


object[]
on each configuration name, see
HT

configuration item description.


TP

Response Example
_A

HTTP/1.1 200 OK
PI

Connection: close
Content-Length: 743087
fo

Content-Type: application/octet-stream; charset=utf-8


r

{
In

"ATM" : {
te

"DataSource" : "RS232",
lb

"DisplayPostion" : "lefttop",
"EncodeBlend" : true,
ra

"PreviewBlend" : true,
s

"ProtocolAbility" : [ "POS" ],
"ProtocolName" : "ATM\/POS",
"RecordChannels" : [ 0, 1, 2, 3 ]
},
……
}

4.2.4 Restore the Config


Restore specified configurations to the default values.

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


Method GET

General APIs 14
Request Params ( key=value format in URL )
Name Type R/O Description Example
names char[][32] R Array of the configuration names that [ "General", "UPnP" ]
needs to be restored to the default
values.
Request Example
http://<server>/cgi-bin/configManager.cgi?action=restore&names[0]=General&names[1]=UPnp

Response Params ( OK in body )


Response Example
OK

4.2.5 Restore except the Config


Restore all other configurations except for the specified configurations to the default values.
DA

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


HU

Method GET
A_

Request Params ( key=value format in URL )


HT

Name Type R/O Description Example


TP

names char[][32] R Array of the configuration names that [ "General", "UPnP" ]


does not need to be restored to the
_A

default values.
PI

Request Example
http://<server>/cgi-bin/configManager.cgi?action=restoreExcept&names[0]=General&names[1]=UPnp
fo
r

Response Params ( OK in body )


In

Response Example
te

OK
lb
ra

4.3 Audio
s

4.3.1 Get Audio Input Channel Numbers


Get audio input channel number.

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


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
http://192.168.1.108/cgi-bin/devAudioInput.cgi?action=getCollect

Response Params ( key=value format in body )

General APIs 15
Name Type R/O Description Example
result int R audio input channel number. 1
Response Example
result=1

4.3.2 Get Audio Output Channel Numbers


Get audio output channel number.

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


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
http://192.168.1.108/cgi-bin/devAudioOutput.cgi?action=getCollect

Response Params ( key=value format in body )


DA

Name Type R/O Description Example


HU

result int R audio output channel number. 2


A_

Response Example
HT

result=2
TP
_A

4.3.3 Post Audio Stream


PI

Post audio stream to device, request is very long and client continues to send audio data. If client
fo

want to stop, just close the connection.


r

Request URL http://<server>/cgi-bin/audio.cgi?action=postAudio


In

Method POST
te

Request Params ( key=value format in URL )


lb

Name Type R/O Description Example


audio http transmit format, can be : singlepart
ra

singlepart: HTTP content is a continuous flow of


s

audio packets
httptype string R
multipart: HTTP content type is
multipart/x-mixed-replace, and each audio packet
ends with a boundary string
channel int R The audio channel index which starts from 1. 1
Request Example ( singlepart )
POST http://192.168.1.108/cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1 HTTP/
1.1
User-Agent: client/1.0
Content-Type: Audio/G.711A
Content-Length: 9999999

<Audio data>
<Audio data>

General APIs 16

Request Example ( multipart )
POST http://192.168.1.108/cgi-bin/audio.cgi?action=postAudio&httptype=multipart&channel=1 HTTP/
1.1
User-Agent: client/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>

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

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

<Audio data>
HU

--<boundary>

A_
HT

Response Params ( N/A )


TP

Name Type R/O Description Example


Response Example
_A

( N/A )
PI

Appendix A: Audio Encode Type


fo

MIME ( Content-Type ) Description


r

Audio/PCM PCM
In

Audio/ADPCM ADPCM
te

Audio/G.711A G.711 A Law


Audio/G.711Mu G.711 Mu Law
lb

Audio/G.726 G.726
ra

Audio/G.729 G.729
s

Audio/MPEG2 MPEG2
Audio/AMR AMR
Audio/AAC AAC

4.3.4 Get Audio Stream


Get audio stream from device, response is very long and client continues to recv audio data. If client
want to stop, just close the connection.

Request URL http://<server>/cgi-bin/audio.cgi?action=getAudio


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
httptype string R audio http transmit format, can be : singlepart

General APIs 17
singlepart: HTTP content is a continuous flow of
audio packets
multipart: HTTP content type is
multipart/x-mixed-replace, and each audio packet
ends with a boundary string
channel int R The audio channel index which starts from 1. 1
Request Example
http://192.168.1.108/cgi-bin/audio.cgi?action=getAudio&httptype=singlepart&channel=1

Response Params ( binary in body )


Name Type R/O Description Example
Response Example ( singlepart )
200 OK HTTP/1.1
Server: device/1.0
Content-Type: Audio/G.711A
Content-Length: 9999999
DA

<Audio data>
HU

<Audio data>
A_


HT

Response Example ( multipart )


TP

200 OK HTTP/1.1
Server: device/1.0
_A

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


PI

--<boundary>
fo

Content-Type: Audio/G.711A
r

Content-Length: 800
In

<Audio data>
te

--<boundary>
lb

Content-Type: Audio/G.711A
ra

Content-Length: 800
s

<Audio data>
--<boundary>

4.3.5 [Config] Volume Control


Volume control configuration parameters:
Config Data Params
Name Type R/O Description Example
R Audio output volume. Each element of the [80,50]
AudioOutputVolume int[]
array represents the volume value of an

General APIs 18
audio output channel, and the range is
[1-100].

For getting and setting the configurations, see "4.2.1 Get and Set Configure" .
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AudioOutputVolume
Get Config Response Example
table.AudioOutputVolume[0]=80
table.AudioOutputVolume[1]=50

Set Config Request Example


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AudioOutputVolume[0]=80&AudioOut
putVolume[1]=50
Set Config Response Example
OK
DA
HU
A_

4.4 Snapshot
HT
TP

4.4.1 [Config] Snap


_A

Snapshot configuration parameters:


PI

Config Data Params


fo

Name Type R/O Description Example


R One element for each channel, and the [80,50]
r

Snap object[] array index represents the channel


In

number which starts from 0.


te

O Whether holiday setting is supported. false


+HolidayEnable bool
lb

It is not supported by default.


Configure the period of capturing [ [ "6 00:00:00-23:
ra

snapshots. 59:59", "0 00:00:


s

Two-dimensional array in strings. 00-23:59:59","0 0


The first dimension of the array is the day 0:00:00-23:59:59"
of the week, and the range is [0–7] , "0 00:00:00-23:5
(Sunday–Saturday). The last item is for 9:59", … ] ]
holiday.
char[8][2 The second dimension is the period
TimeSection
4][32] index. One day is divided into multiple
periods, and the range is [0–23].
Each period is set as a string in the
format of:mask hh: mm: ss-hh: mm: ss
Mask: The range is [0–4294967295], and
each bit carries a special meaning. See
the description as follows:
hh: Hour; range: [0–24]

General APIs 19
mm: Minute; range: [0–59]
ss: Description; ranges [0 to 59]
Mask: record type.
Meaning of each bit:
Bit0: Normal snapshot
Bit1: Motion detection snapshot
Bit2: Alarm snapshot
Bit3: Card-swiping snapshot
Bit6: POS snapshot
Bit4, Bit5, Bit7–Bit31: Reserved.

For getting and setting the configurations, see "4.2.1 Get and Set Configure" .
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Snap
Get Config Response Example
table.Snap[0].HolidayEnable=true
DA

table.Snap[0].TimeSection[0][0]=6 00:00:00-23:59:59
HU

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


table.Snap[1].HolidayEnable=false
HT

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

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


PI

Set Config Request Example


fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Snap[0].HolidayEnable=true&Snap
r

[0].TimeSection[0][0]=6 00:00:00-23:59:59&Snap[0].TimeSection[0][1]=0 00:00:00-23:59:59&Snap[1].


HolidayEnable=false&Snap[1].TimeSection[0][1]=0 00:00:00-23:59:59&Snap[1].TimeSection[0][1]=0 0
In

0:00:00-23:59:59
te

Set Config Response Example


lb

OK
ra
s

4.4.2 Get a Snapshot


Get snapshots of a specified video channel
Request URL http://<server>/cgi-bin/snapshot.cgi
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O Video channel number starting from 1, and the default 1
value is 1.
Request Example
http://192.168.1.108/cgi-bin/snapshot.cgi?channel=1

Response Params ( binary in body )

General APIs 20
<binary data>: images in JPEG format
Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: image/jpeg
Content-Length:<image size>

<jpeg data>

4.4.3 Subscribe to Snapshot


Subscribe to the events and event snapshots.

For details on the event name and parameters, see the corresponding [Event] sections.

Request URL http://<server>/cgi-bin/snapManager.cgi?action=attachFileProc


DA

Method GET
HU

Request Params ( key=value format in URL )


Name Type R/O Description Example
A_

channel int O Video channel number, starting from 1. 1


HT

If not specified, the default value is 1.


TP

heartbeat int O Heartbeat interval. 5


_A

Unit: s
Range: [1–60], and the default value is 5.
PI

While sending the events, the device


regularly sends a heartbeat message to keep
fo

itself alive.
r

The message is a string named "heartbeat".


In

Flags char[][32] R Subscription parameter. "Event"


te

The value "Event" should be included.


Events char[][32] R The list of event codes [ "VideoMotion" ,
lb

Select All to subscribe all events "TrafficJunction" ]


ra

Common event codes are as follows:


s

VideoMotion: Motion detection


VideoLoss: Video loss
VideoBlind: Video Tampering
AlarmLocal: Local alarms
TrafficJunction: ANPR
TrafficRetrograde: Wrong-way driving
TrafficParking: Illegal parking
TrafficJam: Traffic congestion
TrafficThrow: Throwing out of the vehicle
TrafficPedestrain: A pedestrian walks onto a
motor vehicle lane
TrafficParkingSpaceParking: A vehicle is in
the parking space
TrafficParkingSpaceNoParking: No vehicle is

General APIs 21
in the parking space
TrafficParkingSpaceOverLine: A vehicle
crosses the line of a parking space
TrafficManualSnap: Manual snapshot
capturing
TrafficSuspiciousCar: Suspect vehicle
detection
FaceRecognition: Face recognition
TrafficParkingStatistics: Parking space
counting
AccessControl: Access control unlocking
CitizenPictureCompare: Comparison
between the person and the credential card

Request Example
http://192.168.1.108/cgi-bin/snapManager.cgi?action=attachFileProc&channel=1&heartbeat=5&Flags[0]
DA

=Event&Events=[VideoMotion%2CVideoLoss]
HU

Response Params ( multipart in body )


A_

Name Type R/O Description Example


HT

Events object[] R Event detail array


TP

+EventBaseInfo object R Shared basic information for all events


_A

Event code “”FaceReco


++Code char[32] R
See the description on Events gnition“”
PI

Event action "Pulse"


++Action char[16] R
Value: "Start", "Stop" and "Pulse"
fo

The channel number where the event happens, 0


r

++Index int
starting from 0
In

Unique parameters of each event


te

+… … … For details on each event, see the corresponding


section.
lb

Response Example
ra

HTTP/1.1 200 OK
s

Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

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

Events[0].EventBaseInfo.Code=TrafficJunction
Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Events[0].Lane=1

General APIs 22
Events[0].PTS=42949485818.0
Events[0].TrafficCar.PlateNumber=Z A12345
Events[0].TrafficCar.DeviceAddress=Hangzhou
……
Events[1].EventBaseInfo.Code=TrafficJunction
Events[1].EventBaseInfo.Action=Pulse
Events[1].EventBaseInfo.Index=1
Events[1].CountInGroup=3
Events[1].IndexInGroup=2
Events[1].Lane=1
……
--<boundary>
Content-Type: image/jpeg
Content-Length:<image size>

<JPEG image data>


DA

--<boundary>
Content-Type: text/plain
HU

Content-Length:<data length>
A_
HT

Heartbeat
TP

--<boundary>
……
_A
PI

4.5 Video Attributes


fo
r

4.5.1 Get Max Extra Stream Numbers


In
te

Get the maximum number of sub streams


lb

Request URL http://<server>/cgi-bin/magicBox.cgi?action=getProductDefinition


ra

Method GET
s

Request Params ( key=value format in URL )


Name Type R/O Description Example
name char[] R Name "MaxExtraStream"
Fixed value: MaxExtraStream
Request Example
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExtraStream

Response Params ( key=value format in body )


Name Type R/O Description Example
table object R Return content
The maximum number of sub streams 1
+MaxExtraStream int R
Values: 1, 2 and 3.
Response Example
table.MaxExtraStream=1

General APIs 23
4.5.2 Get Encode Capability
Get encoding capabilities.

Request URL http://<server>/cgi-bin/encode.cgi?action=getCaps


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
http://192.168.1.108/cgi-bin/encode.cgi?action=getCaps

Response Params ( key=value format in body )


Name Type R/O Description Example
caps object R Encoding capability
+MaxExtraStream int O Maximum number of sub stream channels 3
DA

+PreviewSplitNum The live view page can be split to multiple [1, 4, 9, 16]
HU

int[] O
List windows
A_

+PlaybackCompre Secondary compressed playback supports [1, 4, 9, 16]


int[] O
HT

ssSplitNumList being split to multiple windows.


Multi-window live view mode. "SplitEncode"
TP

Values:
_A

SplitEncode: Split encoding mode


PI

SnapShot: Fast snapshot mode


+PreviewMode char[16] O
SplitSnap: Split fast snapshot mode
fo

If the field does not exist or is null, it means the


r

device does not support multi-window live


view.
In

Encoding capability
te

+VideoEncodeDe
object[] O Each element of the array represents a
vices
lb

channel.
ra

++SupportIndividu Whether independent resolution for snapshots true


bool O
alResolution is supported
s

++RecordIndividu Whether independent resolutions for motion true


bool O
alResolution detection and alarm videos are supported.
++MaxCIFPFrame CIF maximum value of the P frame. 40
int O
Size Unit: Kbits
++MinCIFPFrame CIF minimum value of the P frame. 7
int O
Size Unit: Kbits
Display capability of mixed exposure.
+CoriaDisplay object[] O Each element of the array represents a
channel.
Supported display mode: [0,1,2]
++CoriaDisplaySw 0: Default
int[] O
itchs 1: Vehicle mode
2: Person mode

General APIs 24
Response Example
caps.MaxExtraStream=3
caps.PreviewSplitNumList[0]=1
caps.PreviewSplitNumList[1]=4
caps.PreviewSplitNumList[2]=9
caps.PlaybackCompressSplitNumList[0]=1
caps.PlaybackCompressSplitNumList[1]=4
caps.PlaybackCompressSplitNumList[2]=9
caps.PreviewMode=SplitSnap
caps.VideoEncodeDevices[0].SupportIndividualResolution=true
caps.VideoEncodeDevices[0].RecordIndividualResolution=true
caps.VideoEncodeDevices[0].MaxCIFPFrameSize=40
caps.VideoEncodeDevices[0].MinCIFPFrameSize=7
caps.CoriaDisplay[0].CoriaDisplaySwitchs[0]=0
caps.CoriaDisplay[0].CoriaDisplaySwitchs[1]=1
caps.CoriaDisplay[0].CoriaDisplaySwitchs[2]=2
DA
HU

4.5.3 Get Encode Config Capability


A_
HT

Get encoding configuration capabilities


TP

Request URL http://<server>/cgi-bin/encode.cgi?action=getConfigCaps


_A

Method GET
PI

Request Params ( key=value format in URL )


Name Type R/O Description Example
fo

channel int O Video channel number.


r

It an integer starting from 1.


When the channel does not exist, the default
In

number is 1.
te

Encode object[] O The encoding configurations set before will


lb

influence the encoding configurations of


ra

other channels and streams.


+MainFormat object[] O Main stream.
s

Each element of the array represents a


recording type.
0: General encoding
1: Motion detection encoding
2: Alarm encoding
++Video object O Video format
+++Compressi char[16] O Video encoding mode "H.264"
on For example, "MPEG4", "H.264", "H.265"
+++Width int O Video width 1920
Unit: pixels
+++Height int O Video height 1080
Unit: pixels
+++BitRate int O Video stream 2048

General APIs 25
Unit: kbps
+ExtraFormat object[] O Sub stream
Each element of the array represents a sub
stream.
0: Sub stream 1
1: Sub stream 2
2: Sub stream 3
++Video object O Video format
+++Compressi char[16] O Video encoding mode "H.264"
on For example, "MPEG4", "H.264", "H.265"
+++Width int O Video width 720
Unit: pixels
+++Height int O Video height 576
Unit: pixels
+++BitRate int O Video stream 512
Unit: kbps
DA

Request Example
http://192.168.1.108/cgi-bin/encode.cgi?action=getConfigCaps&channel=1&Encode[0].MainFormat[0].V
HU

ideo.Compression=H.264&Encode[0].MainFormat[0].Video.Width=1920&Encode[0].MainFormat[0].Vide
A_

o.Height=1080
HT
TP

Response Params ( key=value format in body )


_A

Name Type R/O Description Example


caps object R Encoding configuration capability
PI

+MainFormat object[] O Main stream.


Each element of the array represents a
fo

recording type.
r

0: General encoding
In

1: Motion detection encoding


te

2: Alarm encoding
++Audio object O Audio encoding capability
lb

+++CompressionT char[] O Supported audio encoding formats: PCM, G.711A, AMR


ra

ypes ADPCM, G.711A, G.711Mu, G.726, G.729,


s

MPEG2, AMR, and SVAC.


++Video object O Video encoding capability
+++CompressionT char[] O Supported vidio encoding formats: MPEG4, MPEG4,
ypes MPEG2, MPEG1, MJPG, H.263, H.264 and H.264, H.265
H.265.
+++ResolutionTyp char[] O Supported video resolutions. D1, 1920x1080
es See the table below for the optional values.
+++BitRateOption char[] O Stream capability 80,448
s Two numbers are divided by a comma. The
former number represents the minimal stream,
and the latter represents the maximum
stream.
Unit: kbps
+++FPSMax int O Maximum frame rate 25

General APIs 26
Sub stream.
Each element of the array represents a sub
stream.
+ExtraFormat object[] O
0: Sub stream 1
1: Sub stream 2
2: Sub stream 3
Audio In object O Audio encoding capabilities
+++CompressionT char[] O Supported audio encoding formats: PCM, G.711A, AMR
ypes ADPCM, G.711A, G.711Mu, G.726, G.729,
MPEG2, AMR, and SVAC.
++Video object O Video encoding capability
+++CompressionT char[] O Supported video encoding formats: MPEG4, MPEG4,
ypes MPEG2, MPEG1, MJPG, H.263, H.264 and H.264, H.265
H.265.
+++ResolutionTyp char[] O Supported video resolutions. D1, 1280x720
es See the table below for the options.
DA

+++BitRateOption char[] O Stream capability 80,448


s Two numbers are divided by a comma. The
HU

former number represents the minimal stream,


A_

and the latter represents the maximum


HT

stream. Unit: kbps


TP

+++FPSMax int O Maximum frame rate: 25


Snapshot encoding capability
_A

Each element of the array represents a


PI

snapshot capturing type.


+SnapFormat object[] O
0: General snapshot
fo

1: Motion detection snapshot


r

2: Alarm snapshot
In

++Video object O Snapshot format


+++CompressionT char[16] O Supported encoding formats
te

JPEG
ypes For example, "JPEG"
lb

+++ResolutionTyp int O Supported video resolutions D1, 1280x720


ra

es See the table below for the options.


s

+++FPSMax int O Maximum frame rate 2


Response Example
caps.MainFormat[0].Audio.CompressionTypes=G.711A, AMR
caps.MainFormat[0].Video.CompressionTypes=H.264,MJPG
caps.MainFormat[0].Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF
caps.MainFormat[0].Video.BitRateOptions=448,2560
caps.MainFormat[0].Video.FPSMax=25
caps.ExtraFormat[0].Audio.CompressionTypes=G.711A, AMR
caps.ExtraFormat[0].Video.CompressionTypes=H.264,MJPG
caps.ExtraFormat[0].Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF
caps.ExtraFormat[0].Video.BitRateOptions=448,2560
caps.ExtraFormat[0].Video.FPSMax=25
caps.SnapFormat[0].Video.CompressionTypes=JPEG
caps.SnapFormat[0].Video.ResolutionTypes=2048 x 1536,1080,SXGA, 1280 x 960,720,D1,CIF

General APIs 27
caps.SnapFormat[0].Video.FPSMax=2

Appendix A: 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
"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 —
"QQVGA" 160 x 128 —
"SVGA" 800 x 592 —
"SVGA1" 800 x 600 —
DA

"WVGA" 800 x 480 —


HU

"FWVGA" 854 x 480 —


A_

"DVGA" 960 x 640 —


"XVGA" 1024 x 768 —
HT

"WXGA" 1280 x 800 —


TP

"WXGA2" 1280 x 768 —


_A

"WXGA3" 1280 x 854 —


PI

"WXGA4" 1366 x 768 —


"SXGA" 1280 x 1024 —
fo

"SXGA+" 1400 x 1050 —


r

"WSXGA" 1600 x 1024 —


In

"UXGA" 1600 x 1200 —


"WUXGA" 1920 x 1200 —
te

"ND1" 240 x 192 —


lb

"720P" 1280 x 720 —


ra

"1080P" 1920 x 1080 —


s

"QFHD" 3840 x 2160 —


"1_3M", "1280x960" 1280 x 960 (1.3 Mega Pixels) —
"2_5M", "1872x1408" 1872 x 1408 (2.5 Mega Pixels) —
"5M", "3744x1408" 3744 x 1408 (5 Mega Pixels) —
"3M", "2048x1536" 2048 x 1536 (3 Mega Pixels) —
"5_0M", "2432x2048" 2432 x 2048 (5 Mega Pixels) —
"1_2M", "1216x1024" 1216 x 1024 (1.2 Mega Pixels) —
"1408x1024" 1408 x 1024 (1.5 Mega Pixels) —
"3296x2472" 3296 x 2472 (8 Mega Pixels) —
"5_1M", "2560x1920" 2560 x 1920 (5 Mega Pixels) —
"960H", 960 x 576 960 x 480
"DV720P" 960 x 720 —
"2560x1600" 2560 x 1600 (4 Mega Pixels) —
"2336x1752" 2336 x 1752 (4 Mega Pixels) —

General APIs 28
Fixed Resolution Name Size in PAL Size in NTSC
"2592x2048" 2592 x 2048 —
"2448x2048" 2448 x 2048 —
"1920x1440" 1920x1440 —
"2752x2208" 2752x2208 —
"3840x2160" 3840x2160 —
"4096x2160" 4096x2160 —
"3072x2048" 3072x2048 —

4.5.4 Encode of Media


 Get encode config

Table 4-1
DA

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

Description Get video encode config.


A_

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

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

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

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

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

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

table.Encode[0].MainFormat[0].AudioEnable=true
In

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

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

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

table.Encode[0].MainFormat[0].Video.CustomResolutionName=1080P
Success
s

table.Encode[0].MainFormat[0].Video.FPS=18
Return
table.Encode[0].MainFormat[0].Video.GOP=36
table.Encode[0].MainFormat[0].Video.Height=1080
table.Encode[0].MainFormat[0].Video.Pack=DHAV
table.Encode[0].MainFormat[0].Video.Profile=High
table.Encode[0].MainFormat[0].Video.Quality=4
table.Encode[0].MainFormat[0].Video.QualityRange=6
table.Encode[0].MainFormat[0].Video.SVCTLayer=1
table.Encode[0].MainFormat[0].Video.Width=1920
table.Encode[0].MainFormat[0].Video.Priority=0
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

General APIs 29
table.Encode[0].MainFormat[1].Audio.Depth=16
table.Encode[0].MainFormat[1].Audio.Frequency=8000
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
table.Encode[0].MainFormat[1].Video.CustomResolutionName=1080P
table.Encode[0].MainFormat[1].Video.FPS=18
table.Encode[0].MainFormat[1].Video.GOP=36
table.Encode[0].MainFormat[1].Video.Height=1080
table.Encode[0].MainFormat[1].Video.Pack=DHAV
table.Encode[0].MainFormat[1].Video.Profile=High
table.Encode[0].MainFormat[1].Video.Quality=4
DA

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

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

table.Encode[0].MainFormat[1].Video.Priority=0
HT

table.Encode[0].MainFormat[1].VideoEnable=true
TP

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

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

table.Encode[0].MainFormat[2].Audio.Depth=16
table.Encode[0].MainFormat[2].Audio.Frequency=8000
fo

table.Encode[0].MainFormat[2].Audio.Mode=0
r

table.Encode[0].MainFormat[2].Audio.Pack=DHAV
In

table.Encode[0].MainFormat[2].AudioEnable=true
te

table.Encode[0].MainFormat[2].Video.resolution=1920x1080
table.Encode[0].MainFormat[2].Video.BitRate=4096
lb

table.Encode[0].MainFormat[2].Video.BitRateControl=CBR
ra

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

table.Encode[0].MainFormat[2].Video.CustomResolutionName=1080P
table.Encode[0].MainFormat[2].Video.FPS=18
table.Encode[0].MainFormat[2].Video.GOP=36
table.Encode[0].MainFormat[2].Video.Height=1080
table.Encode[0].MainFormat[2].Video.Pack=DHAV
table.Encode[0].MainFormat[2].Video.Profile=High
table.Encode[0].MainFormat[2].Video.Quality=4
table.Encode[0].MainFormat[2].Video.QualityRange=6
table.Encode[0].MainFormat[2].Video.SVCTLayer=1
table.Encode[0].MainFormat[2].Video.Width=1920
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

General APIs 30
table.Encode[0].MainFormat[3].Audio.Compression=G.711A
table.Encode[0].MainFormat[3].Audio.Depth=16
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
table.Encode[0].MainFormat[3].Video.Compression=H.264
table.Encode[0].MainFormat[3].Video.FPS=25
table.Encode[0].MainFormat[3].Video.GOP=50
table.Encode[0].MainFormat[3].Video.Height=576
table.Encode[0].MainFormat[3].Video.Pack=DHAV
table.Encode[0].MainFormat[3].Video.Profile=Main
table.Encode[0].MainFormat[3].Video.Quality=4
DA

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

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

table.Encode[0].MainFormat[3].Video.Priority=0
HT

table.Encode[0].MainFormat[3].VideoEnable=true
TP

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

_A

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


Parameters in Response:
fo

The format of the config is head.configItems. The head can be:


r

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


In

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


te

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


lb

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

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


s

Type:
Comment
0 = regular encode
1 = motion detection encode
2 = alarm encode
3= emergency encode
ExtraStream:
0 = extra stream 1
1 = extra stream 2
2 = extra stream 3
The configItems are list as bellow.
 Set encode config

Table 4-2

General APIs 31
http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>...]
Method GET
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,
head=Encode[Channel].MainFormat[RecordType] (or)
Encode[Channel].ExtraFormat[ExtraStream]

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

0 = regular record
HU

1 = motion detection record


2 = alarm record
A_

ExtraStream:
HT

0 = extra stream 1
TP

1 = extra stream 2
_A

2 = extra stream 3
PI

Appendix A: Video Encode Config

ParamName ParamValue type Description


fo

Unit is Kbps
r

head.Video.BitRate integer
Range depends on capability in GetVideoConfigCaps
In

Range is {CBR, VBR}


te

head.Video.BitRateControl string CBR: constant bitrates


lb

VBR: variable bitrates


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

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


s

Depends on capacity in GetVideoConfigCaps


Frames per second.
<1.0: several seconds/frame, FPS=0.3333: 3 seconds
per frame.
head.Video.FPS float
>1.0: several frames/second. FPS=3: 3 frames per
second.
Range depends on capability in GetVideoConfigCaps
Range is [1—100].
Group of picture, it's the interval of I Frame,
head.Video.GOP integer
Example: GOP=50, means there is one I frame every
49 P or B frames
head.Video.Height integer Video height
head.Video.Width integer Video Width

General APIs 32
ParamName ParamValue type Description
Range is { Baseline, Main , Extended , High }
head.Video.Profile String
Only when video compression is H.264, it's effective.
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
head.Video.Priority integer 0 for Image Quality first
1 for Bitstream first
head.VideoEnable bool True: enable video

Appendix B: Audio Encode Config

ParamName ParamValue type Description


Unit is kbps
DA

head.Audio.Bitrate integer Range depends on capacity in


HU

GetAudioConfigCaps
Range depends on capacity in
A_

head.Audio.Compression string
GetAudioConfigCaps
HT

head.Audio.Depth integer Audio sampling depth


TP

head.Audio.Frequency integer Audio sampling frequency


_A

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

0: 4.75kbps,
fo

1: 5.15 kbps,
2: 5.9 kbps,
r

head.Audio.Mode integer
3: 6.7 kbps,
In

4: 7.4 kbps,
te

5: 7.95 kbps,
lb

6: 10.2 kbps,
7: 12.2 kbps,
ra

head.AudioEnable bool Enable/Disable audio


s

4.5.5 Encode of Region Interested


 Get encode config of region interested

Table 4-3

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoEncodeROI
Method GET
Description Get video encode config of region interested.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoEncode
Example
ROI
Success head.Regions[0][0]=0
Return head.Regions[0][1]=0

General APIs 33
head.Regions[0][2]=0
head.Regions[0][3]=0
head.Regions[1][0]=0

head.Quality=4,
head.Main=true,
head.Extra1=true,
head.Extra2=true,
head.Extra3=true,
head.Snapshot=true
head.DynamicTrack=true,
head.DynamicDelayTime=60
Parameters in Response:
head=table.VideoEncodeROI[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

 Set encode config of region interested


HU

Table 4-4
A_
HT

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

Method GET
_A

Description Set video encode config of region interested.


PI

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoEncodeROI[0].
Example
DynamicTrack=true
fo

Success
OK
r

Return
Parameters in URL:
In

paramName and paramValue are as table below.


te

In table below,
Comment
lb

head = VideoEncodeROI[ChannelNo]
ra

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

Appendix:
ParamName ParamValue type Description
head. DynamicTrack bool Enable/Disable

4.5.6 [Config] Channel Title


Channel title configuration parameters:
Config Data Params
Name Type R/O Description Example
Array
One element for each channel, and the
ChannelTitle object[] R
array index represents the channel
number which starts from 0.

General APIs 34
The content represented in the form of "CAM1|123"
string.
+Name char[] R
'|' means line change, and up to two
lines are supported.

For getting and setting the configurations, see "4.2.1 Get and Set Configure" .
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=ChannelTitle
Get Config Response Example
table.ChannelTitle[0].Name=CAM1|123
table.ChannelTitle[1].Name=CAM2|456

Set Config Request Example


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ChannelTitle[0].Name=CAM1|123&C
hannelTitle[1].Name=CAM2|456
DA

Set Config Response Example


HU

OK
A_
HT

4.5.7 Get Video Input Channels Device Supported


TP
_A

Table 4-5
PI

Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=getCollect
fo

Method GET
r

Description Get the video input channel numbers.


In

Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCollect
Success
te

result=1
Return
lb

Comment —
ra
s

4.5.8 Get Video Output Channels Device Supported

Table 4-6

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
Return
Comment —

General APIs 35
4.5.9 Get Max Remote Input Channels

Table 4-7

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxRemoteI
nputChannels
Method GET
Description Get max remote input channels.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxRe
moteInputChannels
Success table.MaxRemoteInputChannels=16
Return
Comment MaxRemoteInputChannels: max remote input channels.

4.5.10 Video Standard


DA

 Get video standard


HU
A_

Table 4-8
HT

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoStandard
TP

Method GET
_A

Description Get video standard config.


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

d
fo

Success table.VideoStandard=PAL
Return
r

Comment —
In

 Set video standard


te
lb

Table 4-9
ra

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

alue>
Method GET
Description Set video standard config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoStandard=PAL
Success OK
Return
Comment VideoStandard: string, range is {PAL, NTSC} Video Standard.

4.5.11 Video Widget


 Get video widget config

Table 4-10

General APIs 36
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidget
Method GET
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
head.BackColor[3]=128
head.EncodeBlend=true
head.FrontColor[0]=255
head.FrontColor[1]=255
head.FrontColor[2]=255
head.FrontColor[3]=0
head.Rect[0]=0
DA

head.Rect[1]=8191
HU

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


HT

Comment Parameters in Response:


TP

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

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

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

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

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


In

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

0 = region 1
1 = region 2
lb

2 = region 3
ra

3 = region 4
s

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

Table 4-11

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video widget config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[1].Cov
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
Success
OK
Return

General APIs 37
Parameters in URL:
In table below,
headChannelTitle = VideoWidget[Channel].ChannelTitle
headCover = VideoWidget[Channel].Covers[CoReg]
headTimeTitle = VideoWidget[Channel].TimeTitle
headUserDefinedTitle = VideoWidget[Channel].UserDefinedTitle[Index]

Comment 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
0 = region 1
1 = region 2
2 = region 3
3 = region 4
Index: integer, User-defined title index, now only index 0 is valid, others are reserved.

Appendix:
DA
HU

ParamName ParamValue type Description


Range is [0—255].
A_

headCover.BackColor[0]
BackColor[0]:red value
HT

headCover.BackColor[1]
integer BackColor[1]:green value
headCover.BackColor[2]
TP

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

BackColor[3]: alpha value


headCover.EncodeBlend bool false - widget blend is not enabled.
PI

Range is [0—255].
headCover.FrontColor[0]
FrontColor[0]:red value
fo

headCover.FrontColor[1]
integer FrontColor[1]:green value
r

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

FrontColor[3]: alpha value


te

Range is [0—8191].
headCover.Rect[0] Rect[0]: top left corner x coordinate (left)
lb

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


ra

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

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


(bottom)
headChannelTitle.BackColor[0]
headChannelTitle.BackColor[1]
integer
headChannelTitle.BackColor[2]
headChannelTitle.BackColor[3]
headChannelTitle.EncodeBlend bool Range is the same with headCover.
headChannelTitle.FrontColor[0]
headChannelTitle.FrontColor[1]
integer
headChannelTitle.FrontColor[2]
headChannelTitle.FrontColor[3]

General APIs 38
ParamName ParamValue type Description
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].
Title content. Character '|' means
headUserDefinedTitle.Text string 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.
headUserDefinedTitle.BackColor[3]
headUserDefinedTitle.EncodeBlend bool
headUserDefinedTitle.FrontColor[0]
DA

headUserDefinedTitle.FrontColor[1]
integer
HU

headUserDefinedTitle.FrontColor[2]
headUserDefinedTitle.FrontColor[3]
A_

headUserDefinedTitle.Rect[0]
HT

headUserDefinedTitle.Rect[1]
integer
TP

headUserDefinedTitle.Rect[2]
_A

headUserDefinedTitle.Rect[3]
headTimeTitle.BackColor[0]
PI

headTimeTitle.BackColor[1]
integer
fo

headTimeTitle.BackColor[2]
headTimeTitle.BackColor[3]
r

headTimeTitle.EncodeBlend bool
In

headTimeTitle.FrontColor[0] Range is the same with


te

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

headTimeTitle.FrontColor[2]
headTimeTitle.FrontColor[3]
ra

headTimeTitle.Rect[0]
s

headTimeTitle.Rect[1]
integer
headTimeTitle.Rect[2]
headTimeTitle.Rect[3]
headTimeTitle.ShowWeek bool True: Display week within the time title.

4.5.12 Get Video Input Capability

Table 4-12

Syntax http://<server>/cgi-bin/devVideoInput.cgi?action=getCaps&channel=<ChannelNo>
Method GET
Description Get video input capabilities.
Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCaps&channel=1

General APIs 39
caps.AutoSyncPhase=false
caps.Backlight=2
caps.BrightnessCompensation=true
caps.ChipID=0
caps.CoverCount=4
caps.CoverType=1
caps.CustomManualExposure=true
caps.DayNightColor=true
caps.DayNightColorIO=false
caps.DoubleExposure=0
caps.DownScaling=false
caps.EEModeRange=100
caps.ElectricFocus=false
caps.Exposure=16
caps.ExposureMode=31
caps.ExternalSyncInput=false
DA

caps.FishEye=false
caps.FlashAdjust=false
HU

caps.Flip=true
A_

caps.FormatCount=5
HT

caps.Gain=true
TP

caps.GainAuto=true
caps.Gamma=true
_A

Success
caps.GammaModeRange=100
PI

Return
caps.GlareInhibition=1
caps.HorizontalBinning=0
fo

caps.IRCUT=true
r

caps.ImageEnhancement.LevelRange[0]=0
In

caps.ImageEnhancement.LevelRange[1]=100
caps.ImageEnhancement.Support=true
te

caps.InfraRed=true
lb

caps.Iris=true
ra

caps.IrisAuto=true
s

caps.LadenBitrate=972000
caps.LimitedAutoExposure=true
caps.MaxExposureTime=300.0
caps.MaxExposureTime1=0.0
caps.MaxHeight=1080
caps.MaxMultiProfile=3
caps.MaxWidth=1920
caps.MeteringRegionCount=0
caps.MinExposureTime=1.0
caps.MinExposureTime1=0.0
caps.Mirror=true
caps.MultiOptions=false
caps.NightOptions=true
caps.ReferenceLevel=false

General APIs 40
caps.Rotate90=true
caps.SetColor=true
caps.SignalFormats=Inside
caps.SignalType[0]=VGA
caps.SnapshotExposure=false
caps.SupportProfile=false
caps.SupportWhiteLevel=true
caps.SupportWriteLevel=false
caps.SyncChipChannels=false
caps.SyncFocus=false
caps.TitleCount=4
caps.TridimDenoise=2
caps.TridimDenoiseDetails=0
caps.UTC=0
caps.UpScaling=false
caps.Version=0
DA

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

caps.VideoInDenoise.2D.LevelRange[1]=100
A_

caps.VideoInDenoise.2D.Support=true
HT

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

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

caps.VideoInDenoise.Support=true
PI

caps.WhiteBalance=3
caps.WideDynamicRange=1
fo

Parameters in URL:
r

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


Comment
In

Parameters in Response:
see table below
te
lb

Appendix:
ra

Field in response Value type Description


s

0: not support backlight ;


Backlight integer 1: support backlight;
2: support regional regulation
ChipID String ID of chips in this channel
CoverCount integer The maximum cover region count.
0: don't support cover
CoverType integer 1: support realtime cover
2: support non-realtime cover
CustomManualExposur
bool, true: support use defined manual exposure time
e
DayNightColor bool true: support color alternate between day and night.
DownScaling bool true: support down scaling, binning mode not included.
Exposure integer Exposure grade. 0 — don't support exposure control.
ExternalSyncInput bool true: support HD signal external synchronization.

General APIs 41
Field in response Value type Description
FlashAdjust bool true: support flash adjust
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,
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
Iris bool true: support Iris adjust
IrisAuto bool true: support auto Iris adjust
Unit is Kbps.
LadenBitrate integer Maximum value of video stream bitrates, 16bpp, not in
DA

binning mode.
HU

LimitedAutoExposure bool true: support auto exposure with time limit.


A_

MaxExposureTime double upper limit of exposure time, unit: ms


MaxExposureTime1 double upper limit of exposure time, unit: ms
HT

MaxHeight integer Maximum video height


TP

MaxWidth integer Maximum video width


_A

MinExposureTime double lower limit of exposure time, unit: ms


PI

MinExposureTime1 double lower limit of exposure time, unit: ms


Mirror bool true: support picture mirror.
fo

NightOptions bool true: support night options.


r

ReferenceLevel bool true: support reference level.


Rotate90 bool true: support clockwise/anticlockwise 90°rotate
In

SetColor bool true: support color set.


te

It's a string contains supported video input signal formats


lb

for this channel. Signal formats are separated by comma.


ra

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


SignalFormats string 1_3M}
s

Inside — inside input.


1_3M — 1280*960
True: channels in same chip should be synchronized.
SyncChipChannels bool Synchronized means video resolution of these channels
should be the same.
TitleCount integer Maximum count of blending titles.
UpScaling bool true: support up scaling.

General APIs 42
Field in response Value type Description
Range is {0, 1, 2, 3}
0: don't support white balance.
1: support auto white balance
WhiteBalance integer
2: support auto and pre defined white balance.
3: support auto, pre defined and user defined white
balance

4.5.13 Get Coordinates of Current Window

Table 4-13

http://<server>/cgi-bin/devVideoInput.cgi?action=getCurrentWindow&channel=<Chann
Syntax
elNo>
Method GET
Description Get the coordinates of the current window.
DA

Example http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCurrentWindow&channel=1
HU

rect[0]=500
Success rect[1]=500
A_

Return rect[2]=5000
HT

rect[3]=5000
TP

Parameters in URL:
_A

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


Comment Parameters in Response:
PI

rect[n] : relative coordinates, range is 0-8192.{0,0,0,0} top-left,


fo

{8192,0,0,0} top-right, {0,8192,0,0} bottom-left, {8192,8192,0,0} bottom-right


r

4.5.14 Set Coordinates of Current Window


In
te

Table 4-14
lb

http://<server>/cgi-bin/devVideoInput.cgi?action=setCurrentWindow&channel=<Chann
ra

Syntax
elNo>&rect[0]=<rect0>&rect[1]=<rect1>&rect[2]=<rect2>&rect[3]=<rect3>
s

Method GET
Description Set the coordinates of the current window.
http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=setCurrentWindow&channel=1&
Example
rect[0]=0&rect[1]=0&rect[2]=5000&rect[3]=5000
Success
OK
Return
Parameters in URL:
ChannelNo: integer, video channel index which starts from 1.
Comment
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

4.5.15 Video Out


 Get video out config

General APIs 43
Table 4-15

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoOut
Method GET
Description Get video out config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoOut
head.Margin[0]=0
head.Margin[1]=0
head.Margin[2]=0
head.Margin[3]=0
head.Color.Brightness=50
head.Color. Contrast =50
Success head.Color. Satuation =50
Return head.Color. Hue =50
head.Mode. Width =800
head.Mode. Height=600
DA

head.Mode. BPP =16


HU

head.Mode. Format ="Auto"


head.Mode. RefreshRate =60
A_


HT

Parameters in Response:
TP

head = table.VideoOut[ChannelNo].
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).
PI

 Set video out config


fo

Table 4-16
r

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

Syntax
alue>[&<paramName>=<paramValue>…]
te

Method GET
lb

Description Set video out config.


ra

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&table.VideoOut[1].Co
Example
lor.Brightness=50
s

Success
OK
Return
Parameters in URL:
In table below,
Comment head = table.VideoOut[ChannelNo].
ChannelNo: 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

General APIs 44
ParamName ParamValue type Description
head. Margin[0]
head. Margin[1]
integer Margin.
head. Margin[2]
head. Margin[3]
head. Color.Brightness integer Brightness.
head. Color.Contrast =50 integer Contrast.
head.Color.Satuation =50 integer Satuation.
head. Color.Hue =50 integer Hue.
head. Mode.Width =800
integer Resolution.
head. Mode.Height=600
head. Mode.BPP =16 integer Bits per pixel.
The range is {"Auto","TV","VGA","DVI","HDMI",
head.Mode.Format="Auto" string
"SPOT","SDI", "HDMI/VGA"}.
head.Mode.RefreshRate=60 integer Refresh rate.
DA

4.5.16 Smart Code


HU
A_

 Get Smart Code config


HT

Table 4-17
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SmartEncode
_A

Method GET
PI

Description Get smart code config.


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

Success head.Enable=false
r

Return head.Extra[0]=false
In

Parameters in Response:
head = table.SmartEncode[ChannelNo].
te

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

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


ra

 Set Smart Code config


s

Table 4-18

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set smart code config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SmartEncode[0].Ena
Example
ble=true
Success
OK
Return
Parameters in URL:
Comment In table below,
head = SmartEncode[ChannelNo].

General APIs 45
ChannelNo: 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


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.

4.5.17 Get Decoder Caps


URL http://<server>/cgi-bin/DevVideoDec.cgi?action=getCaps
Method GET
Description Get capability of decoder
[ Request Params ] (None )
[ Response Params ] (key=value format)
Name Type R/O Param Description
DA

Video object R The video caps


HU

The stream types that the device supports, ex : h264, h265


+StreamType array<string> R
A_

etc.
The maximum decoding capability that the device supports
HT

+LadenBitrate int R (w * h * FPS * 16)/1024, uint: kbps, ex : 7680*4320*30*8/1024


TP

= 7776000
_A

[ Example ]
PI

Request GET http://192.168.1.108/cgi-bin/DevVideoDec.cgi?action=getCaps


Video.StreamType[0]=h264
fo

Response Video.StreamType[1]=h265
r

Video.LadenBitrate=7776000
In
te

4.5.18 [Config] PrivacyMasking


lb
ra

 Get privacy masking config


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

Method GET
Description Get privacy masking setting
[ Request Params ] (None )
[ Response Params ] (key=value format)
Name Type R/O Param Description
table object R Config info table.
Array<Array<object> PrivacyMasking config, each channel has several
+PrivacyMasking R
> masking region
++Enable bool R Enable/Disable
Size is 3
Postion[0] is horizontal angle, range is [-1—1]
++Postion Array<double> O
Postion[1] is vertical angel, range is [-1—1]
Postion[2] is zoom, range is [ 0—1]

General APIs 46
++ShapeType string O Shape type,can be: “Rect”, “Polygon”
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
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.
++Color Array<int> O Mask color, RGBA color, 4 integer range is 0-255
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

[ Example ]
HU

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PrivacyMaskin
Request
g
A_

table.PrivacyMasking[0][0].Enable=true
HT

table.PrivacyMasking[0][0].Postion[0]=0.0
TP

table.PrivacyMasking[0][0].Postion[1]=0.0
_A

table.PrivacyMasking[0][0].Postion[2]=1.0
table.PrivacyMasking[0][0].ShapeType=Rect
PI

table.PrivacyMasking[0][0].Rect[0]=0
fo

table.PrivacyMasking[0][0].Rect[1]=0
table.PrivacyMasking[0][0].Rect[2]=50
r

Response table.PrivacyMasking[0][0].Rect[3]=100
In

table.PrivacyMasking[0][0].Color[0]=128
te

table.PrivacyMasking[0][0].Color[1]=128
table.PrivacyMasking[0][0].Color[2]=128
lb

table.PrivacyMasking[0][0].Color[3]=255
ra

table.PrivacyMasking[0][0].Mosaic=8
s

table.PrivacyMasking[0][0].ViewAngle=30.0
table.PrivacyMasking[0][1].Enable=true

 Set privacy masking config


Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Description Set privacy masking setting
[ Request Params ] (key=value format )
Name Type R/O Param Description
privacy masking config, each channel has several
PrivacyMasking Array<Array<object>> R
masking region
+Enable bool R Enable/Disable

General APIs 47
Size is 3
Postion[0] is horizontal angle, range is [-1—1]
+Postion Array<double> O
Postion[1] is vertical angel, range is [-1—1]
Postion[2] is zoom, range is [ 0—1]
+ShapeType string O Shape type,can be: “Rect”, “Polygon”
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
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.
+Color Array<int> O Mask color, RGBA color, 4 integer range is 0-255
Mosaic type, Range is {0, 8, 16, 24, 32}
0: no mosaic
8: mosaic size 8*8
+Mosaic int O
DA

16: mosaic size 16*16


HU

24: mosaic size 24*24


32: mosaic size 32*32
A_

+ViewAngle double O View angle, range is [0.0, 360.0], unit: degree


HT

[ Response Params ] ( OK )
TP

[ Example ]
_A

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PrivacyMasking[0][0].En
able=true&PrivacyMasking[0][0].Postion[0]=0.0&PrivacyMasking[0][0].Postion[1]=0.0&Priv
PI

acyMasking[0][0].Postion[2]=1.0&PrivacyMasking[0][0].ShapeType=Rect&PrivacyMasking
Request
fo

[0][0].Rect[0]=0&PrivacyMasking[0][0].Rect[1]=0&PrivacyMasking[0][0].Rect[2]=50&Privac
yMasking[0][0].Rect[3]=100&PrivacyMasking[0][0].Mosaic=8&PrivacyMasking[0][0].ViewA
r

ngle=30.0
In

Response OK
te
lb

4.5.19 Get Privacy Masking


ra
s

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMasking
Method GET
Description Get privacy masking
[ Request Params ] (key=value format at URL)
Name Type R/O Param Description
channel int R video channel index which starts from 1
offset int R Offset in the result record set, range is [0, Total – 1].
limit int R Count of result to get.
[ Response Params ] (key=value format)
Name Type R/O Param Description
total int R Count of result
PrivacyMasking Array<object > R PrivacyMasking config
+Index int R Index of PrivacyMasking which starts from 0

General APIs 48
+Name string O PrivacyMasking name
+Enable int R 1: enable; 0: disable
+ShapeType string O Shape type,can be: “Rect”, “Polygon”
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
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.
+Color Array<int> O Mask color, RGBA color, 4 integer range is 0-255
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
DA

32: mosaic size 32*32


HU

[ Example ]
http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMasking&channel=1&
A_

Request
offset=2&limit =5
HT

total=5
TP

PrivacyMasking[0].Index=0
_A

PrivacyMasking[0].Name=Privacy Masking1
PrivacyMasking[0].Enable=1
PI

PrivacyMasking[0].ShapeType=Polygon
fo

PrivacyMasking[0].Polygon[0][0]= 0
PrivacyMasking[0].Polygon[0][1]=0
r

PrivacyMasking[0].Polygon[1][0]=128
In

PrivacyMasking[0].Polygon[1][1]=128
te

PrivacyMasking[0].Polygon[2][0]=256
Response
PrivacyMasking[0].Polygon[2][1]=200
lb


ra

PrivacyMasking[0].Color[0]=128,
s

PrivacyMasking[0].Color[1]=128,
PrivacyMasking[0].Color[2]=128,
PrivacyMasking[0].Color[3]=255,
PrivacyMasking[0].Mosaic=8,
PrivacyMasking[1].Index =1,
PrivacyMasking[1].Enable=1,

4.5.20 Set Privacy Masking


Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMasking
Method GET

General APIs 49
Description Set privacy masking
[ Request Params ] (key=value format at URL)
Name Type R/O Param Description
channel int R video channel index which starts from 1
PrivacyMasking object R Privacy masking config
+Index int R Index of PrivacyMasking which starts from 0
+Name string O PrivacyMasking name
+Enable int R 1: enable; 0: disable
+ShapeType string R Shape type,can be: “Rect”, “Polygon”
It is valid if ShapeType is Rect , top left and
bottom right point, each point has x and y value,
+Rect Array<int> RO
oordinate remap to 0 — 8192.
mandatory when ShapeType is "Rect"
It is valid if ShapeType is Polygon
the first array is point list, minimum item is 3, the
+Polygon Array<Array<int>> RO second array is point, must be two int, means x
DA

and y value, coordinate remap to 0 — 8192.


HU

mandatory when ShapeType is "Polygon"


A_

Mask color, RGBA color, 4 integer range is 0-255.


+Color Array<int> RO
mandatory when Mosaic is 0
HT

Mosaic type, Range is {0, 8, 16, 24, 32}


TP

0: no mosaic
_A

8: mosaic size 8*8


+Mosaic int R
PI

16: mosaic size 16*16


24: mosaic size 24*24
fo

32: mosaic size 32*32


[ Response Params ] ( OK )
r

[ Example ]
In

http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMasking&channel=2&
te

PrivacyMasking.Index=3&PrivacyMasking.Name=Privacy%20Masking1&PrivacyMasking.
lb

Request Enable=1&PrivacyMasking.ShapeType=Rect&PrivacyMasking.Rect[0]=0&PrivacyMaskin
g.Rect[1]=0&PrivacyMasking.Rect[2]=50&PrivacyMasking.Rect[3]=100&PrivacyMasking.
ra

Mosaic=8
s

Response OK

4.5.21 Goto Privacy Masking


Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=gotoPrivacyMasking
Method GET
Description Goto privacy masking
[ Request Params ] (key=value format at URL)
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 )

General APIs 50
[ Example ]
http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=gotoPrivacyMasking&channel=
Request
2&index=3
Response OK

4.5.22 Delete Privacy Masking


Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=deletePrivacyMasking
Method GET
Description Delete privacy masking
[ Request Params ] (key=value format at URL)
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 )
DA

[ Example ]
HU

http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=deletePrivacyMasking&channel
Request
A_

=2&index=3
HT

Response OK
TP
_A

4.5.23 Clear Privacy Masking


PI

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=clearPrivacyMasking
fo

Method GET
r

Description Clear privacy masking


In

[ Request Params ] (key=value format at URL)


Name Type R/O Param Description
te

channel int R video channel index which starts from 1


lb

[ Response Params ] ( OK )
ra

[ Example ]
s

Request http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=clearPrivacyMasking&channel=2
Response OK

4.5.24 Get Privacy Masking Rect


Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=getRealRect
Method GET
Description Get privacy masking rect
[ Request Params ] (key=value format at URL )
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

General APIs 51
[ Response Params ] (key=value format )
Name Type R/O Param Description
Rect, top left and bottom right point, each point has x and y
Rect Array<int> R
value, oordinate remap to 0 — 8192.
[ Example ]
Request http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=getRealRect&channel=2&index=1
Rect[0]=0
Rect[1]=0
Response
Rect[2]=50
Rect[3]=100

4.5.25 [Config] Motion Detection Settings


 Get motion detect config

Table 4-19
DA

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
HU

Method GET
A_

Description Motion detect config of a video channel contains Enable, MotionDetectWindow and
HT

EventHandler.
Example
TP

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MotionDetect
Success table.MotionDetect[0].Enable=false
_A

Return table.MotionDetect[0].EventHandler.AlarmOut=1
PI

table.MotionDetect[0].EventHandler.AlarmOutChannels[0]=0
table.MotionDetect[0].EventHandler.AlarmOutEnable=true
fo

table.MotionDetect[0].EventHandler.AlarmOutLatch=10
r

table.MotionDetect[0].EventHandler.BeepEnable=false
In

table.MotionDetect[0].EventHandler.Dejitter=5
table.MotionDetect[0].EventHandler.Delay=0
te

table.MotionDetect[0].EventHandler.ExAlarmOut=1
lb

table.MotionDetect[0].EventHandler.ExAlarmOutChannels[0]=0
ra

table.MotionDetect[0].EventHandler.ExAlarmOutEnable=false
s

table.MotionDetect[0].EventHandler.FlashEnable=false
table.MotionDetect[0].EventHandler.FlashLatch=10
table.MotionDetect[0].EventHandler.LogEnable=true
table.MotionDetect[0].EventHandler.MailEnable=false
table.MotionDetect[0].EventHandler.Matrix=1
table.MotionDetect[0].EventHandler.MatrixChannels[0]=0
table.MotionDetect[0].EventHandler.MatrixEnable=false
table.MotionDetect[0].EventHandler.MessageEnable=false
table.MotionDetect[0].EventHandler.PtzLink[0][0]=None
table.MotionDetect[0].EventHandler.PtzLink[0][1]=1
table.MotionDetect[0].EventHandler.PtzLinkEnable=false
table.MotionDetect[0].EventHandler.Record=1
table.MotionDetect[0].EventHandler.RecordChannels[0]=0
table.MotionDetect[0].EventHandler.RecordEnable=true

General APIs 52
table.MotionDetect[0].EventHandler.RecordLatch=10
table.MotionDetect[0].EventHandler.Snapshot=1
table.MotionDetect[0].EventHandler.SnapshotChannels[0]=0
table.MotionDetect[0].EventHandler.SnapshotEnable=false
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
table.MotionDetect[0].EventHandler.TimeSection[0][2]=0 00:00:00-23:59:59
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
table.MotionDetect[0].EventHandler.TimeSection[0][5]=0 00:00:00-23:59:59
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
table.MotionDetect[0].EventHandler.TimeSection[1][2]=0 00:00:00-23:59:59
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
table.MotionDetect[0].EventHandler.TimeSection[1][5]=0 00:00:00-23:59:59
DA

table.MotionDetect[0].EventHandler.TimeSection[2][0]=1 00:00:00-23:59:59
HU

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
A_

table.MotionDetect[0].EventHandler.TimeSection[2][3]=0 00:00:00-23:59:59
HT

table.MotionDetect[0].EventHandler.TimeSection[2][4]=0 00:00:00-23:59:59
TP

table.MotionDetect[0].EventHandler.TimeSection[2][5]=0 00:00:00-23:59:59
_A

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
PI

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
fo

table.MotionDetect[0].EventHandler.TimeSection[3][4]=0 00:00:00-23:59:59
r

table.MotionDetect[0].EventHandler.TimeSection[3][5]=0 00:00:00-23:59:59
In

table.MotionDetect[0].EventHandler.TimeSection[4][0]=1 00:00:00-23:59:59
te

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
lb

table.MotionDetect[0].EventHandler.TimeSection[4][3]=0 00:00:00-23:59:59
ra

table.MotionDetect[0].EventHandler.TimeSection[4][4]=0 00:00:00-23:59:59
s

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
table.MotionDetect[0].EventHandler.TimeSection[5][1]=0 00:00:00-23:59:59
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
table.MotionDetect[0].EventHandler.TimeSection[5][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TimeSection[6][0]=1 00:00:00-23:59:59
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
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
table.MotionDetect[0].EventHandler.TimeSection[6][5]=0 00:00:00-23:59:59
table.MotionDetect[0].EventHandler.TipEnable=false

General APIs 53
table.MotionDetect[0].EventHandler.Tour=1
table.MotionDetect[0].EventHandler.TourChannels[0]=0
table.MotionDetect[0].EventHandler.TourEnable=false
table.MotionDetect[0].EventHandler.Voice.AudioFileName=
table.MotionDetect[0].EventHandler.VoiceEnable=false
table.MotionDetect[0].MotionDetectWindow[0].Id=0
table.MotionDetect[0].MotionDetectWindow[0].Name=Region1
table.MotionDetect[0].MotionDetectWindow[0].Region[0]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[1]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[2]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[3]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[4]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[5]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[6]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[7]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[8]=4194303
DA

table.MotionDetect[0].MotionDetectWindow[0].Region[9]=4194303
HU

table.MotionDetect[0].MotionDetectWindow[0].Region[10]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[11]=4194303
A_

table.MotionDetect[0].MotionDetectWindow[0].Region[12]=4194303
HT

table.MotionDetect[0].MotionDetectWindow[0].Region[13]=4194303
TP

table.MotionDetect[0].MotionDetectWindow[0].Region[14]=4194303
_A

table.MotionDetect[0].MotionDetectWindow[0].Region[15]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Region[16]=4194303
PI

table.MotionDetect[0].MotionDetectWindow[0].Region[17]=4194303
table.MotionDetect[0].MotionDetectWindow[0].Sensitive=60
fo

table.MotionDetect[0].MotionDetectWindow[0].Threshold=5
r

table.MotionDetect[0].MotionDetectWindow[0].Window[0]=0
In

table.MotionDetect[0].MotionDetectWindow[0].Window[1]=0
te

table.MotionDetect[0].MotionDetectWindow[0].Window[2]=8191
table.MotionDetect[0].MotionDetectWindow[0].Window[3]=8191
lb

table.MotionDetect[0].MotionDetectWindow[1].Id=1
ra

table.MotionDetect[0].MotionDetectWindow[1].Name=Region2
s

table.MotionDetect[0].MotionDetectWindow[1].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[8]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[13]=0

General APIs 54
table.MotionDetect[0].MotionDetectWindow[1].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[1].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[1].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[1].Threshold=5
table.MotionDetect[0].MotionDetectWindow[1].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[1].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[2].Id=2
table.MotionDetect[0].MotionDetectWindow[2].Name=Region3
table.MotionDetect[0].MotionDetectWindow[2].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[3]=0
DA

table.MotionDetect[0].MotionDetectWindow[2].Region[4]=0
HU

table.MotionDetect[0].MotionDetectWindow[2].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[6]=0
A_

table.MotionDetect[0].MotionDetectWindow[2].Region[7]=0
HT

table.MotionDetect[0].MotionDetectWindow[2].Region[8]=0
TP

table.MotionDetect[0].MotionDetectWindow[2].Region[9]=0
_A

table.MotionDetect[0].MotionDetectWindow[2].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[11]=0
PI

table.MotionDetect[0].MotionDetectWindow[2].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[2].Region[13]=0
fo

table.MotionDetect[0].MotionDetectWindow[2].Region[14]=0
r

table.MotionDetect[0].MotionDetectWindow[2].Region[15]=0
In

table.MotionDetect[0].MotionDetectWindow[2].Region[16]=0
te

table.MotionDetect[0].MotionDetectWindow[2].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[2].Sensitive=60
lb

table.MotionDetect[0].MotionDetectWindow[2].Threshold=5
ra

table.MotionDetect[0].MotionDetectWindow[2].Window[0]=0
s

table.MotionDetect[0].MotionDetectWindow[2].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[2].Window[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Id=3
table.MotionDetect[0].MotionDetectWindow[3].Name=Region4
table.MotionDetect[0].MotionDetectWindow[3].Region[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[3]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[4]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[5]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[6]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[7]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[8]=0

General APIs 55
table.MotionDetect[0].MotionDetectWindow[3].Region[9]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[10]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[11]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[12]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[13]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[14]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[15]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[16]=0
table.MotionDetect[0].MotionDetectWindow[3].Region[17]=0
table.MotionDetect[0].MotionDetectWindow[3].Sensitive=60
table.MotionDetect[0].MotionDetectWindow[3].Threshold=5
table.MotionDetect[0].MotionDetectWindow[3].Window[0]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[1]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[2]=0
table.MotionDetect[0].MotionDetectWindow[3].Window[3]=0
table.MotionDetect[0].OsdTwinkleEnable=false
DA

table.MotionDetect[0].PirMotionLevel=3
Comment
HU


 Set motion detect config
A_
HT

Table 4-20
TP

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

alue>[&<paramName>=<paramValue>…]
PI

Method GET
Description Set motion detection config.
fo

Enable motion detection:


r

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Ena
ble=true
In
te

Set motion detection regions:


Example
lb

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MotionDetect[0].Moti
ra

onDetectWindow[0].Region[0]=1&MotionDetect[0].MotionDetectWindow[0].Region[1]=
1&MotionDetect[0].MotionDetectWindow[0].Region[2]=1&MotionDetect[0].MotionDetec
s

tWindow[0].Region[3]=1&MotionDetect[0].MotionDetectWindow[0].Region[4]=1&Motion
Detect[0].DetectVersion=V3.0
Success
OK
Return
In table below,
head = MotionDetect[ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel(equals to
video channel index -1, and so 0 means channel 1).
Comment 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
1=Line 2

General APIs 56

WinNum
Index of detect window, there are 4 detect windows at present. Each window is divided
into 18 lines and 22 blocks per line.

Notice: When setting


"MotionDetect[ChannelNo].MotionDetectWindow[WinNum].Region", you need to
contain the parameter "MotionDetect[ChannelNo].DetectVersion=V3.0" along.

Appendix:

ParamName ParamValue type Description


head.Enable bool Enable/Disable motion detect feature in a channel.
Enable/Disable manual control Ptz, only for Hahua
head.PtzManualEnable bool
devices
head.OsdTwinkleEnabl Osd Twinkle Enable
bool
e default : false
DA

head.Row integer motion detect row number


HU

head.Col integer motion detect colum number


A_

head.Level integer sensitive ,range 1-6


HT

head.TimeDivide. array<array<strin
TimeSchedule
TP

TimeSchedule g>>
head.TimeDivide.Level integer sensitive in timesection, different with global sensitive.
_A

head.DetectVersion string detect version


PI

head.PirMotionEnable bool Customized Pir Motion Enable


fo

head.PirMotionLevel integer Customized Pir Motion sensitive level


r

head.VolumeRatio integer Area occupancy ratio


In

head.SubRatio integer SubRatio


te

head.Region array<integer> Region


lb

Setting of EventHandler is described in


head.EventHandler —
SetEventHandler.
ra

head.MotionDetectWin
s

integer It is the Id of a detect window.


dow [WinNum].Id
head.MotionDetectWin
string It is the name of a detect window.
dow [WinNum].Name
head.MotionDetectWin Range is [0—100].
dow[WinNum].Sensitiv integer Sensitivity of motion detection.
e It presents more sensitive if the value is larger.
head.MotionDetectWin Range is [0—100].
dow[WinNum].Threshol integer It presents the threshold value when trigger motion
d detect.

General APIs 57
ParamName ParamValue type Description
It is similar with head.Region [LineNum].
Currently, a region is divided into 18 lines and 22 blocks
per line.
A bit describes a block in the line.
Bit = 1: motion in this block is monitored.
head.MotionDetectWin
Example:
dow[WinNum].Region[ integer
MotionDetect [0].Region [0] = 4194303 (0x3FFFFF): the
LineNum]
22 blocks in channel 0 line 0 is monitored.
MotionDetect [0].Region [1] =0: the 22 blocks in channel
0 line 1 is not monitored.
MotionDetect [0].Region [17] = 3: the left two blocks in
the last line of channel 0 is monitored.

4.5.26 [Config] SmartMotionDetect


DA

 Get smart motion detection setting


HU

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDete
Syntax
ct
A_

Method GET
HT

Description Get smart motion detection setting


TP

[ Request Params ] (None )


_A

[ Response Params ] (key=value format)


Name Type R/O Param Description
PI

table object R Config info table.


fo

+SmartMotionDetec PrivacyMasking config, each channel has one


Array<object> R
t config object
r

++Enable bool R Enable/Disable


In

Detection sensitivity, can be: "Low", "Middle",


++Sensitivity string R
te

"High"
lb

++ObjectTypes object R Detection object type


+++Human bool R Whether detect motion of human
ra

+++Vehicle bool R Whether detect motion of vehicle


s

[ Example ]
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=SmartMotionDe
Request
tect
table.SmartMotionDetect[0].Enable=true
table.SmartMotionDetect[0].Sensitivity=Middle
Response table.SmartMotionDetect[0].ObjectTypes.Human=true
table.SmartMotionDetect[0].ObjectTypes.Vehicle=true

 Set smart motion detection setting


Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Description Set smart motion detection setting

General APIs 58
[ Request Params ] (key=value format )
Name Type R/O Param Description
SmartMotionDet Smart motion detection config, each channel has
Array<object> R
ect one config object
+Enable bool R Enable/Disable
Detection sensitivity, can be: "Low", "Middle",
+Sensitivity string R
"High"
+ObjectTypes object R Detection object type
++Human bool R Whether detect motion of human
++Vehicle bool R Whether detect motion of vehicle
[ Response Params ] ( OK )
[ Example ]
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.Vehicle=true
Response OK
DA
HU
A_

4.5.27 [Config] LAEConfig


HT

 Get LAEConfig setting


TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LAEConfig
_A

Method GET
PI

Description Get LAE Configs.


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

Success table.LAEConfig.Enable=true
r

Return table.LAEConfig.ManulEn=1
table.LAEConfig.YSIGMA =1
In

table.LAEConfig.Dethr =1
te

table.LAEConfig.STS =1
lb

table.LAEConfig.GauFilter0=1
ra

table.LAEConfig.GauFilter1=1
table.LAEConfig.GauFilter2=1
s

table.LAEConfig.UVGauFilter0=1
table.LAEConfig.UVGauFilter1=1
table.LAEConfig.UVGauFilter2=1
table.LAEConfig.UVSigma =1
table.LAEConfig.EEGauFilter0=1
table.LAEConfig.EEGauFilter1=1
table.LAEConfig.EEGauFilter2=1
table.LAEConfig.EEratio =1
table.LAEConfig.GEnable =1
table.LAEConfig.GainLevel =1
table.LAEConfig.DebugPin =1
Comment

General APIs 59
 Set LAEConfig setting
Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVal
ue>[&<paramName>=<paramValue>…]
Method GET
Description Set LAE Configs.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LAEConfig.Enable=tru
e&LAEConfig.ManulEn=1
Success OK
Return
Comment

Appendix:

ParamName ParamValue type Description


turn on/off LAE fuction
table.LAEConfig.Enable bool The following parameters will take effacts when
it’s on
DA

whether use manual mode, 1 for manual mode,


table.LAEConfig.ManulEn integer
HU

0 for alternative plan


A_

absolute strength of Y channel Grinding,


table.LAEConfig.YSIGMA integer
The smaller the stronger(fuzzier)
HT

relative strength of Y channel Grinding,


TP

table.LAEConfig.Dethr integer
The smaller the stronger(fuzzier)
_A

table.LAEConfig.STS integer Y channel STS


PI

table.LAEConfig.GauFilter0 Y channel pre filter0, meet the conditions:


integer GauFilter0 * 2 + GauFilter1 * 2 + GauFilter2 =
fo

256
table.LAEConfig.GauFilter1 integer Y channel pre filter1
r

table.LAEConfig.GauFilter2 integer Y channel pre filter2


In

table.LAEConfig.UVGauFilter0 UV channel pre filter0, meet the conditions:


te

integer GauFilter0 * 2 + GauFilter1 * 2 + GauFilter2 =


lb

256
table.LAEConfig.UVGauFilter1 integer UV channel pre filter1
ra

table.LAEConfig.UVGauFilter2 integer UV channel pre filter2


s

table.LAEConfig.UVSigma absolute strength of UV channel Grinding,


integer
The smaller the stronger
table.LAEConfig.EEGauFilter0 EE pre filter0, meet the conditions: GauFilter0 *
integer
2 + GauFilter1 * 2 + GauFilter2 = 256
table.LAEConfig.EEGauFilter1 integer EE pre filter1, extracts low-frequenc
table.LAEConfig.EEGauFilter2 integer EE pre filter2
table.LAEConfig.EEratio strength of enhancement, the bigger the
integer
stronger
table.LAEConfig.GEnable integer Brightening switch, default false
table.LAEConfig.GainLevel integer it is used to choose paramas, as an alternative
table.LAEConfig.DebugPin integer debug option

General APIs 60
4.5.28 Enable/Disable all privacy masking covers
Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=setPrivacyMaskingEnable
Method GET
Description Enable/Disable all privacy masking covers
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
channel int R video channel index which starts from 1
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
Response OK

4.5.29 Get enable/disable state of all privacy masking covers


DA
HU

Syntax http://<server>/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMaskingEnable
A_

Method GET
HT

Description Get enable/disable state of all privacy masking covers


TP

[ Request Params ] (key=value format at URL )


Name Type R/O Param Description
_A

channel int R video channel index which starts from 1


PI

[ Response Params ] (key=value format)


Name Type R/O Param Description
fo

Enable bool R true: Enable, false: Disable


r

[ Example ]
In

http://192.168.1.108/cgi-bin/PrivacyMasking.cgi?action=getPrivacyMaskingEnable&ch
Request
te

annel=2
Response Enable=false
lb
ra
s

4.6 System

4.6.1 General
 Get general config

Table 4-21

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=General
Method GET
Description Get general config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=General
Success table.General.LocalNo=8,

General APIs 61
Return table.General.MachineID=20832748927,
table.General.MachineName=Dahua001,
table.General.MachineAddress=滨江区.江南大道.伟业路口,
table.General.MachineGroup=交警一队,
table.General.LockLoginEnable=true,
table.General.CheckDuration=30,
table.General.LockLoginTimes=3,
table.General.LoginFailLockTime=1800,
table.General.MaxOnlineTime=1800,
table.General.LocalPolicy.LockLoginEnable=true,
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 —
 Set general config
DA
HU

Table 4-22
A_

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

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

Description Set general config.


_A

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&General.MachineNa
Example
PI

me=MyIPC
Success
OK
fo

Return
r

Comment —
In

Appendix:
te

ParamName ParamValue type Description


lb

General.MachineName string Device name or serial number.


ra

General.LocalNo integer Local number for remote controller


s

General.MachineAddress string Address machine places in


General.MachineGroup string Group machine belongs to

4.6.2 Get Current Time

Table 4-23

Syntax http://<server>/cgi-bin/global.cgi?action=getCurrentTime
Method GET
Description Get current time.
Example http://192.168.1.108/cgi-bin/global.cgi?action=getCurrentTime
Success
result = 2011-7-3 21:02:32
Return
Comment The time format is "Y-M-D H-m-S". It's not be effected by Locales. TimeFormat in

General APIs 62
SetLocalesConfig.

4.6.3 Set Current Time

Table 4-24

Syntax http://<server>/cgi-bin/global.cgi?action=setCurrentTime&time=2011-7-3%2021:02:32
Method GET
Description Set current time.
http://192.168.1.108/cgi-bin/global.cgi?action=setCurrentTime&time=2016-01-01%202
Example
1:02:32
Success
OK
Return
The time format is "Y-M-D H-m-S". It's not be effected by Locales. TimeFormat in
Comment
SetLocalesConfig.
DA

4.6.4 Locales
HU

Get locales config


A_


HT

Table 4-25
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Locales
_A

Method GET
PI

Description Get locales config


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

table.Locales.DSTEnable=false
r

table.Locales.DSTEnd.Day=1
In

table.Locales.DSTEnd.Hour=0
table.Locales.DSTEnd.Minute=0
te

table.Locales.DSTEnd.Month=1
lb

table.Locales.DSTEnd.Week=2
ra

Success table.Locales.DSTEnd.Year=2011
s

Return table.Locales.DSTStart.Day=0
table.Locales.DSTStart.Hour=0
table.Locales.DSTStart.Minute=0
table.Locales.DSTStart.Month=1
table.Locales.DSTStart.Week=1
table.Locales.DSTStart.Year=2011
table.Locales.TimeFormat=yyyy-MM-dd HH:mm:ss
Comment —
 Set locales config

Table 4-26

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

General APIs 63
Method GET
Description Set Locales config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Locales.DSTEnable
Example
=false
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


Locales.DSTEnable bool Enable/Disable DST (daylight saving time)
Range is [0—6] or [1—31]
[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.
DA

Locales.DSTEnd.Hour integer Range is [0—23]


HU

Locales.DSTEnd.Minute integer Range is [0—59]


A_

Locales.DSTEnd.Month integer Range is [1—12]


Range is {1, 2, 3, 4, -1, 0}.
HT

0 = Use month day


TP

Locales.DSTEnd.Week Integer [1, 2, 3, 4, -1]: use week day.


_A

1 = first week, 2 = second, 3 = third, 4 = fourth, -1 =


PI

last.
Locales.DSTEnd.Year Integer Range is [2000-2038]
fo

Locales.DSTStart.Day
Locales.DSTStart.Hour
r

Range is the same with items in Locales.DSTEnd.


Locales.DSTStart.Minute
In

Integer Locales.DSTStart table and Locales.DSTEnd table


Locales.DSTStart.Month
define the time range of DST.
te

Locales.DSTStart.Week
lb

Locales.DSTStart.Year
ra
s

General APIs 64
ParamName ParamValue type Description
Defines time format displayed in video time title.
String form is: year-month-day hour:mm:ss.
Position of year, month and day can be exchanged.

Range of year is {yy, yyyy}


yy = year without century, yyyy = year with century.
Range of month is {M, MM, MMMM}
M = 1 for January, MM = 01 for January, MMMM =
Jan for January
Locales.TimeFormat string Range of day is {d, dd}
d = 1 for first day, dd = 01 for first day
Range of hour is {H, HH, h, hh}
H = 1 for 1:00, HH = 01 for 1:00, range is 0-23
h = 1 for 1:00, hh = 01 for 1:00, time range is 1-12
DA

Example:
yyyy-MM-dd HH:mm:ss or
HU

MM-dd-yyyy HH:mm:ss or
A_

dd-M-yy hh:mm:ss
HT
TP

4.6.5 Get Language Capability


_A
PI

Table 4-27

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getLanguageCaps
fo

Method GET
r

Description Get the list of supported languages.


In

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getLanguageCaps
te

Success
Languages=SimpChinese,English,French
Return
lb

response is a string contains languages with comma separated.


ra

Comment Languages include { English, SimpChinese, TradChinese, Italian, Spanish, Japanese,


s

Russian, French, German }

4.6.6 Language
 Get language config

Table 4-28

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Language
Method GET
Description Get system language config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Language
Success
table.Language=SimpChinese
Return

General APIs 65
Comment —
 Set language config

Table 4-29

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set system language config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Language=SimpChi
Example
nese
Success
OK
Return
Comment NOTE: After changing language setting, system will automatically reboot!

Appendix:
DA

ParamName ParamValue type Description


The language range is get from interface in
HU

Language string
GetLanguageCaps
A_
HT

4.6.7 Get Client Access Filter


TP
_A

Table 4-30
PI

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

Description Get access filter config.


r

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

Success table.AccessFilter.Enable=false
Return table.AccessFilter.TrustList[0]=10.6.10.23
te

table.AccessFilter.TrustList[1]=10.6.10.62
lb

table.AccessFilter.Type=TrustList
ra

Comment Parameters in Response:


s

Type: Range is {TrustList, BannedList}. If Trustlist is supported, Bannedlist is not


supported.
More information in Appendix.

Appendix:

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.
BannedList: Banned list is used, trust
list is not used.

General APIs 66
4.6.8 Auto Maintain
 Get auto maintain config

Table 4-31

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AutoMaintain
Method GET
Description Get Auto Maintain config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AutoMaintain
table.AutoMaintain.AutoRebootDay=3
table.AutoMaintain.AutoRebootHour=0
table.AutoMaintain.AutoRebootMinute=0
table.AutoMaintain.AutoShutdownDay=1
Success
table.AutoMaintain.AutoShutdownHour=0
Return
table.AutoMaintain.AutoShutdownMinute=0
DA

table.AutoMaintain.AutoStartUpDay=1
HU

table.AutoMaintain.AutoStartUpHour=2
table.AutoMaintain.AutoStartUpMinute=0
A_

Comment —
HT

 Set auto maintain config


TP
_A

Table 4-32
PI

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

Method GET
r

Description Set auto maintain config.


In

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AutoMaintain.AutoR
Example
ebootDay=7
te

Success
lb

OK
Return
ra

Comment —
s

Appendix:

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].
AutoMaintain.AutoRebootHour integer
Auto restart hour
Range is [0—59].
AutoMaintain.AutoRebootMinute integer
Auto restart minute
AutoMaintain.AutoShutdownDay auto reboot time
integer
AutoMaintain.AutoShutdownHour Range is same with AutoOpenDay,

General APIs 67
ParamName ParamValue type Description
AutoMaintain.AutoShutdownMinute AutoOpenHour and AutoOpenMinute.
AutoMaintain.AutoStartUpDay Auto shutdown time.
AutoMaintain.AutoStartUpHour integer Range is same with AutoOpenDay,
AutoMaintain.AutoStartUpMinute AutoOpenHour, and AutoOpenMinute.

4.6.9 Holiday Management


 Get holiday config

Table 4-33

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Holiday
Method GET
Description Get holiday config for record or snap.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Holiday
DA

table.Holiday.MonthMask[0]=3
table.Holiday.MonthMask[1]=0
HU

table.Holiday.MonthMask[2]=0
A_

table.Holiday.MonthMask[3]=0
HT

table.Holiday.MonthMask[4]=0
Success table.Holiday.MonthMask[5]=0
TP

Return table.Holiday.MonthMask[6]=0
_A

table.Holiday.MonthMask[7]=0
PI

table.Holiday.MonthMask[8]=0
table.Holiday.MonthMask[9]=1610612739
fo

table.Holiday.MonthMask[10]=0
r

table.Holiday.MonthMask[11]=0
In

Comment —
 Set holiday config
te
lb

Table 4-34
ra

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

Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set holiday config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Holiday.MonthMask[
Example
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.

Appendix:

General APIs 68
ParamName ParamValue type Description
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
Holiday.MonthMask[monthIndex] integer
second day of a month is holiday, 0x0003
presents the first day and second day of a
month is holiday.

4.6.10 Get Device Type


Get the device type displayed (instead of the real type).
Request URL http://<server>/cgi-bin/magicBox.cgi?action=getDeviceType
Method GET
Request Params ( none )
Request Example
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getDeviceType
DA
HU

Response Params ( key=value format in body )


Name Type R/O Description Sample
A_

type string R The displayed device model DVR


HT

Response Example
TP

type=DVR
_A

4.6.11 Get Hardware Version


PI

Get the device hardware version information.


fo

Request URL http://<server>/cgi-bin/magicBox.cgi?action=getHardwareVersion


r

Method GET
In

Request Params ( none )


te

Request Example
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getHardwareVersion
lb
ra

Response Params ( key=value format in body )


s

Name Type R/O Description Sample


version string R The hardware version in the format of xx.xx. 1.00
Use two numbers to respectively represent the
main and sub versions.
If the beginning number of the main version is 0,
it should be omitted.
Response Example
version=1.00

4.6.12 Get Serial Number of Device


Get the serial number of the device.
Request URL http://<server>/cgi-bin/magicBox.cgi?action=getSerialNo
Method GET

General APIs 69
Request Params ( none )
Request Example
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSerialNo

Response Params ( key=value format in body )


Name Type R/O Description Sample
sn string R The device serial number YZC0GZ05100020
Response Example
sn=YZC0GZ05100020

4.6.13 Get Machine Name


Get the device machine name.
Request URL http://<server>/cgi-bin/magicBox.cgi?action=getMachineName
Method GET
Request Params ( none )
DA

Request Example
HU

http://192.168.1.108/cgi-bin/magicBox.cgi?action=getMachineName
A_

Response Params ( key=value format in body )


HT

Name Type R/O Description Sample


TP

name string O The device name my machine


_A

Response Example
name=my machine
PI

4.6.14 Get System Information1


fo
r

Get the system information of the device ( No longer maintained ).


In

Request URL http://<server>/cgi-bin/magicBox.cgi?action=getSystemInfo


te

Method GET
Request Params ( none )
lb

Request Example
ra

http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSystemInfo
s

Response Params ( key=value format in body )


Name Type R/O Description Sample
serialNumber string O Device serial number PA1FQ15900207
deviceType int O Device model 27
processor string O Processor model ST7108
Response Example
serialNumber=PA1FQ15900207
deviceType=27
processor=ST7108

4.6.15 Get System Information2


Get the system information of the device.

General APIs 70
Request URL http://<server>/cgi-bin/magicBox.cgi?action=getSystemInfoNew
Method GET
Request Params ( none )
Request Example
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSystemInfoNew

Response Params ( key=value format in body )


Name Type R/O Description Sample
info object O System information
+SyncTime object O For devices without RTC or when the
RTC of the device is out of battery, you
might also need to synchronize the time.
++Strategy enumchar[16] R Time synchronization strategy PerLogin
enumchar[16]{
“None”
“PerLogin”: Synchronizes the time each
DA

time you log in


HU

}
+2DCode char[32] O security code 123456
A_

0-9 and capitalized A–Z


HT

+TotalRunTime uint64 O The total running time of the device. 12456


TP

Unit: s
+cameraNum uint8 O The number of cameras 1
_A

+cardReader bool O Whether card swiping is supported: true


PI

true: supported
false: not supported
fo

+flashID uint8[8] O flash ID [200,209,128,149,


r

64,127,127,200]
In

+hasRTC bool O Whether the RTC chip is included (for true


te

recording the system time).


If the filed does not exist, the value is
lb

true and the RTC is included by default.


ra

RTC included: true


s

No RTC: false
Response Example
info.SyncTime.Strategy=“PerLogin”,
info.2DCode=“123456”,
info.TotalRunTime=123456
info.cameraNum=0
info.cardReader=false
info.flashID[0]=200
info.flashID[1]=209
info.flashID[2]=128
info.flashID[3]=149
info.flashID[4]=64
info.flashID[5]=127
info.flashID[6]=127

General APIs 71
info.flashID[7]=200
info.hasRTC=true

4.6.16 Get Vendor Information

Table 4-35

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getVendor
Method GET
Description Get the vendor information.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getVendor
Success
vendor=TTT
Return
Comment —
DA

4.6.17 Get Software Information


HU
A_

Table 4-36
HT

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getSoftwareVersion
TP

Method GET
_A

Description Get the software information.


Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getSoftwareVersion
PI

Success
version=2.212.0000.0.R,build:2013-11-14
fo

Return
Comment —
r
In

4.6.18 Get Version of Onvif


te
lb

Table 4-37
ra

Syntax http://<server>/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=Onvif
s

Method GET
Description Get onvif version.
Example http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=Onvif
Success
version=2.4.2
Return
Comment —

4.6.19 Get Version of HTTP API

Table 4-38

Syntax http://<server>/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
Method GET

General APIs 72
Description Get CGI version.
Example http://192.168.1.108/cgi-bin/IntervideoManager.cgi?action=getVersion&Name=CGI
Success
version=2.0.0
Return
Comment —

4.6.20 Get Device Class


Get the class information of the device.
Request URL http://<server>/cgi-bin/magicBox.cgi?action=getDeviceClass
Method GET
Request Params ( none )
Request Example
http://192.168.1.108/cgi-bin/magicBox.cgi?action=getDeviceClass

Response Params ( key=value format in body )


DA

Name Type R/O Description Sample


HU

class string R The class information of the device. HDVR


Response Example
A_

class=HDVR
HT
TP

4.6.21 Reboot
_A
PI

Table 4-39

Syntax http://<server>/cgi-bin/magicBox.cgi?action=reboot[&delay=<paramValue>]
fo

Method GET
r

Description Reboot the device.


In

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=reboot
te

Success
OK
lb

Return
Comment If successful, response OK. If fail, response Error.
ra
s

4.6.22 Shutdown

Table 4-40

Syntax http://<server>/cgi-bin/magicBox.cgi?action=shutdown
Method GET
Description Shutdown the device.
Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=shutdown
Success
OK
Return
Comment If successful, response OK. If fail, response Error.

General APIs 73
4.6.23 FactoryReset

Table 4-41

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:
Type: integer, it can be 0 or1.
0 means all parameters are set to their factory default value;
1 means all parameters are set to their factory default value expect the specific
Comment parameters;
The specific parameters of different device types are different. But it always contains the
DA

network settings and user settings. After resetting, the device is reachable on the same
HU

ip address as used before the reset.


A_

When the Type parameter is not present in the URL, the default value of the Type is 0.
HT

4.6.24 Get Tracing Code of Device


TP
_A

Table 4-42
PI

Syntax http://<server>/cgi-bin/magicBox.cgi?action=getTracingCode
fo

Method GET
r

Description Get the tracing code of the device.


In

Example http://192.168.1.108/cgi-bin/magicBox.cgi?action=getTracingCode
Success
te

tc=0001...1101
Return
lb

Only system default admin can get it.


Comment
ra

tc is a 64bit binary string.


s

4.6.25 Add Camera to Specified Channel


Request URL http://<server>/cgi-bin/LogicDeviceManager.cgi?action=addCameraByGroup
Method POST
Request Params ( Json format in body )
Parameter Type Required Description Example
Add device groups in
batches
+group object[] Yes It is an array with the same
elements as
addCameraByDevice.
++DeviceInfo object Yes Device details
+++RtspPort int No RTSP port: Required when 554

General APIs 74
ProtocolType is not
Private, 554 by default.
HTTP port: Required when
+++HttpPort int No ProtocolType is not 80
Private, 80 by default.
TCP port: Required when
+++Port int No ProtocolType is Private, 37777
37777 by default.
+++UserName char[32] Yes Username admin
+++Password char[32] Yes Password, plain text admin123
Protocol Type
+++ProtocolTy char[12 "Private","Dahua2","Dahua
Yes "Private"
pe 8] 3","General","Onvif","GB28
181","Ehome"
+++Address char[16] Yes Device address 172.11.1.161
++cameras object[] Yes Video source information
DA

+++uniqueCha Unique channel number,


int Yes 1
HU

nnel starting from 1


Example
A_

POST http://192.168.1.108/cgi-bin/LogicDeviceManager.cgi?action=addCameraByGroup
HT

{
TP

"group":[{
_A

"DeviceInfo":{
"UserName":"admin",
PI

"Password":"admin123",
fo

"ProtocolType":"Private",
"Port":37777,
r

"Address":"172.11.1.161"
In

},
te

"cameras":[{
lb

"uniqueChannel":1
}]
ra

}]
s

Response Params ( OK in body )


Name Type R/O Description Example
Response Example
OK

4.6.26 Acquiring All Available Resources


Customer requests to obtain camera information, such as MAC address and SN, through CGI
commands.

General APIs 75
Request URL http://<server>/cgi-bin/api/LogicDeviceManager/getCameraAll
Method GET
Request Params ( JSON format in body )
Name Type R/O Description Example
Request Example
{}

Response Params ( JSON format in body )


Name Type R/O Description Example
camera object[] R
+ControlID char[128] O Control number. "5001"
Keyboard users can use the
number to locate channels
to improve operation
efficiency.
Control number “0” is not
DA

available, which is reserved


HU

for special use.


A_

+Name char[128] O Name “Hangzhou”


+Enable bool O Enable only when using true
HT

DeviceID to add/delete
TP

devices. Do not enable it


_A

through DeviceInfo.
PI

true: Meaning trying to


connect the device, but not
fo

necessarily successful. You


can acquire the connection
r

status through
In

getCameraState.
te

false: Do not connect the


lb

device. From user's point of


view, it is the same as that
ra

the device is not added.


s

This Enable field is only


used for the case of adding
a device through DeviceID.
We keep this field for
compatibility and
recommend using the
Enable in DeviceInfo.
When acquiring the field,
this Enable and the Enable
in DeviceInfo are returned at
the same time.
When sending the field, you
can only select one between
this Enable and the Enable

General APIs 76
in DeviceInfo. We
recommend sending the
Enable in DeviceInfo.
+DeviceInfo DeviceInfo O Device details.
Use the Enable in the
structure to add/delete
devices.
True: Add devices.
False: delete devices from
the channel.
A device can be added only
when "DeviceID" is " " and
Info is not NULL.
++Enable bool O The device is enabled or true
not.
++EncryptStrea int O Device stream encryption 0
DA

m algorithm (custom field for


HU

NVR).
(If other encryption
A_

algorithms are used, refer to


HT

the encryption type


TP

definition in Dahua code


_A

stream format 0x95).


0: No encryption by default.
PI

7: Tianjin HUISUN
encryption algorithm.
fo

++Address char[16] O Device IP address or "10.6.5.10"


r

domain name.
In

++Port int O Port number. 37777


te

++usePreSecret enumint8 O Select whether to use NVR 1


preset password to add
lb

cameras (the naming


ra

remains the same globally,


s

so the case is not uniform


here).
enumint8{
0: Use
UserName/Password to
connect devices (default).
1: When using a preset
password to connect
devices,
UserName/Password is not
required.
2: When using camera login
password to connect
devices,

General APIs 77
UserName/Password is not
required.
}
++UserName char[32] O Username "admin"
++Password char[32] O Password in plain text. "admin"
++ProtocolType enumchar[32 O The protocol type of the "Private"
] connected device. For the
value range, see the
ProtocolType field of the
RemoteDevice
configuration.
enumchar[32]{
"Private"
"Dahua2"
"Dahua3"
"General"
DA

"Onvif"
HU

"GB28181"
"Ehome"
A_

“ICC”: The special protocol


HT

for the central Intelligence


TP

platform. It has not been


_A

reviewed, therefore it is not


allowed to add the protocol
PI

type in this way in the future.


"DahuaDSS": The special
fo

protocol for the central


r

Intelligence platform. It has


In

not been reviewed,


te

therefore it is not allowed to


add the protocol type in this
lb

way in the future.


ra

}
s

++VideoInput++ uint O Total number of video input 16


Channels channels, including analog
and digital channels

++AudioInput++ uint O Total number of audio input 4


Channels channels
++DeviceClass char[64] O Device type "IPC"
++DeviceType char[64] O Device model "IPC-HF3300"
++HttpPort int O HTTP port number 80
++HttpsPort int O HTTPS port number 443
(customized for BOSCH)
++RtspPort int O RTSP port number 554
++Name char[64] O Device name "IPC1"
++MachineAddre char[256] O Device deployment location “Intersection of Weiye Road,

General APIs 78
ss Jiangnan Avenue, Binjiang
District”
++SerialNo char[48] O Device serial number "DH12345678910"
++VendorAbbr char[32] O Vendor abbreviation "GY"
(optional)
Vendor type: Dahua (for
example).
++HardID char[64] O Hardware ID (optional) "454"
Customer’s requirements
without indicating the
specific hardware type
++SoftwareVersi char[64] O Software version (optional) "2.420.0000006.0.R.150311
on "
++ActivationTime char[24] O The date when starting "2000-01-01 00:00:00"
using the device.
Date format: "yyyy-MM-dd
DA

HH:mm:ss”
HU

“Year–Month–Day Hour:
Minute: Second"
A_

Range {"2000-01-01
HT

00:00:00", /*Minimum date*/


TP

"2099-01-01
_A

00:00:00",/*Maximum
date*/}
PI

++NodeType char[32] O Device node type (main or


sub node). It is used when
fo

adding storage node


r

(DataNodeManager.addDat
In

aNode) in N + M cluster
te

mode.
++Mac char[] O MAC address "08:00:20:0A:8C:6D"
lb

++OEMVendor char[] O OEM vendor type. "SONY"


ra

During cloud update, for


s

some vendors, the Vendor


field is displayed as OEM,
and OEMVendor is added to
indicate the actual vendor
information. OEMVendor is
the same as Vendor by
default. If OEMVendor is
defined in the product
definition, refer to the the
product definition.
+DeviceID char[128] O Device ID "dev123"
When DeviceID is not " ",
ignore DeviceInfo and use
the existing DeviceID

General APIs 79
information in the
RemoteDevice
configuration.
+Type enumchar[32 O Input channel type. "Remote"
] enumchar[32]{
"Local": Local channel
(physical channel).
"Remote": Remote channel.
"Reserved32": Reserve 32
channels (compatible with
the device protocol of the
second generation).
"Output": Output channel.
"Matrix”: Analog matrix
channel.
"Compose": Composite
DA

channel.
"Cascade": Optical fiber
HU

cascading channel.
A_

}
HT

+VideoStream enumchar[32 O Video stream. "Main"


TP

] enumchar[32]{
"Main": Main stream
_A

"Extra1": Sub stream 1


PI

"Extra2": Sub stream 2


"Extra3": Sub stream 3
fo

"Auto": Automatically
r

selects the appropriate


In

stream.
te

"Preview": Preview raw data


stream.
lb

"None": No video stream


ra

(pure audio stream).


s

}
+Channel uint O Channel number of the 0
remote device (optional).
DeviceID is unique.
+UniqueChannel int O Unique channel number of 0
uniform device number
(required).
You can obtain video/audio
streams by specifying the
channel number with
0x11/0xF4
second-generation protocol.
Notes: When implementing
any addressing function of

General APIs 80
DeviceID+Channel,
LogicDeviceManager.getCa
meraAll() must be
implemented, and the
device must support
“DeviceID=Unique” unified
numbering method for input
channels For details, see
explanation on "Unique"
unified channel numbering
of Dahua Information
Exchange Format.
For setCamera(),
uniqueChannel-1 means
that the device
automatically assigns a
DA

channel number.
+DataNodeId int O Indicates the data node to 1
HU

which the global channel is


A_

currently allocated (N+0


HT

cluster).
TP

Counted from 0. If it is -1 or
when the field does not
_A

exist, it means that it is not


PI

allocated currently.
+DataNodeChan int O Indicates the local channel 2
fo

nel of data node to which the


r

global channel is currently


In

allocated (N+0 cluster).


te

Counted from 0. If it is -1 or
when the field does not
lb

exist, it means that it is not


ra

currently allocated.
s

+AutoReset bool O Auto reset. false


Compatible process:
If this parameter is not
configured, the default value
is false and the channel
cannot be reset
automatically.
when there is no client to
access the video stream
(streaming client access
count changes from
non-zero to zero), if
AutoReset=true, the device
will actively enable the

General APIs 81
channel to be idle (that is,
the video source attribute
Enable=false ).
+VideoStandard enumchar[32 O Current video standard "PAL"
] enumchar[32]{
"PAL"
"NTSC"
"SECAM"
}
+Label enumchar[32 O Device label "Indoor"
] enumchar[32]{
"Indoor": Indoor
"Outdoor": Outdoor
}
+ImageInfo object O Device snapshot
When adding a device, take
DA

a snapshot and save it to


HU

local computer.
++FilePath char[256] R Image path "/var/local/ch1.jpg"
A_

+PasswordGenT enumchar[32 O Password generation "UserInput"


HT

ype ] method
TP

enumchar[32]{
_A

"UserInput": Entered by
users.
PI

"Auto": Automatically
generated.
fo

}
r

Response Example
In

{
te

"camera":[{
"ControlID": "5001",
lb

"Name": "杭州",
ra

"Enable": true,
s

"DeviceInfo":{
"Enable": true,
"EncryptStream": 0,
"Address": "10.6.5.10",
"Port": 37777,
"usePreSecret": 1,
"UserName": "admin",
"Password": "admin",
"ProtocolType": "Private",
"VideoInputChannels": 16,
"AudioInputChannels": 4,
"DeviceClass": "IPC",
"DeviceType": "IPC-HF3300",
"HttpPort": 80,

General APIs 82
"HttpsPort": 443,
"RtspPort": 554,
"Name": "IPC1",
"MachineAddress": “Intersection of Weiye Road, Jiangnan Avenue, Binjiang District”
"SerialNo": "DH12345678910",
"VendorAbbr": "GY",
"HardID": "454",
"SoftwareVersion": "2.420.0000006.0.R.150311",
"ActivationTime": "2000-01-01 00:00:00",
"NodeType": ",
"Mac": "08:00:20:0A:8C:6D",
"OEMVendor": "SONY"
}
"DeviceID": "dev123",
"Type": "Remote",
"VideoStream": "Main",
DA

"Channel": 0,
"UniqueChannel": 0,
HU

"DataNodeId": 1,
A_

"DataNodeChannel": 2,
HT

"AutoReset": false,
TP

"VideoStandard": "PAL",
"Label": "Indoor",
_A

"ImageInfo": {
PI

"FilePath": "/var/local/ch1.jpg"
},
fo

"PasswordGenType": "UserInput"
r

},…{}]
In

}
te
lb
ra

4.6.27 Subscribing for Device Online/Offline Status


s

Subscribe to the online and offline status of the device.


Request URL http://<server>/cgi-bin/api/LogicDeviceManager/attachCameraState
Method POST
Request Params (JSON format in body)
Name Type R/O Description Example
channel int[] R Observed unique channel number. [1, 2]
"-1" means all unique channels. If
one of the array elements is "-1", it
will observe all channels.
Request Example
{
“type”: [1, 2]
}

General APIs 83
Response Params (multipart in body)
Name Type R/O Description Example
state object R The new status of the camera
+channel int32 R Unique channel number (the 1
channel number with changed
status)
+connectionState enumchar[12] R Connection status “Connected”
enumchar[12]{
"Connecting"
"Connected"
"Unconnect": Not connected
"Empty": The channel is not
configured and there is no
information.
"Disable": The channel is
DA

configured but disabled (the


HU

protocol cannot be reflected,


and delete it first).
A_

"Changed": The information of


HT

the device connected to the


TP

channel is changed.
_A

"Hibernation"
}
PI

Response Example
HTTP/1.1 200 OK
fo

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


r

Connection: close
In
te

--<boundary>
Content-Type: application/json
lb

Content-Length: <data length>


ra
s

{
"channel" : 1,
"connectionState" : "Connected"
}
--<boundary>
Content-Type: text/plain
Content-Length: 11

Heartbeat
--<boundary>

General APIs 84
4.7 User management

4.7.1 Get Information of a Particular User

Table 4-43

Syntax http://<server>/cgi-bin/userManager.cgi?action=getUserInfo&name=<userName>
Method GET
Description Get user information with name userName.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getUserInfo&name=admin
user.Name=admin
user.Memo=admin 's account
user.Group=admin
Success
user.Reserved=true
Return
user.Sharable=true
DA

user.PwdValidPeriod=30
HU

user. AuthList=<authList>
Comment —
A_
HT

4.7.2 Get Information of All Users


TP
_A

Table 4-44
PI

Syntax http://<server>/cgi-bin/userManager.cgi?action=getUserInfoAll
fo

Method GET
Description Get information of all users.
r

Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getUserInfoAll
In

users[0].Group=admin
te

users[0].Id=1
lb

users[0].Memo=admin 's account


users[0].Name=admin
ra

Success users[0].Reserved=true
s

Return users[0].Sharable=true
users[0].PwdValidPeriod=30
users[0]. AuthList=<authList>
users[1].Group=admin

Comment —

4.7.3 Get Information of All Active Users

Table 4-45

Syntax http://<server>/cgi-bin/userManager.cgi?action=getActiveUserInfoAll
Method GET
Description Get active users.

General APIs 85
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getActiveUserInfoAll
users[0].name=admin
users[0].ip=10.43.2.16
Success
users[0].group=admin
Return
users[0].clienttype=web3.0
users[0].logintime=2011-11-08 09:51:03
Comment —

4.7.4 Get Information of a Particular Group

Table 4-46

Syntax http://<server>/cgi-bin/userManager.cgi?action=getGroupInfo&name=<groupName>
Method GET
Description Get group setting with name groupName.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getGroupInfo&name=admin
DA

group.Name=admin
Success
HU

group.Memo=administrator group
Return
group.AuthorityList=<authList>
A_

Parameters in URL:
HT

The device has one or two default user groups: "admin"or "admin"and "user". The
TP

"admin"group has all the authorities of operating the device. The "user"group only has
Comment
_A

monitoring and replaying authorities.


groupName: name of the group.
PI

If the group named groupName does not exist, the device returns Error.
fo

4.7.5 Get Information of All Groups


r
In

Table 4-47
te
lb

Syntax http://<server>/cgi-bin/userManager.cgi?action=getGroupInfoAll
Method GET
ra

Description Get information of all groups.


s

Example http://192.168.1.108/cgi-bin/userManager.cgi?action=getGroupInfoAll
group[0].Id=1
group[0].Name=admin
group[0].Memo=administrator group
group[0].AuthorityList=<authList>
group[0].AuthorityDetail.Bypass[0]=1
group[0].AuthorityDetail.Bypass[1]=2
Success
group[0].AuthorityDetail.Bypass[2]=3
Return

group[0].AuthorityDetail.AccessControl[0]=1
group[0].AuthorityDetail.AccessControl[1]=3
group[0].AuthorityDetail.AccessControl[2]=5

group[1].Id=1

General APIs 86
group[1].Name=user
group[1].Memo=user group
group[1].AuthorityList=<authList>
group[1]….

Comment —

4.7.6 Add a New User


Access Control products are not supported.

Table 4-48

http://<server>/cgi-bin/userManager.cgi?action=addUser&user.Name=<userName>&u
Syntax ser.Password=<userPassword>&user.Group=<userGroup>&user.Sharable=<userSh
DA

arable>[&user.Memo=<userMemo>&user.Reserved=<userReserved>]
Method GET
HU

Description Add a user.


A_

http://192.168.1.108/cgi-bin/userManager.cgi?action=addUser&user.Name=George&us
Example
HT

er.Password=123456&user.Group=user&user.Sharable=true&user.Reserved=false
TP

Success
OK
Return
_A

Parameters in URL:
PI

userGroup: string, the range is "admin"and "user". In different group, the user has
Comment different authorities.
fo

userSharable: bool, true means allow multi-point login.


r

userReserved: bool, true means this user can't be deleted.


In

4.7.7 Delete a User


te
lb

Access Control products are not supported.


ra
s

Table 4-49

Syntax http://<server>/cgi-bin/userManager.cgi?action=deleteUser&name=<userName>
Method GET
Description Delete user with name username.
Example http://192.168.1.108/cgi-bin/userManager.cgi?action=deleteUser&name=George
Success
OK
Return
Comment —

4.7.8 Modify User Information


Access Control products are not supported.

General APIs 87
Table 4-50

http://<server>/cgi-bin/userManager.cgi?action=modifyUser&name=<UserName>&user
Syntax .Memo=<userMemo>&user.Group=<userGroup>&user.Reserved=<userReserved>&us
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
Comment User is identified by <UserName>, other params are the same with AddUser.

4.7.9 Modify User's Password


DA

Access Control products are not supported.


HU
A_
HT

Table 4-51
TP

http://<server>/cgi-bin/userManager.cgi?action=modifyPassword&name=<username>
Syntax
_A

&pwd=<newPwd>&pwdOld=<oldPwd>
PI

Method GET
Description Modify user password.
fo

http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyPassword&name=George
Example
&pwd=abcdef&pwdOld=123456
r

Success
In

OK
Return
te

Comment Old password oldPwd should be supplied, new password is newPwd.


lb

4.7.10 Manager Modify Common User's Password


ra
s

Access Control products are not supported.

Table 4-52

http://<server>/cgi-bin/userManager.cgi?action=modifyPasswordByManager&userNam
Syntax e=<username>&pwd=<newPwd>&managerName=<managerName>&managerPwd=
<managerPwd>&accountType=<accountType>
Method GET
Description Manager Modify common user's password.
http://192.168.1.108/cgi-bin/userManager.cgi?action=modifyPasswordByManager&use
Example rName=Geoge&pwd=123456&managerName=admin&managerPwd=abc123&account
Type=0
Success OK

General APIs 88
Return
the name of common user to be modified is username
new password is newPwd
Comment manager name is only admin
manager password is managerPwd, that is password of admin
accountType support 0 is Dahua account, 1 is Onvif account

4.7.11 [Config] Set User Login Authentication Policy

Table 4-53

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set User Login Authenticate Policy
DA

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LoginAuthCtrl.PriSvr
Example
HU

Policy=2
Success
A_

OK
Return
HT

LoginAuthCtrl.PriSvrPolicy : DVRIP login policy setting for Dahua Private Protocol.


TP

Comment 1 - safe mode, only support digest authentication. (Recommended.);


_A

2 - compatible mode for traditional devices;


PI

4.8 Network
fo
r

4.8.1 Get Network Interfaces


In
te

Table 4-54
lb
ra

Syntax http://<server>/cgi-bin/netApp.cgi?action=getInterfaces
s

Method GET
Description Get all of the system network interfaces.
Example http://192.168.1.108/cgi-bin/netApp.cgi?action=getInterfaces
netInterface[0].Name=eth0
netInterface[0].Type=Normal
netInterface[0].Valid=true
Success …
Return netInterface[1].Name=3g
netInterface[1].Type=Auto,WCDMA,TD-SCDMA,TD-LTE,FDD-LTE
netInterface[1].Valid=true

result item value:
Comment Name: network interface name.
"eth0" - wired network interface

General APIs 89
"eth2" - wireless network interface
"3G" - 3G network interface
"bond0" - bond network interface
"bond1" - bond network interface
Not listed in detail

Type: Network types that support settings


"Normal" — wired network
"Wireless" — wireless network
"Auto", "TD-SCDMA", "WCDMA", "CDMA1x", "EDGE", "EVDO", "TD-LTE", "FDD-LTE",
"NR" — 3G network types.

Valid: network interface is valid if netInterface[n].Valid is true.

4.8.2 Network Basic Config


DA

 Get network config


HU

Table 4-55
A_

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Network
HT

Method GET
TP

Get network basic config. The basic config contains basic network parameters (default
_A

Description
interface, domain name, host name), and configuration of each network interface.
PI

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Network
table.Network.DefaultInterface=eth0
fo

table.Network.Domain=ttt
r

table.Network.Hostname=badak
table.Network.interface.DefaultGateway=10.7.0.1
In

table.Network.interface.DhcpEnable=false
te

Success
table.Network.interface.DnsServers[0]=221.123.33.228
Return
lb

table.Network.interface.DnsServers[1]=221.12.1.228
ra

table.Network.interface.IPAddress=10.7.2.3
table.Network.interface.MTU=1500
s

table.Network.interface.PhysicalAddress=00:10:5c:f2:1c:b4
table.Network.interface.SubnetMask=255.255.0.0
Comment interface in response is network interface name, such as eth0, eth2…
 Set network config

Table 4-56

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
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 90
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.
Network.DefaultInterface string
Range of interfaces is depends on
GetInterfaces.
Network.Domain string Domain name.
Hostname and Domain compose a
Network.Hostname string
network address.
Network.interface.DefaultGateway string IP address.
Network.interface.DhcpEnable bool Enable/Disable DHCP.
Network.interface.DnsServers[0] string IP address of first DNS server.
Network.interface.DnsServers[1] string IP address of second DNS server.
DA

Network.interface.IPAddress string Interface IP address.


HU

Network.interface.MTU integer Interface MTU.


A_

MAC address of interface.


HEX string in the form of:
HT

xx:xx:xx:xx:xx:xx.
TP

Network.interface.PhysicalAddress string Range of x is [0-9, a-f, A-F]


_A

Example:
PI

00:10:5c:f2:1c:b4
00:10:5C:F2:1C:B5
fo

Network mask string:


In the form of x.x.x.x, range of x is [0-255]
r

Network.interface.SubnetMask string
Example:
In

255.255.255.0
te

Enable/Disable
Network.interface.EnableDhcpReserv
lb

bool when dhcp failed, it will continue sending


edIP
dhcp request, if it was enabled.
ra
s

4.8.3 PPPoE
 Get PPPoE config

Table 4-57

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PPPoE
Method GET
Description Get PPPoE config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PPPoE
table.PPPoE.Enable=true,
Success table.PPPoE.AuthType[0]=PAP,
Return table.PPPoE.UserName=hz150260,
table.PPPoE.Password=Dont Know,

General APIs 91
table.PPPoE.Mode=Default,
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,
table.PPPoE.PPPOE1.Eth=eth1
Comment —

 Set PPPoE config

Table 4-58

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

Method GET
HU

Description Set PPPoE config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PPPoE.UserName=
A_

Example
user1&PPPoE.Password=123456
HT

Success
OK
TP

Return
_A

Comment —
PI

Appendix:
fo

ParamName ParamValue type Description


PPPoE.Enable bool Enable/Disable PPPoE.
r

PPPoE.UserName string PPPoE user name.


In

PPPoE.Password string PPPoE user password.


te

4.8.4 DDNS
lb
ra

 Get DDNS config


s

Table 4-59

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=DDNS
Method GET
Description Get DDNS config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=DDNS
Success table.DDNS[index].Address=www.ttt.com
Return table.DDNS[index].Enable=true
table.DDNS[index].HostName=www.ttt.com
table.DDNS[index].KeepAlive=10
table.DDNS[index].Password=none
table.DDNS[index].Port=5050
table.DDNS[index].Protocol= Quick DDNS

General APIs 92
table.DDNS[index].UserName=user1
table.DDNS[index].DefaultHostName.Enable=false
table.DDNS[index].DefaultHostName.HostName=9002A9D77133.quickddns.com
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-60

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set DDNS config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&DDNS[0].Address=w
ww.ttt.com&DDNS[0].Enable=true
Success OK
Return
DA

Comment index in below ParamName is the DDNS protocol table index, start from 0.
HU

Appendix:
A_
HT

ParamName ParamValue type Description


TP

DDNS[index].Address string DDNS server IP address or name.


Multiple DDNS hostname can be configured,
_A

DDNS[index].Enable bool but Only one hostname can be enabled,


PI

others should not be enabled.


DDNS[index].HostName String Hostname of this device.
fo

Range is [1—65535].
DDNS[index].KeepAlive integer
r

Unit is minutes.
In

DDNS[index].Password string DDNS user password


Range is [1—65535].
te

DDNS[index].Port integer
Port of DDNS server
lb
ra
s

General APIs 93
ParamName ParamValue type Description
DDNS protocol type.
Range is {
"PRIVATE DDNS": 大华一代
"Private DDNS": 大华二代(使用 quickddns 域
名)
"CN99 DDNS"
"NO-IP DDNS"
"Dyndns DDNS"
"LUPUS DDNS"
"Oray DDNS"
"CP Plus DDNS"
"Ipplus DDNS"
"Q-See DDNS"
"SYSDNS DDNS"
"Videotrend DDNS"
DA

"CEPSA DDNS"
"G4IP DDNS"
HU

"HOSS DDNS"
A_

DDNS[index].Protocol string
"Intelbras DDNS"
HT

"HSY DDNS"
TP

"Flir DDNS"
"Private P2P DDNS": 大华 P2P 设备注册
_A

"Mivigilante DDNS": 西班牙 DDNS


PI

"ByDemes DDNS"
"DYNDNS OLD DDNS": 针对存储 dyndns 协
fo


r

"WATASHI DDNS"
In

"CNB DDNS": 韩国 CNB DDNS


"Peoplefu DDNS": 泰国 PeopleFu DDNS
te

"MINT DDNS"
lb

"SPECO DDNS"
ra

"SHANY DDNS"
s

"WITHCCTV DDNS": "AMCREST DDNS"


"SONIC DDNS": 印度松下 DDNS
"KBVISION DDNS": 越南 kbvision
"BOSCH DDNS": 博世 DDNS}.
DDNS[index].UserName string DDNS user name
Only protocol is in range {"Private DDNS",
DDNS[index].DefaultHostName "DHDDNS", "QUICK DDNS"}, it effects.
bool
.Enable true : use the DefaultHostName.HostName
false: use the HostName
DDNS[index].DefaultHostName
string The default hostname. It cannot be modified.
.HostName

General APIs 94
4.8.5 Email
 Get email config

Table 4-61

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Email
Method GET
Description Get Email config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Email
table.Email.Address=www.ttt.com
table.Email.Anonymous=true
table.Email.AttachEnable=true
table.Email.Enable=true
table.Email.HealthReport.Enable=false
table.Email.HealthReport.Interval=61
DA

table.Email.Password=123456
HU

table.Email.Port=26
table.Email.Receivers[0][email protected]
A_

Success
table.Email.Receivers[1][email protected]
HT

Return
table.Email.Receivers[2][email protected]
TP

[email protected]
_A

table.Email.SslEnable=false
table.Email.TlsEnable=false
PI

table.Email.Authentication=false
table.Email.OnlyAttachment=false
fo

table.Email.SendInterv=10
r

table.Email.Title=DVRMessage
In

table.Email.UserName=anonymity
te

Comment —
Set email config
lb


ra

Table 4-62
s

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set Email config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Email.Address=mail.
Example
ttt.com&Email.Anonymous=false
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


Email.Address string SMTP server IP address or name.

General APIs 95
ParamName ParamValue type Description
Email.Anonymous bool Enable/Disable anonymous email.
Email.AttachEnable bool Enable/Disable email attachment
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.
Email.Port integer Range is [1-65535]
Email.Receivers[0] string
Email.Receivers[1] string Email addresses of 3 receivers.
Email.Receivers[2] string
Email.SendAddress string Sender email address.
Email.SslEnable bool True: enable SSL email.
Email.Title string Title of email.
DA

Email.UserName string User name of email account.


HU
A_

4.8.6 WLan
HT

 Get WLan config


TP
_A

Table 4-63
PI

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

Description Get Wlan config.


r

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

table.WLan.eth2.Enable=true
te

table.WLan.eth2.Encryption=off
table.WLan.eth2.KeyFlag=false
lb

table.WLan.eth2.KeyID=0
ra

table.WLan.eth2.KeyType=Hex
Success
s

table.WLan.eth2.Keys[0]=password1
Return
table.WLan.eth2.Keys[1]=password2
table.WLan.eth2.Keys[2]=password3
table.WLan.eth2.Keys[3]=password4
table.WLan.eth2.LinkMode=Auto
table.WLan.eth2.SSID=ttt
Comment —
 Set WLan config

Table 4-64

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

General APIs 96
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
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,
WLan.interface.Encryption string WPA-PSK-TKIP, WPA-PSK-CCMP}
Encryption mode.
WLan.interface.KeyFlag bool true: key is configured.
Range is [0—3]
WLan.interface.KeyID integer Indicates which key is used.
DA

0: WLan.interface.Keys[0] is used.
HU

WLan.interface.KeyType string Range is {Hex, ASCII]


A_

WLan.interface.Keys[0] string For ASCII key type: 64bits encryption key length is 5,
WLan.interface.Keys[1] string 128bits encryption key length is 13, consists of [0—9,
HT

WLan.interface.Keys[2] string a—z, A—Z]


TP

For HEX key type: 64bits encryption key length is 10,


_A

WLan.interface.Keys[3] string 128bits encryption key length is 26, consists of [0—9,


PI

a—z, A—Z]
Range is {Auto, Ad-hoc, and Infrastructure}.
fo

Auto – select suitable mode automatically.


Ad-hoc – Device with wireless network adapter can
r

WLan.interface.LinkMode string connect to each other without Access Point.


In

Infrastructure – Integrate wire and wireless LAN


te

together to share network resource, access point is


lb

need in this mode.


WLan.interface.SSID string SSID.
ra
s

4.8.7 Scan Wlan Devices

Table 4-65

http://<server>/cgi-bin/wlan.cgi?action=scanWlanDevices&<paramName>=<paramVal
Syntax
ue>[&<paramName>=<paramValue>…]
Method GET
Description Search Wi-Fi device information.
http://192.168.1.108/cgi-bin/wlan.cgi?action=scanWlanDevices&SSID=xia_yuguo
Example
13098 Internet
found=1
Success
wlanDevice[0].ApConnected=0
Return
wlanDevice[0].ApMaxBitRate=54000000

General APIs 97
wlanDevice[0].ApNetWorkType=255
wlanDevice[0].AuthMode=7
wlanDevice[0].BSSID=28:2c:b2:5c:de:36
wlanDevice[0].EncrAlgr=3
wlanDevice[0].LinkMode=0
wlanDevice[0].LinkQuality=31
wlanDevice[0].RSSIQuality=0
wlanDevice[0].SSID=xia_yuguo 13098 Internet
Comment —

Appendix:

ParamName ParamValue type Description


Specified SSID, if not include any SSID, all Wi-Fi information
SSID string
will be searched and displayed.

4.8.8 UPnP
DA
HU

 Get UPnP config


A_

Table 4-66
HT

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=UPnP
TP

Method GET
_A

Description Get UPnP config.


PI

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=UPnP
Success table.UPnP.Enable=true
fo

Return table.UPnP.MapTable[index].Enable=true
r

table.UPnP.MapTable[index].InnerPort=80
In

table.UPnP.MapTable[index].OuterPort=8080
table.UPnP.MapTable[index].Protocol=TCP
te

table.UPnP.MapTable[index].ServiceName=HTTP
lb

Comment index in response is the UPNP map table index, start from 0.
ra

 Set UPnP config


s

Table 4-67

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set UPnP config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UPnP.Enable=true&
UPnP.MapTable[0].Protocol=TCP
Success OK
Return
Comment index in below ParamName is UPNP map table index, range is [0-255]

Appendix:

General APIs 98
ParamName ParamValue type Description
UPnP.Enable bool Enable/Disable UPNP feature.
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.
UPnP.MapTable[index].Protocol string Range is {TCP, UDP]
UPnP.MapTable[index].ServiceName string User defined UPnP service name.

4.8.9 Get UPnP Status

Table 4-68

Syntax http://<server>/cgi-bin/netApp.cgi?action=getUPnPStatus
Method GET
DA

Description Get UPnP Status.


HU

Example http://192.168.1.108/cgi-bin/netApp.cgi?action=getUPnPStatus
A_

status.InnerAddress=0.0.0.0
status.OuterAddress=0.0.0.0
HT

status.PortMapStatus[0]=Failed
TP

Success status.PortMapStatus[1]=Failed
_A

Return status.PortMapStatus[2]=Failed
PI

status.PortMapStatus[3]=Failed
status.Status=Unknown
fo

status.Working=false
Comment —
r
In

4.8.10 NTP
te
lb

 Get NTP config


ra

Table 4-69
s

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NTP
Method GET
Description Get NTP config
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NTP
table.NTP.Address=clock.isc.org
table.NTP.Enable=false
table.NTP.Port=38
table.NTP.TimeZone=9
Success
table.NTP.UpdatePeriod=31
Return
table.NTP.ServerList[0].Enable=true,
table.NTP.ServerList[0].Address=192.168.1.108,
table.NTP.ServerList[0].Port=123
table.NTP.Tolerance=5,

General APIs 99
table.NTP.TimeZoneDesc=Beijing
Comment —
 Set NTP config

Table 4-70

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
Method GET
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 —

4.8.11 RTSP
DA
HU

 Get RTSP config


A_
HT

Table 4-71
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RTSP
_A

Method GET
PI

Description Get RTSP config.


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

table.RTSP.Enable=true
Success table.RTSP.Port=554
r

Return table.RTSP.RTP.EndPort=40000
In

table.RTSP.RTP.StartPort=20000
te

Comment —
lb

 Set RTSP config


ra

Table 4-72
s

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
Method GET
Description Set RTSP config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RTSP.Enable=true&
Example
RTSP.Port=554
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


RTSP.Enable bool Enable/Disable RTSP.

General APIs 100


ParamName ParamValue type Description
RTSP.Port integer RTSP port.
RTSP.RTP.StartPort integer RTP start port.
RTSP.RTP.EndPort integer RTP end port.

4.8.12 Alarm Server


 Get alarm server config

Table 4-73

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AlarmServer
Method GET
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
DA

table.AlarmServer.Enable=false
table.AlarmServer.Password=
HU

Success table.AlarmServer.Port=8888
A_

Return table.AlarmServer.Protocol=ttt
HT

table.AlarmServer.ReportTime=02:00:00
table.AlarmServer.ReportWeekDay=2
TP

table.AlarmServer.UserName=admin
_A

Comment —
PI

 Set alarm server config


fo

Table 4-74
r

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
In

Syntax
Value>[&<paramName>=<paramValue>…]
te

Method GET
lb

Description Set Alarm Server config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmServer.Addres
ra

Example
s=as.ttt.com&AlarmServer.Enable=false
s

Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


AlarmServer.Address string Alarm server IP address or name.
AlarmServer.Enable bool Enable/Disable Alarm server.
Range is [1—65535].
AlarmServer.Port integer
Port of Alarm server.

General APIs 101


4.8.13 Device Network Packet Capture
 Enabling Device Network Packet Capture
Enabling Device Network Packet Capture
Syntax http://<server>/cgi-bin/NetworkSnifferManager.cgi?action=start
Method GET
Request Params Key=Value
Parameter Type R/O Description Example
networkCard string O Network "eth0"
adapter name
path string O When "/mnt/dvr/sda0/2010/8/11/dav/xxx.pc
the packet capture ap"
storage file name is "",
the file is saved in the
default configuration
directory (specified by
DA

NetworkSniffer.
HU

DefaultSaveDirectory
A_

and NetworkSniffer.
HT

FileNamedRule).
saveType string O Types "Wireshark/Tcpdump"
TP

of packet capture
_A

storage file:
PI

1.
fo

"Wireshark/Tcpdump":
r

See the Wireshark


packet capture file
In

type.
te
lb

2. Remotecap:
ra

Streaming remote
packet capture, that is,
s

calling back data


through the
attachSnifferCall
interface.
filter string O Packet "host
capture filtering rules: 10.9.8.2 and port 8080 and tcp"

Optional rules: 1)
Target IP

2) Target port number

3) Protocol type

General APIs 102


captureTime integer O Packet 1024
capture timeout period,
in seconds. If this field
does not exist, no
timeout by
default.
currentFileSize integer O Specify 1024
the maximum size of
this packet capture, in
kb.
filterEx object O High
priority filtering rules. If
this option exists, the
filtering rules in filter
are not adopted
+CapInfo object[] O Filter the arrays of
DA

quintuples. The
HU

number of arrays
should not exceed 8.
A_

++SrcIP string O Source IP address "127.0.0.1"


HT

++SrcPort string O Source port address 1234


TP

++DstIP string O Destination IP address "127.0.0.1"


_A

++DstPort string O Destination port 5678


address
PI

++Protocol integer O tcp or udp "tcp"


fo

+CapType O Filtering 0
types:
r
In

0: Use the Or-Set of all


te

the above quintuples


as the filtering
lb

condition.
ra
s

1: Use the NOR of all


the above quintuples
as the filtering
condition
Example
GET
http://<server>/cgi-bin/NetworkSnifferManager.cgi?action=start&networkCard="eth0"&path="/mnt/dvr/sd
a0/2010/8/11/dav/xxx.pcap"&saveType="Wireshark/Tcpdump"&filter="host
10.9.8.2 and port 8080 and
tcp"&captureTime=1024&currentFileSize=1024&filterEx.CapInfo[0].SrcIP="127.0.0.1"&filterEx.CapInfo[
0].SrcPort=1234&filterEx.CapInfo[0].DstIP="127.0.0.1"&filterEx.CapInfo[0].DstPort=5678&filterEx.CapIn
fo[0].Protocol="tcp"&filterEx.CapType=0

Response Params Key=Value

General APIs 103


Parameter Type R/O Description Example
networkSnifferID integer O Packet 1387
capture ID, which is
generated when enabling
packet capture and
uniquely
identifies a packet
capture.
Example

networkSnifferID=1387

 Disabling Device Network Packet Capture


Disabling Device Network Packet Capture
DA

Syntax http://<server>/cgi-bin/NetworkSnifferManager.cgi?action=stop
Method GET
HU

Request Params Key=Value


A_

Parameter Type R/O Description Example


HT

networkSnifferID integer O Packet 1387


TP

capture ID, which is


generated when enabling
_A

packet capture and


PI

uniquely
identifies a packet
fo

capture.
r

Example
In

GET http://<server>/cgi-bin/NetworkSnifferManager.cgi?action=stop&networkSnifferID=1387
te

Response Params OK
lb

Parameter Type R/O Description Example


ra

string O Result "OK"


s

of disabling packet
capture
Example
OK

4.8.14 Onvif Service Authorization


 Get config of Onvif service authorization

Table 4-75

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

General APIs 104


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
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-76

http://<server>/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCh
Syntax
eck=<flag>
Method GET
Description Enable onvif login check or not.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLog
Example
DA

inCheck=true
Success
HU

OK
Return
A_

Parameters in URL:
Comment
HT

flag : range is {true, false}.


TP

4.8.15 SSHD Config


_A
PI

 Get SSHD config


fo

Table 4-77
r

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&&name=SSHD
In

Method GET
te

Description Get SSHD Config


lb

Example http://<server>/192.168.1.108/configManager.cgi?action=getConfig&&name=SSHD
Success table.SSHD.Enable=true
ra

Return table.SSHD.Port=22
s

Comment —

 Set SSHD config

Table 4-78

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVal
ue>[&<paramName>=<paramValue>...]
Method GET
Description Set SSHD Config
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SSHD.Enable=true&S
SHD.Port=22
Success OK
Return

General APIs 105


Comment —

4.9 Event

4.9.1 Event Handler


 Get event handler config

Table 4-79

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=<handlerName>
Method GET
Description Get event handler settings.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Alarm[0].Eve
Example
ntHandler
DA

handlerName.EventHandler.AlarmOutChannels[0]=1
HU

handlerName.EventHandler.AlarmOutChannels[1]=1
A_


handlerName.EventHandler.AlarmOutEnable=false
HT

handlerName.EventHandler.AlarmOutLatch=10
TP

handlerName.EventHandler.BeepEnable=true
_A

handlerName.EventHandler.Dejitter=0
PI

handlerName.EventHandler.Delay=30
handlerName.EventHandler.LogEnable=true
fo

handlerName.EventHandler.MailEnable=true
handlerName.EventHandler.PtzLink[0][0]=None
r

handlerName.EventHandler.PtzLink[0][1]=0
In

handlerName.EventHandler.PtzLink[1][0]=None
te

handlerName.EventHandler.PtzLink[1][1]=0
lb


Success
handlerName.EventHandler.PtzLinkEnable=false
ra

Return
handlerName.EventHandler.RecordChannels[0]=1
s

handlerName.EventHandler.RecordChannels[1]=2

handlerName.EventHandler.RecordEnable=true
handlerName.EventHandler.RecordLatch=10
handlerName.EventHandler.SnapshotChannels[0]=1
handlerName.EventHandler.SnapshotChannels[1]=1

handlerName.EventHandler.SnapshotEnable=false
handlerName.EventHandler.SnapshotPeriod=3
handlerName.EventHandler.SnapshotTimes=0
handlerName.EventHandler.TimeSection[0][0]=1 01:00:00-24:00:00
handlerName.EventHandler.TimeSection[0][1]=1 01:00:00-24:00:00…

handlerName.EventHandler.TimeSection[6][5]=1 01:00:00-24:00:00

General APIs 106


handlerName.EventHandler.TipEnable=true
handlerName.EventHandler.ExAlarmOutEnable=true
handlerName.EventHandler.Enable=true,
handlerName.EventHandler.FilckerLightType=WhiteLight,
handlerName.EventHandler.LightLinkType=Filcker,
handlerName.EventHandler.FilckerIntevalTime=5,
handlerName.EventHandler.FilckerTimes=5,
handlerName.EventHandler.LightDuration=10,
handlerName.EventHandler.WhiteLightTimeSection=,
handlerName.EventHandler.LightBright=50
handlerName.ExAlarmOutChannels[0] =2
handlerName.ExAlarmOutChannels[1]=3

Parameters in URL:
handlerName can be one of below four formats:
Alarm[ChannelNo].EventHandler
Comment
DA

MotionDetect[ChannelNo].EventHandler
HU

BlindDetect[ChannelNo].EventHandler
LossDetect[ChannelNo].EventHandler
A_

 Set event handler config


HT
TP

Table 4-80
_A

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

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

Description Modify event handler settings.


r

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].EventHandl
Example
er.AlarmOutChannels[0]=1&Alarm[0].EventHandler.AlarmOutEnable=true
In

Success
te

OK
Return
lb

Comment In below paramName, Meaning of handlerName is the same with GetEventHandler.


ra

Appendix:
s

paramName paramValue type Description


ch is alarm out channel index
which starts from 0. Range is {0,
1},
handlerName.EventHandler.AlarmOutChann
integer 0 — do not output alarm at alarm
els[ch]
out channel ch
1 — output alarm at alarm out
channel ch
Enable/Disable alarm out
handlerName.EventHandler.AlarmOutEnable bool
function.

General APIs 107


paramName paramValue type Description
Range is [10—300].
Unit is seconds, indicates the time
handlerName.EventHandler.AlarmOutLatch Integer
to output alarm after input alarm
is cleared.
handlerName.EventHandler.BeepEnable bool Enable/Disable beep.
Range is [0—255].
Alarm signal dejitter seconds.
handlerName.EventHandler.Dejitter integer
Alarm signal change during this
period is ignored.
Range is [0—300].
handlerName.EventHandler.Delay integer Delay seconds before setting take
effect.
handlerName.EventHandler.LogEnable bool Enable/Disable log for alarm.
Enable/Disable mail send for
handlerName.EventHandler.MailEnable bool
alarm.
DA

Range is {None, Preset, Tour,


HU

Pattern}
This is PTZ action linked with
A_

handlerName.EventHandler.PtzLink[ch][0] string
events.
HT

ch is PTZ channel index which


TP

starts from 0.
_A

This is the parameter of


PtzLink[ch][0],
PI

If PtzLink[ch]][0] is
handlerName.EventHandler.PtzLink[ch][1] integer
fo

Preset: this is preset point.


Tour: this is tour path number.
r

Pattern: this is pattern number.


In

handlerName.EventHandler.PtzLinkEnable Bool Enable/Disable PTZ link.


te

handlerName.EventHandler.RecordChannels array<integer> record channel list


lb

handlerName.EventHandler.RecordEnable bool Enable/Disable record function.


Range is [10—300].
ra

Unit is seconds, indicates the time


s

handlerName.EventHandler.RecordLatch integer
to record after input alarm is
cleared.
handlerName.EventHandler.SnapshotChann
array<integer> snapshot channel list
els
Enable/Disable snapshot
handlerName.EventHandler.SnapshotEnable bool
function.
Range is [0—255].
Frames between snapshots.
handlerName.EventHandler.SnapshotPeriod integer
0 means continuously snapshot
for every frame.
Range is [0—65535]
handlerName.EventHandler.SnapshotTimes integer Snapshot times before stop, 0
means don't stop snapshot.

General APIs 108


paramName paramValue type Description
It's an effective time period for
eventHanlder everyday.
wd (week day) range is [0—6]
(Sunday—Saturday)
ts (time section) range is [0-23],
it's index of time section table.

Format: mask
hh:mm:ss-hh:mm:ss
Mask: {0,1}, hh: [0—24], mm: [00
handlerName.EventHandler.TimeSection[wd]
String —59], ss: [00—59]
[ts]
Mask 0: this time section is not
used.
Mask 1: this time section is used.
DA

Example:
TimeSection[1][0]=1
HU

12:00:00-18:00:00
A_

Means EventHandler is effective


HT

between 12:00:00 and 18:00:00


TP

at Monday.
Enable/Disable local message
_A

handlerName.EventHandler.TipEnable bool
box tip.
PI

handlerName.EventHandler.ExAlarmOutEna Enable/Disable extend alarm out


bool
ble ability
fo

handlerName.EventHandler.LightingLink.Ena
r

bool Enable/Disable LightingLink


ble
In

handlerName.EventHandler.LightingLink.Filc Filcker Light Type


String
te

kerLightType range : ”WhiteLight”


handlerName.EventHandler.LightingLink.Ligh
lb

string range : [“Filcker”, “KeepLighting”]


tLinkType
ra

handlerName.EventHandler.LightingLink.Filc Filcker Inteval Time


float
s

kerIntevalTime unit: 0.1s


handlerName.EventHandler.LightingLink.Filc
integer Filcker Times
kerTimes
handlerName.EventHandler.LightingLink.Ligh Light Duration
integer
tDuration unit: s
handlerName.EventHandler.LightingLink.Whi array<array<string
teLightTimeSection >>
handlerName.EventHandler.LightingLink.Ligh
integer brightness
tBright
handlerName.ExAlarmOutChannels[ch] integer extend alarm out channels

4.9.2 Alarm Event


 Get alarm config

General APIs 109


Table 4-81

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Alarm
Method GET
Description Get alarm config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Alarm
table.Alarm[0].Enable=false
table.Alarm[0].EventHandler….(output of EventHandler is described in
GetEventHandler)
Success
table.Alarm[0].Name=Door1
Return
table.Alarm[0].SensorType=NC
table.Alarm[1]….

Comment —
 Set alarm config
DA

Table 4-82
HU

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramVal
Syntax
A_

ue>[&<paramName>=<paramValue>…]
HT

Method GET
Description Set alarm config.
TP

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].Enable=true
_A

Success
OK
PI

Return
In below ParamName, input is external alarm input channel which starts from 0.
fo

Comment EventHandler defines parameter of relevant actions when alarm or event happens. It's
r

also used in following sections about events.


In

Appendix:
te

ParamName ParamValue type Description


lb

Alarm[input].Enable bool Enable/Disable alarm from a input channel


ra

Setting of EventHandler is described in


Alarm[input].EventHandler —
s

SetEventHandler.
Alarm[input].Name string Name of alarm input channel.
Range is {NC, NO].
Alarm[input].SensorType string NC: normal close
NO: normal open

4.9.3 Alarm Out


 Get alarm out config

Table 4-83

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

General APIs 110


Description Get alarm out config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=AlarmOut
Success table.AlarmOut[alarmOutChannel].Mode=0
Return table.AlarmOut[alarmOutChannel].Name=Beep
Parameters in Response:
Comment
alarmOutChannel: the alarm out channel index which starts from 0.
 Set alarm out config

Table 4-84

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set alarm out config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmOut[0].Mode=0
Example
&AlarmOut[0].Name=port1
DA

Success
OK
Return
HU

Comment port in below ParamName is alarm out port index, start form 0.
A_

Appendix:
HT
TP

ParamName ParamValue type Description


Range is {0, 1, 2}
_A

0: automatically alarm
PI

AlarmOut[port].Mode integer
1: force alarm
2: close alarm
fo

AlarmOut[port].Name string Alarm out port name.


r
In

4.9.4 Get Alarm Input Channels


te
lb

Table 4-85
ra

Syntax http://<server>/cgi-bin/alarm.cgi?action=getInSlots
s

Method GET
Description Get alarm input channel number.
Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getInSlots
Success
result=2
Return
Comment —

4.9.5 Get Alarm Output Channels

Table 4-86

Syntax http://<server>/cgi-bin/alarm.cgi?action=getOutSlots
Method GET
Description Get alarm output channel number.

General APIs 111


Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getOutSlots
Success
result=1
Return
Comment —

4.9.6 Get States of Alarm Input Channels

Table 4-87

Syntax http://<server>/cgi-bin/alarm.cgi?action=getInState
Method GET
Description Get alarm input state for all channels.
Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getInState
Success
result=3
Return
A bit in the response result indicates a channel alarm states, result 3 means alarm
DA

Comment
channel 1 and channel 2 have alarm now.
HU

4.9.7 Get States of Alarm Output Channels


A_
HT

Table 4-88
TP
_A

Syntax http://<server>/cgi-bin/alarm.cgi?action=getOutState
PI

Method GET
Description Get alarm output state for all channels.
fo

Example http://192.168.1.108/cgi-bin/alarm.cgi?action=getOutState
Success
r

result=0
Return
In

Comment A bit in the response result indicates a channel, result 1 means alarm is present.
te
lb

4.9.8 Video Blind Event


ra

 Get video blind detect config


s

Table 4-89

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=BlindDetect
Method GET
Description Get blind detect config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=BlindDetect
head.Enable=false
Success
head.EventHandler= (output of EventHandler is described in GetEventHandler)
Return
head.Level=3
Parameters in Response:
head=table.BlindDetect[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).

General APIs 112


 Set video blind detect config

Table 4-90

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set blind detect config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&BlindDetect[0].Enabl
Example
e=true
Success
OK
Return
Parameters in URL:
In table below,
Comment head=BlindDetect[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
HU

Appendix:
A_

ParamName ParamValue type Description


HT

head.Enable bool Enable/Disable blind detect feature.


TP

Setting of EventHandler is described in


head.EventHandler —
SetEventHandler.
_A

Range is [1—6].
PI

Sensitivity of blind detection.


head.Level integer
1: lowest sensitivity.
fo

6: highest sensitivity.
r
In

4.9.9 Video Loss Event


te

 Get video loss detect config


lb
ra

Table 4-91
s

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=LossDetect
Method GET
Description Get video loss detect config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=LossDetect
Success head. Enable=false
Return head. EventHandler= (output of EventHandler is described in GetEventHandler)
Parameters in Response:
head=table.LossDetect [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 video loss detect config

Table 4-92

General APIs 113


http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video loss detection config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LossDetect[0].Enabl
Example
e=true
Success
OK
Return
Parameters in URL:
In table below,
Comment head=LossDetect [ChannelNo]
ChannelNo: 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

head.Enable bool Enable/Disable loss detect feature.


HU

Setting of EventHandler is described in


head.EventHandler —
A_

SetEventHandler.
HT

4.9.10 Login Failure Event


TP
_A

 Get login failure event config


PI

Table 4-93
fo

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

Method GET
In

Description Get login failure alarm config.


te

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

Success head.Enable=false
ra

Return head.EventHandler= (output of EventHandler is described in GetEventHandler)


s

Parameters in Response:
Comment
head=table.LoginFailureAlarm
 Set login failure alarm config

Table 4-94

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set login failure alarm config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&LoginFailureAlarm.E
Example
nable=true
Success
OK
Return

General APIs 114


Parameters in URL:
Comment In table below,
head=LoginFailureAlarm

Appendix:

ParamName ParamValue type Description


Enable/Disable to notify LoginFailure event. Now this
event can be linked with send email and alarm out. The
head.Enable bool
max try login times can be configured in chapter
SetGeneralConfig.
Setting of EventHandler is described in
head.EventHandler —
SetEventHandler.

4.9.11 Storage Not Exist Event


 Get storage not exist event config
DA
HU

Table 4-95
A_

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageNotExist
HT

Method GET
Description Get storage not exist event config.
TP

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageNotE
_A

Example
xist
PI

table.StorageNotExist.Enable=false
Success
table.StorageNotExist.EventHandler= (output of EventHandler is described in
fo

Return
GetEventHandler)
r

Comment —
In

 Set storage not exist event config


te

Table 4-96
lb

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

Syntax
alue>[&<paramName>=<paramValue>…]
s

Method GET
Description Set storage not exist event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageNotExist.Ena
Example
ble=true
Success
OK
Return
Comment —

Appendix:

ParamName ParamValue type Description


StorageNotExist.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
StorageNotExist.EventHandler —
SetEventHandler.

General APIs 115


4.9.12 Storage Access Failure Event
 Get storage access failure event config

Table 4-97

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageFailure
Method GET
Description Get storage failure event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageFailur
Example
e
table.StorageFailure.Enable=false
Success
table.StorageFailure.EventHandler= (output of EventHandler is described in
Return
GetEventHandler)
Comment —
 Set storage access failure event config
DA
HU

Table 4-98
A_

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

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

Description Set storage failure event config.


_A

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageFailure.Enab
Example
PI

le=true
Success
fo

OK
Return
r

Comment —
In

Appendix:
te

ParamName ParamValue type Description


lb

StorageFailure.Enable bool Enable/Disable loss detect feature.


ra

Setting of EventHandler is described in


StorageFailure.EventHandler —
s

SetEventHandler.

4.9.13 Storage Low Space Event


 Get storage low space event config

Table 4-99

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageLowSpace
Method GET
Description Get storage low space event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=StorageLowS
Example
pace
Success table.StorageLowSpace.Enable=false

General APIs 116


Return table.StorageLowSpace.EventHandler= (output of EventHandler is described in
GetEventHandler)
Comment —
 Set storage low space event config

Table 4-100

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set storage low space event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageLowSpace.E
Example
nable=true
Success
OK
Return
Comment —
DA

Appendix:
HU

ParamName ParamValue type Description


A_

StorageLowSpace.Enable bool Enable/Disable loss detect feature.


HT

Setting of EventHandler is described in


StorageLowSpace.EventHandler —
TP

SetEventHandler.
_A

4.9.14 Net Abort Event


PI

 Get net abort event config


fo
r

Table 4-101
In

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=NetAbort
te

Method GET
lb

Description Get net abort event config.


ra

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NetAbort
table.NetAbort.Enable=false
s

Success
table.NetAbort.EventHandler= (output of EventHandler is described in
Return
GetEventHandler)
Comment —
 Set net abort event config

Table 4-102

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set net abort event config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetAbort.Enable=tru
Example
e
Success OK

General APIs 117


Return
Comment —

Appendix:

ParamName ParamValue type Description


NetAbort.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
NetAbort.EventHandler —
SetEventHandler.

4.9.15 IP Conflict Event


 Get IP conflict event config

Table 4-103

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=IPConflict
DA

Method GET
Description Get IP conflict event config.
HU

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

Success table.IPConflict.Enable=false
HT

Return table.IPConflict.EventHandler= (output of EventHandler is described in


TP

GetEventHandler)
Comment —
_A

 Set IP conflict event config


PI

Table 4-104
fo
r

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

Method GET
te

Description Set IP Conflict event config.


lb

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&IPConflict.Enable=tr
ra

ue
Success OK
s

Return
Comment —

Appendix:

ParamName ParamValue type Description


IPConflict.Enable bool Enable/Disable loss detect feature.
Setting of EventHandler is described in
IPConflict.EventHandler —
SetEventHandler.

4.9.16 Get Channels Event Happened

Table 4-105

General APIs 118


http://<server>/cgi-bin/eventManager.cgi?action=getEventIndexes&code=<eventCode
Syntax
>
Method GET
Get channels indexes that event of code eventCode happens.
Description Not all events support this command. Do not recommend to use it, use Attach command
instead.
http://192.168.1.108/cgi-bin/eventManager.cgi?action=getEventIndexes&code=AlarmL
Example
ocal
channels[0]=0
channels[1]=2
Success channels[2]=3
Return …
(This response means event happened on channel 0, channel 2 and channel 3 while
video channel index starts from 0)
Parameters in URL:
eventCode includes:
DA

VideoMotion: motion detection event


HU

VideoLoss: video loss detection event


VideoBlind: video blind detection event.
A_

Comment
AlarmLocal: alarm detection event.
HT

StorageNotExist: storage not exist event.


TP

StorageFailure: storage failure event.


_A

StorageLowSpace: storage low space event.


AlarmOutput: alarm output event.
PI

4.9.17 Subscribe to Event Message


fo
r

Subscribe to event messages.


In

For details on the event name and parameters, see the corresponding [Event] sections.
te

Request URL http://<server>/cgi-bin/eventManager.cgi?action=attach


lb

Method GET
ra

Request Params ( key=value format in URL )


s

Name Type R/O Description Example


codes string R Event code. [AlarmLocal,VideoMo
"All" covers all event codes, including tion, VideoLoss,
AlarmLocal, VideoMotion, VideoLoss, VideoBlind,FaceDete
VideoBlind, FaceDetection and more. ction]
keepalive int O Client keep-alive. If this parameter exists, 20
the client will send keep-alive data to the
device at an interval in seconds; the value
range is [1–60].
The keep-alive data can be "keep alive" in
the form of string.
Note: It is recommended to use the
Heartbeat parameter instead of the
keepalive parameter.

General APIs 119


heartbeat int O Server keep-alive; integer; Unit: s; 5
The value range is [1–60].
For example, if the parameter exists in the
URL and the value is 5, the device will
send "heartbeat" to the client as a
keep-alive message.
Note: The keep-alive message must be
sent before the keepalive parameter
expires.
Request Example
http://192.168.1.108/cgi-bin/eventManager.cgi?action=attach&codes=[AlarmLocal%2CVideoMotion%2
CVideoLoss%2CVideoBlind%2CFaceDetection]

Response Params ( multipart , key=value format in body , Heartbeat in body )


Name Type R/O Description Example
Code string R Event code VideoBlind
DA

action string R Event action Start


Values: Start/Stop/pulse
HU

index int R Number; meaningless sometimes. 0


A_

data object O Event data; json message body. ““


HT

For detailed message bodies, see the


TP

corresponding section.
Response Example
_A

HTTP/1.1 200 OK
PI

Cache-Control: no-cache
Pragma: no-cache
fo

Expires: Thu, 01 Dec 2099 16:00:00 GMT


r

Connection: close
In

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


te

--myboundary
lb

Content-Type: text/plain
ra

Content-Length: 39
s

Code=VideoMotion;action=Start;index=0

--myboundary
Content-Type: text/plain
Content-Length: 38

Code=FaceDetection;action=Start;index=0;data={
“Faces”: [ { “BoundingBox”: [2992,136,6960,8192],
“Sex”: “Man”,
“Age”: 40,
“Feature”: [ “WearGlasses”, “Smile”],
“Eye”: 2,
“Mouth”: 1,

General APIs 120


“Mask”: 1,
“Beard”: 2
}, {…}, … ]
}

--myboundary
Content-Type: text/plain
Content-Length: 9

Heartbeat

--myboundary
……

4.9.18 Get Capability of Event Management


DA

Table 4-106
HU

Syntax http://<server>/cgi-bin/eventManager.cgi?action=getCaps
A_

Method GET
HT

Description Get event manager capabilities.


TP

Example http://192.168.1.108/cgi-bin/eventManager.cgi?action=getCaps
_A

caps.AlarmOutEnable=true
caps.BeepEnable=true
PI

caps.DejitterEnable=true
caps.MMSEnable=true
fo

caps.MailEnable=true
r

caps.MonitorTourEnable=true
In

caps.PtzLinkEnable=true
te

caps.RecordEnable=true
caps.SnapshotEnable=true
lb

caps.TimeSectionEnable=true
ra

caps.TipEnable=true
s

caps.RecordCloudEnable=true,
Success
caps.SnapshotCloudEnable=false,
Return
caps.SnapshotTimes[0]=3,
caps.SnapshotTimes[1]=10,
caps.SupportAlarmBell=false,
caps.SupportAccessControl=false,
caps.SipCallEnable=false,
caps.SupportAlarmServer=false,
caps.SupportPtzLinkDelay=false,
caps.SupportPSTNAlarmServer=false,
caps.SupportICR=false,
caps.BeepTime=false,
caps.DejitterRange.Min=0,
caps.DejitterRange.Max=60

General APIs 121


caps.AlarmOutLatch[0]=1,
caps.AlarmOutLatch[1]=300,
caps.RecordLatch[0]=0,
caps.RecordLatch[1]=300,
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,
caps.SupportLightControl=false,
caps.LinkLightBrightRange[0]=0,
caps.LinkLightBrightRange[1]=100,
caps.SupportVideoMatrix=false,
caps.LinkDetailCameraEnable=false,
DA

caps.SupportDisableLinkage[0]=0
caps.SupportDisableLinkage[1]=0
HU

caps.SupportDisableLinkage[2]=0
A_

caps.SupportDisableLinkage[3]=0
HT

caps.SupportHTTPUpload.PictureHttpUploadEnable=false
TP

caps.SupportHTTPUpload.EventHttpUploadEnable=false
Comment —
_A
PI

4.9.19 [Config] Net Alarm Event


fo

Net alarm event configuration parameters:


r

Config Data Params


In

Name Type R/O Description Example


te

Network alarm; one-dimensional array.


The array index represents the
lb

NetAlarm object[] R
corresponding channel which starts
ra

from 0.
s

+Enable bool O Enable alarm input (bypass switch) true


Type of the protection zone “Intime”
enumchar[32]{
"Intime": Real-time protection zone
+DefenceAreaTy "Delay": Time-delay protection zone
string O
pe "Fullday": 24-hour protection zone
Get the capability set to judge the
protection zone type.
}
Delay disarming time 30
Unit: s
+DisableDelay integer O Get the maximum delay time from the
capability set.
Effective when EnableAlways is

General APIs 122


selected or when the EnableControl is
set to Normal.
Others:
Effective only when the protection
zone type is Delay.
Delay arming time 30
Unit: s
Get the maximum delay time from the
+EnableDelay integer O
capability set.
Effective when the protection zone
type is Delay.
+Name string O Alarm Channel Name “Door”
The sensor is solid on or off. NC
enumchar[32]{
+SensorType string O "NC"
"NO"
DA

}
Alarm linkage
HU

+EventHandler object O For linkage configurations, see


A_

SetEventHandler.
HT
TP

See the following examples to read and modify configurations.


_A

Get Config Request Example


PI

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=NetAlarm
Get Config Response Example
fo

table.NetAlarm[0].Enable=false
table.NetAlarm[0].Name=channel1
r

table.NetAlarm[0].SensorType=NO
In

table.NetAlarm[0].EventHandler= (output of EventHandler is described in GetEventHandler)


te
lb

Set Config Request Example


ra

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NetAlarm[0].Enable=true
Set Config Response Example
s

OK

4.9.20 Set Net Alarm State


Set the network alarm status.
Request URL http://<server>/cgi-bin/netAlarm.cgi?action=setState
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Sample
channel int R Channel number; access control number; 1
starting from 1
alarm bool R Alarm status; bool; true
"true" means the alarm is enabled

General APIs 123


name string O Alarm name; string; less than 32 characters 101
trigger string O Alarm triggering source; string; less than 32 Remote
characters. For example, Infrared,
WaterSensor Manual and more
desc string O Alarm description; string; less than 128 Zone8
characters
Request Example
http://192.168.1.108/cgi-bin/netAlarm.cgi?action=setState&channel=1&alarm=true&name=somke&trigg
er=SmokingSensor&desc=Zone8

Response Params ( OK in body )


Response Example
OK

4.9.21 GetSupportedEvents
DA

Get the event list which the device supports.


HU

Request URL http://<server>/cgi-bin/eventManager.cgi?action=getExposureEvents


Method GET
A_

Request Params ( none )


HT

Request Example
TP

http://192.168.1.108/cgi-bin/eventManager.cgi?action=getExposureEvents
_A
PI

Response Params ( key=value format in body )


Name Type R/O Description Sample
fo

events string[] R Supported event list; [VideoMotion, AlarmLocal,


one-dimensional array FaceDetection, VideoMotion,…]
r

Response Example
In

events[0]=VideoMotion
te

events[1]=AlarmLocal
lb

events[2]=FaceDetection
events[3]=VideoMotion
ra


s

4.10 Record

4.10.1 Get Capability of Recording

Table 4-107

Syntax http://<server>/cgi-bin/recordManager.cgi?action=getCaps
Method GET
Description Get record manager capabilities.
Example http://192.168.1.108/cgi-bin/recordManager.cgi?action=getCaps
Success caps.MaxPreRecordTime=30
Return caps.PacketLengthRange[0]=1

General APIs 124


caps.PacketLengthRange[1]=60
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
Comment —

4.10.2 Record Config


 Get record config

Table 4-108

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Record
DA

Method GET
HU

Description Get record config.


A_

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

table.Record[channel].PreRecord=6
table.Record[channel].TimeSection[weekday][0]=65535 00:00:00-24:00:00
TP

table.Record[channel].TimeSection[weekday][1]=0 02:00:00-24:00:00
_A

Success
table.Record[channel].TimeSection[weekday][2]=0 03:00:00-24:00:00
Return
PI

table.Record[channel].TimeSection[weekday][3]=0 04:00:00-24:00:00
table.Record[channel].TimeSection[weekday][4]=0 05:00:00-24:00:00
fo

table.Record[channel].TimeSection[weekday][5]=0 06:00:00-24:00:00
r

Parameters in Response:
channel: integer, array index starts from 0, which means video channel(equals to video
In

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


te

weekday: range is [0-6] (Sunday - Saturday).


lb

Record config contains pre record time and record time sections of every day.
ra

 Set record config


s

Table 4-109

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set record config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Record[0].TimeSecti
on[0][0]=6 00:00:00-23:59:59
Example Set record time to every Sunday all day. Record type is motion detection and alarm.
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.).
Success
OK
Return
Comment Parameters in URL:

General APIs 125


In table below,
ch: integer, array index starts from 0, which means video channel (equals to video
channel index -1, and so 0 means channel 1).
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.
ch (Channel number) starts form 0
wd (week day) range is [0—7] ,[0-6]:(Sunday -
Saturday),7:Holiday
ts (time section) range is [0—23], time section
table index.
DA

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


HU

Record[ch].TimeSection[wd][ts] string Mask: [0—4294967295], hh: [0—24], mm: [0


—59], ss: [0—59]
A_

Mask indicates record type by bits:


HT

Bit0: regular record


TP

Bit1: motion detection record


_A

Bit2: alarm record


Bit3: card record
PI

4.10.3 Record Mode


fo
r

 Get record mode config


In
te

Table 4-110
lb

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
ra

Method GET
Description Get record mode config.
s

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RecordMode
Success
table.RecordMode[Channel].Mode=0
Return
Parameters in Response:
Comment Channel: integer, array index starts from 0, which means video channel (equals to
video channel index -1, and so 0 means channel 1).
 Set record mode config

Table 4-111

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>
Method GET
Description Set record mode config.

General APIs 126


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RecordMode[0].Mod
Example
e=0
Success
OK
Return
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


Range is {0, 1, 2 }.
0: automatically record
RecordMode[Channel].Mode integer
1: manually record
2: stop record.
DA

4.10.4 Media Global


HU

Get media global config


A_


HT

Table 4-112
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MediaGlobal
_A

Method GET
PI

Description Get media global config.


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

table.MediaGlobal.OverWrite=true,
r

table.MediaGlobal.PacketType=0,
In

table.MediaGlobal.PacketLength=60,
Success
table.MediaGlobal.PacketSize=1024,
te

Return
table.MediaGlobal.LogRecord=false,
lb

table.MediaGlobal.LogEncode=false,
ra

table.MediaGlobal.SnapFormatAs=MainFormat
s

Comment —
 Set media global config

Table 4-113

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>
Method GET
Description Set media global config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MediaGlobal.SnapF
Example
ormatAs=MainFormat
Success
OK
Return
Comment —

General APIs 127


Appendix:

ParamName ParamValue type Description


MediaGlobal.SnapFormatAs string The range is {"MainFormat", "ExtraFormat"}.

4.10.5 Find Media Files


Step 1 Create a media files finder.
Request URL http://<server>/cgi-bin/mediaFileFind.cgi?action=factory.create
Method GET
Request Params ( none )
Request Example
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=factory.create

Response Params ( key=value format in body )


Name Type R/O Description Sample
result string R objectId; use it to search 08137
DA

for media files


HU

Response Example
A_

result=08137
HT

Step 2 Start to find media files satisfied the conditions with the finder.
TP

Request URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile


_A

Method GET
PI

Request Params ( key=value format in URL )


Name Type R/O Description Sample
fo

object string R Search object of the media files; 08137


r

Create the object in the previous command,


and then search for the object.
In

condition object R user id 101


te

+Channel int R Channel number; starting from 1 1


lb

+StartTime string R Start time "2010-05-25 12:


ra

05:00"
+EndTime string R End time "2010-05-25 12:
s

10:00"
+Dirs string[] O The directory where the recordings are ["/mnt/dvr/sda0",
saved; array; the index starts from 0; optional "/mnt/dvr/sda1"]
values: {"dav", "jpg", "mp4"}
If this parameter does not exist, the system
will search for all directories.
+Types string[] O The type of file that is being searched for; ["dav"]
array; the index starts from 0; optional
values: {"dav", "jpg", "mp4"}
If this parameter does not exist, the system
will search for all file types.
+Flags string[] O Search parameter; array; the index starts ["Timing"]
from 0; optional values: {"Timing", "Manual",

General APIs 128


"Marker", "Event", "Mosaic", "Cutout"}
If this parameter does not exist, the system
will search for all files.
+Events string[] O Events related to the recordings; array; the ["AlarmLocal"]
index starts from 0; optional values:
{"AlarmLocal", "VideoMotion", "VideoLoss",
"VideoBlind", "Traffic*", …}
If this parameter does not exist, the system
will search for all files.
+VideoStream string O Stream type; optional values: {"Main", Main
"Extra1", "Extra2", "Extra3"}.
If this parameter does not exist, the system
will search for all stream types.
Request Example
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Channel=1&co
ndition.Dirs[0]=/mnt/dvr/sda0&condition.Types[0]=dav&condition.Events[0]=AlarmLocal&condition.Event
DA

s[1]=VideoMotion&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%2012:0
0:00&condition.VideoStream=Main
HU
A_

Response Params ( OK in body )


HT

Response Example
TP

OK
_A
PI

Step 3 Get the media file information found by the finder.


Request URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
fo

Method GET
r

Request Params ( key=value format in URL )


Name Type R/O Description Sample
In

object string R The search object of the media files; 08137


te

Create the object in the previous command,


lb

and then search for the object.


ra

count int R Get the number of files that have been found, 100
and the maximum number is 100.
s

Request Example
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=100

Response Params ( key=value format in body )


Name Type R/O Description Sample
found int O The returned number of files that have 1
been found.
0 means no file has been found.
items object[] O List of file information
+Channel int O Channel number; integer; the video 1
channel number starts from 0.
+StartTime string O Start time of the recording 2011-1-1 12:00:00
+EndTime string O End time of the recording 2011-1-1 13:00:00

General APIs 129


+Type string O File type dav
+Events string[] O Type of events that are related to the [“AlarmLocal”]
recordings
+VideoStream string O Stream type Main
+FilePath string O /mnt/dvr/sda0/201
File path 0/8/11/dav/15:40:5
0.jpg
+Length int O The file length within a specified period 792
+Duration int O File length 3600
Response Example
found=1
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=dav
items[0].Events[0]=AlarmLocal
DA

items[0].VideoStream=Main
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
HU

items[0].Length=790
A_

items[0].Duration=3600
HT
TP

Step 4 Close the finder.


Request URL http://<server>/cgi-bin/mediaFileFind.cgi?action=close
_A

Method GET
PI

Request Params ( key=value format in URL )


Name Type R/O Description Sample
fo

object string R The search object of the media files; 08137


r

Create the object in the previous command,


In

and then search for the object.


te

Request Example
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=close&object=08137
lb
ra

Response Params ( OK in body )


s

Response Example
OK

Step 5 Destroy the finder.


Request URL http://<server>/cgi-bin/mediaFileFind.cgi?action=destroy
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Sample
object string R The search object of the media files; 08137
Create the object in the previous command,
and then search for the object.
Request Example
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=destroy&object=08137

General APIs 130


Response Params ( OK in body )
Response Example
OK

4.10.6 Find media files with FaceDetection info


Step 1 Create a media files finder.
This API is the same as the API in "4.10.5 Find Media Files".
Step 2 Start to find media files satisfied the common conditions and FaceDetection condition
with the finder.

Table 4-114

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
DA

Start to find media files satisfied the common conditions and FaceDetection conditions
HU

Description
with the finder.
A_

[ Request Params ] ( key=value format at URL )


HT

Name Type R/O Param Description


object int R The finder object id
TP

condition object R The search conditions


_A

The video channel to search, video channel index start from


+Channel int R
PI

1, use -1 to search all video channel.


+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"
fo

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


r

+Types array<string> O Search file types, should be "jpg"


In

Search flags, can be : "Timing", "Manual", "Marker", "Event",


+Flags array<string> O "Mosaic", "Cutout"
te

should include “Event”


lb

+Events array<string> R Search event list, must be one string : "FaceDetection"


ra

Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
s

string length is 259.


+DB object R DB filter object
++FaceDetecti
object R DB filter for FaceDetection
onRecordFilter
Picture type, if omit, means search all type.
+++ImageType string O "GlobalSence" : means big picture of the full sence,
"Small" : means small picture of the people face.
+++Sex string O Sex, it can be "Man", "Woman", if omit, search all
+++Age array<int> O Age range, ex:[25, 40]
+++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
+++Beard int O Beard Status, 0: all, 1: no beard, 2: has beard
[ Response Params ] ( OK )
[ Example ]

General APIs 131


GET
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
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
Request
ion&condition.DB.FaceDetectionRecordFilter.ImageType=GlobalSence&condition.DB.Face
DetectionRecordFilter.Sex=Man&condition.DB.FaceDetectionRecordFilter.Age[0]=25&cond
ition.DB.FaceDetectionRecordFilter.Age[1]=40&condition.DB.FaceDetectionRecordFilter.Gl
asses=1
Respons
OK
e
Step 3 Get the media file information found by the finder

Table 4-115

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Description Get the media file information found by the finder.
DA

[ Request Params ] ( key=value format at URL )


HU

Name Type R/O Param Description


A_

object int R The finder object id


HT

count int R Record num to get, should less than 100.


[ Response Params ] ( key=value format )
TP

Name Type R/O Param Description


_A

found int R Record num that found.


PI

items array<object> R Result record items.


+Channel int O The video channel index start from 0,
fo

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


r

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


In

+Type string O File type, should be: "jpg"


te

+Events array<string> O Events with this record


+FilePath string O File path, string max length is 259
lb

+CutLength int O File length that cut between start time and end time
ra

+Length int O File length of the whole file


s

+SummaryNew array<object> R DB record object


++Key string R DB record name, should be "FaceDetectionRecord"
++Value object R DB record value
+++ImageType string O Picture type. It can be: "GlobalSence" , "Small"
+++TimeStamp object O Picture timestamp
++++UTC int O UTC seconds
++++UTCMS int O UTC miliseconds
+++Sex string O Sex, it can be "Man", "Woman", "Unknown"
+++Age int O Age
+++Glasses int O Glasses Status, 0: unknown, 1: not wear, 2: wear
Mask Status, 0: unknown, 1: not wearing mask, 2: wearing
+++Mask int O
mask
+++Beard int O Beard Status, 0: unknown, 1: no beard, 2: has beard

General APIs 132


[ Example ]
GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
00
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]=FaceDetection
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].CutLength=79000
Respons items[0].SummaryNew[0].Key=FaceDetectionRecord
e items[0].SummaryNew[0].Value.ImageType=GlobalSence
items[0].SummaryNew[0].Value.TimeStamp.UTC=134652732
items[0].SummaryNew[0].Value.TimeStamp.UTCMS=134
DA

items[0].SummaryNew[0].Value.Sex=Man
HU

items[0].SummaryNew[0].Value.Age=30
items[0].SummaryNew[0].Value.Glasses=1
A_

items[0].SummaryNew[0].Value.Mask=2
HT

items[0].SummaryNew[0].Value.Beard=1
TP


Step 4 Close the finder.
_A

This API is the same as the API in "4.10.5 Find Media Files".
PI

Step 5 Destroy the finder.


This API is the same as the API in "4.10.5 Find Media Files".
fo
r

4.10.7 Find media files with FaceRecognition info


In
te

Step 1 Create a media files finder.


This API is the same as the API in "4.10.5 Find Media Files".
lb

Step 2 Start to find media files satisfied the common conditions and FaceRecognition
ra

conditions with the finder.


s

Table 4-116

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
Description Start to find media files satisfied the common conditions and FaceRecognition conditions
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
+Channel int R The video channel to search, video channel index start from
1, use -1 to search all video channel.
+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"

General APIs 133


Ignored, use StartTime in DB param
+EndTime string O End time to search, ex: "2010-06-25 12:05:00"
Ignored, use EndTime in DB param
+Types array<string> O Search file types, should be "jpg"
+Flags array<string> O Search flags. It can be: "Timing", "Manual", "Marker", "Event",
"Mosaic", "Cutout"
should include “Event”.
+Events array<string> R Search event list, must be one string: "FaceRecognition"
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
+DB object R DB filter object
++FaceRecogn object R DB filter for FaceRecognition
itionRecordFilt
er
+++MachineAd string O Machine address
dress
DA

+++StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


HU

+++EndTime string R End time to search, ex: "2010-06-25 12:05:00"


A_

+++Person object O Search condition of history person and the similar face group
person candidates
HT

++++Name string O Person's name, max string length is 15


TP

++++Sex string O Sex, can be "Male", "Female", if omit, search all


_A

++++Birthday string O Birthday, max string length is 11, ex: 1990-5-1


PI

++++Country string O Country, ISO 3166, string length should be 2


++++Province string O Province, max string length is 63
fo

++++City string O City, max string length is 63


r

++++Certificate string O Certificate Type. It can be: "IC', "Passport", "Unknown"


Type
In

++++ID string O Person ID of CertificateType, max string length is 31


te

++++GroupID string O The identity of the Face Group that this Person in. max string
lb

length is 63
ra

++++Age array<int> O Age range, ex:[25, 40]


++++Glasses int O Glasses Status, 0: all, 1: not wear, 2: wear
s

++++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
+++GroupID array<string> O GroupID list
+++SimilaryRa array<int> O Similary Range, ex: [40, 100]
nge
[ Response Params ] ( OK )
[ Example ]
Request GET
http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
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
nition&condition.DB.FaceRecognitionRecordFilter.RegType=RecSuccess&condition.DB.Fa
ceRecognitionRecordFilter.StartTime=2014-1-1%2012:00:00&condition.DB.FaceRecognitio

General APIs 134


nRecordFilter.EndTime=2015-1-10%2012:00:00&condition.DB.FaceRecognitionRecordFilte
r.Person.Sex=Male&condition.DB.FaceRecognitionRecordFilter.Person.Country=CN&condi
tion.DB.FaceRecognitionRecordFilter.Person.Age[0]=25&condition.DB.FaceRecognitionRe
cordFilter.Person.Age[1]=40&condition.DB.FaceRecognitionRecordFilter.Person.Glasses=1
&condition.DB.FaceRecognitionRecordFilter.GroupID[0]=10001&condition.DB.FaceRecogn
itionRecordFilter.GroupID[1]=10003&condition.DB.FaceRecognitionRecordFilter.GroupID[2]
=10005&condition.DB.FaceRecognitionRecordFilter.SimilaryRange[0]=40&condition.DB.Fa
ceRecognitionRecordFilter.SimilaryRange[1]=100
Respons OK
e
Step 3 Get the media file information found by the finder

Table 4-117

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Description Get the media file information found by the finder
DA

[ Request Params ] ( key=value format at URL )


HU

Name Type R/O Param Description


A_

object int R The finder object id


HT

count int R Record num to get, should less than 100.


[ Response Params ] ( key=value format )
TP

Name Type R/O Param Description


_A

found int R Record num that found.


PI

items array<object> R Result record items.


+Channel int O The video channel index start from 0,
fo

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


r

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


In

+Type string O File type, should be: "jpg"


te

+Events array<string> O Events with this record


+FilePath string O File path, string max length is 259
lb

+CutLength int O File length that cut between start time and end time
ra

+Length int O File length of the whole file


s

+SummaryNew array<object> R DB record object


++Key string R DB record name, should be "FaceRecognitionRecord"
++Value object R DB record value
Recognition result, 0 means recognition failed, no candidates.
+++RecResult int O
1 means recognition success, has candidates.
+++MachineAd
string O Machine address, string max length is 259
dress
+++IsGlobalSc
bool O Is the global scene picture or not
ene
+++ImageInfo object O Big picture info
++++Length int O The length of the picture
++++FilePath string O The file path of the picture, max string length is 259
+++Object object O The target face info
++++Sex string O Sex, it can be "Man", "Woman", "Unknown"

General APIs 135


++++Age int O Age
++++Glasses int O Glasses Status, 0: unknown, 1: not wear, 2: wear
++++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 status, 0: not detected, 1: not wearing mask, 2: wearing
++++Mask int O
mask
++++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.
++++Similarity int O Similarity
++++Person object O person info
+++++Name string O Person Name, max string length is 63
+++++Sex string O Sex, it can be "Male", "Female", "Unknown"
+++++Birthday string O The person's birthday, ex: "1980-01-01"
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
DA

+++++City string O City name, max string length is 63


HU

+++++Certificat
string O Certificate Type. It can be: "IC', "Passport", "Unknown"
A_

eType
+++++ID string O Person ID of CertificateType, max string length is 31
HT

+++++Feature
TP

int O Feature State, 0:Unknown, 1:Failed, 2:OK


State
_A

[ Example ]
PI

GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
fo

00
r

found=100
items[0].Channel=1
In

items[0].StartTime=2011-1-1 12:00:00
te

items[0].EndTime=2011-1-1 13:00:00
lb

items[0].Type=jpg
ra

items[0].Events[0]=FaceRecognition
items[0].FilePath =/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
s

items[0].Length =790
items[0].SummaryNew[0].Key=FaceRecognitionRecord
Respons items[0].SummaryNew[0].Value.RecResult=1
e items[0].SummaryNew[0].Value.MachineAddress=BinJiang
items[0].SummaryNew[0].Value.IsGlobalScene=true
items[0].SummaryNew[0].Value.ImageInfo.Length=123
items[0].SummaryNew[0].Value.ImageInfo.FilePath=/tmp/1.jpg
items[0].SummaryNew[0].Value.Object.Sex=Man
items[0].SummaryNew[0].Value.Object.Age=40
items[0].SummaryNew[0].Value.Object.Glasses=1
items[0].SummaryNew[0].Value.Object.Eye=2
items[0].SummaryNew[0].Value.Object.Mouth=1
items[0].SummaryNew[0].Value.Candidates[0].Similarity=50

General APIs 136


items[0].SummaryNew[0].Value.Candidates[0].Person.Name=ZhangSan
items[0].SummaryNew[0].Value.Candidates[0].Person.Birthday=1980-01-01
items[0].SummaryNew[0].Value.Candidates[0].Person.Sex=Male
items[0].SummaryNew[0].Value.Candidates[0].Person.Country=CN
items[0].SummaryNew[0].Value.Candidates[0].Person.Province=ZheJiang
items[0].SummaryNew[0].Value.Candidates[0].Person.City=HangZhou
items[0].SummaryNew[0].Value.Candidates[0].Person.CertificateType=IC
items[0].SummaryNew[0].Value.Candidates[0].Person.ID=1234567890
items[0].SummaryNew[0].Value.Candidates[0].Person.FeatureState=0

Step 4 Close the finder.
This API is the same as the API in "4.10.5 Find Media Files".
Step 5 Destroy the finder.
This API is the same as the API in "4.10.5 Find Media Files".

4.10.8 Find media files with HumanTrait info


DA

Step 1 Create a media files finder.


HU

This API is the same as the API in "4.10.5 Find Media Files".
A_

Step 2 Start to find media files satisfied the common conditions and HumanTrait conditions
HT

with the finder


TP

Table 4-118
_A
PI

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
fo

Start to find media files satisfied the common conditions and HumanTrait conditions with
Description
r

the finder.
[ Request Params ] ( key=value format at URL )
In

Name Type R/O Param Description


te

object int R The finder object id


lb

condition object R The search conditions


ra

The video channel to search, video channel index start from


+Channel int R
1, use -1 to search all video channel.
s

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


+EndTime string O End time to search, ex: "2010-06-25 12:05:00"
+Types array<string> O Search file types, should be "jpg"
Search flags. It can be: "Timing", "Manual", "Marker", "Event",
+Flags array<string> O "Mosaic", "Cutout"
should include “Event”
+Events array<string> R Search event list, must be one string: "HumanTrait"
Search directory list, if omit, search all. Each dir path max
+Dirs array<string> O
string length is 259.
+DB object R DB filter object
++HumanTrait
object R DB filter for HumanTrait
RecordFilter
+++HumanAttri object R Human attributes

General APIs 137


butes
Coat color, refer to CoatColor in 16.1.3.5 [Event] HumanTrait
++++CoatColor array<string> O
for available values, max array size is 4
Coat type, refer to CoatType in 16.1.3.5 [Event] HumanTrait
++++CoatType array<int> O
for available values, max array size is 2
++++Trousers Trousers color, refer to TrousersColor in 16.1.3.5 [Event]
array<string> O
Color HumanTrait for available values, max array size is 4
++++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
++++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
++++Sex string O Sex, can be "Man", "Woman", if omit, search all
++++Age array<int> O Age range, ex:[25, 40]
Hair style, 0: all, 1: long hair, 2: short hair, 3: ponytail, 4: updo,
++++HairStyle int O
5: hiddened
[ Response Params ] ( OK )
DA

[ Example ]
HU

GET
A_

http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condition.Ch
annel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-10%201
HT

2:00:00&condition.Types[0]=jpg&condition.Flags[0]=Event&condition.Events[0]=HumanTrai
TP

t&condition.DB.HumanTraitRecordFilter.HumanAttributes.CoatColor[0]=White&condition.D
_A

Request B.HumanTraitRecordFilter.HumanAttributes.CoatColor[1]=Yellow&condition.DB.HumanTrait
PI

RecordFilter.HumanAttributes.CoatType=1&condition.DB.HumanTraitRecordFilter.HumanAt
tributes.HasHat=2&condition.DB.HumanTraitRecordFilter.HumanAttributes.Sex=Man&cond
fo

ition.DB.HumanTraitRecordFilter.HumanAttributes.Age[0]=30&condition.DB.HumanTraitRe
cordFilter.HumanAttributes.Age[1]=50&condition.DB.HumanTraitRecordFilter.HumanAttribu
r

tes.HairStyle=1
In

Respons
OK
te

e
lb

Step 3 Get the media file information found by the finder


ra

Table 4-119
s

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Descripti
Get the media file information found by the finder
on
[ Request Params ] ( key=value format at URL )
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.
items array<object> R Result record items.
+Channel int O The video channel index start from 0,

General APIs 138


+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 O File type, should be: "jpg"
+Events array<string> O Events with this record
+FilePath string O File path, string max length is 259
+CutLength int O File length that cut between start time and end time
+Length int O File length of the whole file
+SummaryNew object R Face info
++Key string R DB record name, should be "HumanTraitRecord"
++Value object R DB record value
+++HumanAttri
object O Human attributes
butes
Coat color, refer to CoatColor in 16.1.3.5 [Event] HumanTrait
++++CoatColor string O
for available values,
Coat type, refer to CoatType in 16.1.3.5 [Event] HumanTrait
++++CoatType int O
for available values,
DA

++++Trousers Trousers color, refer to TrousersColor in 16.1.3.5 [Event]


string O
HU

Color HumanTrait for available values,


A_

++++TrousersT Trousers type, refer to TrousersType in 16.1.3.5 [Event]


int O
ype HumanTrait for available values,
HT

++++HasHat int O Has hat or not, 0: unknown, 1: not has hat, 2: has hat
TP

++++HasBag int O Has bag or not, 0: unknown, 1: not has bag, 2: has bag
_A

++++Sex string O Sex, can be "Man", "Woman", "Unknown"


PI

++++Age int O Age


Hair style, 0: unknown, 1: long hair, 2: short hair, 3: ponytail,
++++HairStyle int O
fo

4: updo, 5: hiddened
r

++++HasUmbr Has umbrella or not, 0: unknown, 1: not has umbrella, 2: has


int O
ella umbrella
In

Bag type, 0: unknown, 1: handbag, 2: shoulder bag, 3:


te

++++Bag int O
knapsack, 4: draw-bar box
lb

++++Cap int O Cap style, 0: unknown, 1: normal cap, 2: helmet


ra

+++FaceAttribu
object O Face attributes
tes
s

++++Sex string O Sex, can be "Man", "Woman", "Unknown"


++++Age int O Age
Mask status, 0: not detected, 1: not wearing mask, 2: wearing
++++Mask int O
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
Emotion info. It can be: "Unknown", "Smile", "Anger",
++++Emotion string O "Sadness", "Disgust", "Fear", "Surprise", "Neutral", "Laugh",
"Happy", "Confused", "Scream", "Lookaside"
+++FacePath string O Face picture path, max string length is 259
+++FaceScene
string O Face scene picture path, max string length is 259
Path

General APIs 139


+++HumanPat
string O Human picture path, max string length is 259
h
+++HumanSce
string O Human scene picture path, max string length is 259
nePath
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&count=1
00
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
items[0].Length=790
DA

items[0].SummaryNew.Key=HumanTraitRecord
HU

items[0].SummaryNew.Value.HumanAttributes.CoatColor=White
items[0].SummaryNew.Value.HumanAttributes.CoatType=1
A_

items[0].SummaryNew.Value.HumanAttributes.TrousersColor=Black
HT

items[0].SummaryNew.Value.HumanAttributes.TrousersType=1
TP

items[0].SummaryNew.Value.HumanAttributes.HasHat=2
_A

Respons items[0].SummaryNew.Value.HumanAttributes.HasBag=1
e items[0].SummaryNew.Value.HumanAttributes.Sex=Man
PI

items[0].SummaryNew.Value.HumanAttributes.Age=30
items[0].SummaryNew.Value.HumanAttributes.HairStyle=2
fo

items[0].SummaryNew.Value.HumanAttributes.HasUmbrella=1
r

items[0].SummaryNew.Value.HumanAttributes.Bag=0
In

items[0].SummaryNew.Value.HumanAttributes.Cap=2
te

items[0].SummaryNew.Value.FaceAttributes.Sex=Man
items[0].SummaryNew.Value.FaceAttributes.Age=35
lb

items[0].SummaryNew.Value.FaceAttributes.Mask=0
ra

items[0].SummaryNew.Value.FaceAttributes.Beard=1
s

items[0].SummaryNew.Value.FaceAttributes.Glass=2
items[0].SummaryNew.Value.FaceAttributes.Emotion=Smile
items[0].SummaryNew.Value.FacePath=/mnt/2010/8/11/dav/15:40:50.jpg
items[0].SummaryNew.Value.FaceScenePath=/mnt/2010/8/11/dav/15:40:51.jpg

Step 4 Close the finder.
This API is the same as the API in "4.10.5 Find Media Files".
Step 5 Destroy the finder.
This API is the same as the API in "4.10.5 Find Media Files".

4.10.9 Find media files with TrafficCar info


Step 1 Create a media files finder.
This API is the same as the API in "4.10.5 Find Media Files".

General APIs 140


Step 2 Start to find media files satisfied the common conditions and TrafficCar conditions with
the finder

Table 4-120

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
Start to find media files satisfied the common conditions and TrafficCar conditions with
the finder.
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:
Description
"==": 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,
"><": means outside range, followed by two integer param,
DA

[ Request Params ] ( key=value format at URL )


HU

Name Type R/O Param Description


A_

object int R The finder object id


HT

condition object R The search conditions


The video channel to search, video channel index start from
TP

+Channel int R
1, use -1 to search all video channel.
_A

+StartTime string O Start time to search, ex: "2010-05-25 12:05:00"


PI

+EndTime string O End time to search, ex: "2010-06-25 12:05:00"


+Types array<string> O Search file types
fo

Search flags. It can be: "Timing", "Manual", "Marker", "Event",


+Flags array<string> O
r

"Mosaic", "Cutout"
In

Search event list


+Events array<string> O
Ignored, use Event under DB param.
te

Search directory list, if omit, search all. Each dir path max
lb

+Dirs array<string> O
string length is 259.
ra

+DB object R DB object


s

++TrafficCar object R DB filter for TrafficCar


+++PlateNumb <compare PlateNumber condition, use compare condition format, ex:
O
er condition> [ "==", "*888" ]
<compare
+++Event O Event condition, ex: [ "||", "TrafficGate", "Alarm*" ]
condition>
<compare
+++Speed O Speed condition, ex: [ "<>", 40, 80 ]
condition>
<compare Plate type condition, use compare condition format, ex: ["==",
+++PlateType O
condition> "Armed"],
<compare Plate color condition, use compare condition format, ex: ["==",
+++PlateColor O
condition> "Blue"],
+++VehicleCol <compare Vehicle color condition, use compare condition format, ex:
O
or condition> ["==", "White"],
[ Response Params ] ( OK )

General APIs 141


[ Example ]
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
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
Response OK
Step 3 Get the media file information found by the finder

Table 4-121

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Descripti
Get the media file information found by the finder
on
DA

[ Request Params ] ( key=value format at URL )


HU

Name Type R/O Param Description


A_

object int R The finder object id


HT

count int R Record num to get, should less than 100.


TP

[ Response Params ] ( key=value format )


Name Type R/O Param Description
_A

found int R Record num that found.


PI

items array<object> R Result record items.


+Channel int O The video channel index start from 0,
fo

+StartTime string R Start time to search, ex: "2010-05-25 12:05:00"


r

+EndTime string R End time to search, ex: "2010-06-25 12:05:00"


In

+Type string O File type, should be: "jpg"


te

+Events array<string> O Events with this record


+FilePath string O File path, string max length is 259
lb

+CutLength int O File length that cut between start time and end time
ra

+Length int O File length of the whole file


s

+Summary object R DB record info


++TrafficCar object R TrafficCar record info
+++PlateNumb
string R Car plate number
er
+++PlateType string O Plate type,
+++PlateColor string O Plate color, ex: "Yellow", "Blue", … etc
+++VehicleCol
string O Vehicle color, ex: "Yellow", "Blue", … etc
or
+++Country string O Country info. max string length is 19
+++Speed int O Vehicle speed, unit is km/hour
+++Event string O The event info, ex: “TrafficJunction”
[ Example ]

General APIs 142


GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&co
Request
unt=100
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
Respons items[0].Length=790
e items[0].Summary.TrafficCar.PlateNumber=A08888
items[0].Summary.TrafficCar.PlateType=Unknown
items[0].Summary.TrafficCar.PlateColor=Blue
items[0].Summary.TrafficCar.VehicleColor=White
items[0].Summary.TrafficCar.Country=China
items[0].Summary.TrafficCar.Speed=70
DA

items[0].Summary.TrafficCar.Event=TrafficJunction

HU

Step 4 Close the finder.


A_

This API is the same as the API in "4.10.5 Find Media Files".
HT

Step 5 Destroy the finder.


TP

This API is the same as the API in "4.10.5 Find Media Files".
_A

4.10.10 Find media files with IVS info


PI

Step 1 Create a media files finder.


fo

This API is the same as the API in "4.10.5 Find Media Files".
r

Step 2 Start to find media files satisfied the common conditions and IVS conditions with the
In

finder
te

Table 4-122
lb
ra

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
Method GET
s

Start to find media files satisfied the common conditions and IVS conditions with the
Description
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
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"
+EndTime string O End time to search, ex: "2010-06-25 12:05:00"
+Types array<string> O Search file types
Search flags. It can be: "Timing", "Manual", "Marker", "Event",
+Flags array<string> O
"Mosaic", "Cutout"

General APIs 143


+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.
+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
on" , "StayDetection" , "TailDetection"
IVS action. It can be: "Appear" , "Disappear" , "Inside" ,
+++Action string O
"Cross"
IVS object type, item in array can be: "Unknown" , "Human" ,
+++ObjectType array<string> O
"Vehicle" , "NonMotor"
[ Response Params ] ( OK )
DA

[ Example ]
HU

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
A_

Request 0%2012:00:00&condition.Types[0]=jpg&condition.DB.IVS.Rule=CrossLineDetection&cond
HT

ition.DB.IVS.Action=Cross&condition.DB.IVS.ObjectType[0]=Human&condition.DB.IVS.Ob
TP

jectType[1]=NonMotor
_A

Response OK
Step 3 Get the media file information found by the finder
PI
fo

Table 4-123
r

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
In

Method GET
Description Get the media file information found by the finder
te

[ Request Params ] ( key=value format at URL )


lb

Name Type R/O Param Description


ra

object int R The finder object id


s

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.
items array<object> R Result record items.
+Channel int O 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 O File type, should be: "jpg"
+Events array<string> O Events with this record
+FilePath string O File path, string max length is 259
+CutLength int O File length that cut between start time and end time
+Length int O File length of the whole file
+Summary object R DB record info

General APIs 144


++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
+++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
items[0].EndTime=2011-1-1 13:00:00
items[0].Type=jpg
items[0].Events[0]=CrossLineDetection
Response
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
items[0].Length=790
items[0].Summary.IVS.Rule=CrossLineDetection
DA

items[0].Summary.IVS.Action=Cross
HU

items[0].Summary.IVS.ObjectType=Human

A_

Step 4 Close the finder.


HT

This API is the same as the API in "4.10.5 Find Media Files".
TP

Step 5 Destroy the finder.


_A

This API is the same as the API in "4.10.5 Find Media Files".
PI

4.10.11 Find media files with NonMotor info


fo

Step 1 Create a media files finder.


r

This API is the same as the API in "4.10.5 Find Media Files".
In

Step 2 Start to find media files satisfied the common conditions and NonMotor conditions with
te

the finder
lb

Table 4-124
ra

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findFile
s

Method GET
Start to find media files satisfied the common conditions and NonMotor conditions with
Description
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
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"
+EndTime string O End time to search, ex: "2010-06-25 12:05:00"
+Types array<string> O Search file types
+Flags array<string> O Search flags. It can be: "Timing", "Manual", "Marker", "Event",

General APIs 145


"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.
+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"
"Sliver" "Darkviolet" "Maroon" "Dimgray" "Whitesmoke"
+++Color string O
"Darkorange" "Mistyrose" "Tomato" "Olive" "Gold"
"Darkolivegreen" "Chartreuse" "Greenyellow" "Forestgreen"
"Seagreen" "Deepskyblue" "Cyan" "Other"
NonMotor type, can be : "Non-Motor" "Bicycle" "Tricycle"
DA

"Motorcycle" "DualTriWheelMotorcycle" "LightMotorcycle"


HU

+++Category string O "EmbassyMotorcycle" "MarginalMotorcycle"


"AreaoutMotorcycle" "ForeignMotorcycle" "TrialMotorcycle"
A_

"CoachMotorcycle"
HT

+++Helmet int O Helmet status, 0 : unknown, 1 : without helmet, 2 : with helmet


TP

[ Response Params ] ( OK )
_A

[ Example ]
GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findFile&object=08137&condit
PI

ion.Channel=1&condition.StartTime=2014-1-1%2012:00:00&condition.EndTime=2015-1-1
fo

Request 0%2012:00:00&condition.Types[0]=jpg&condition.DB.NonMotorRecordFilter.NumOfCyclin
g=2&condition.DB.NonMotorRecordFilter.Color=White&condition.DB.NonMotorRecordFilt
r

er.Category=Bicycle&condition.DB.NonMotorRecordFilter.Helmet=1
In

Response OK
te

Step 3 Get the media file information found by the finder


lb

Table 4-125
ra
s

URL http://<server>/cgi-bin/mediaFileFind.cgi?action=findNextFile
Method GET
Description Get the media file information found by the finder
[ Request Params ] ( key=value format at URL )
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.
items array<object> R Result record items.
+Channel int O 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"

General APIs 146


+Type string O File type, should be: "jpg"
+Events array<string> O Events with this record
+FilePath string O File path, string max length is 259
+CutLength int O File length that cut between start time and end time
+Length int O File length of the whole file
+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"
"Sliver" "Darkviolet" "Maroon" "Dimgray" "Whitesmoke"
+++Color string O
"Darkorange" "Mistyrose" "Tomato" "Olive" "Gold"
"Darkolivegreen" "Chartreuse" "Greenyellow" "Forestgreen"
"Seagreen" "Deepskyblue" "Cyan" "Other"
DA

NonMotor type, can be : "Non-Motor" "Bicycle" "Tricycle"


HU

"Motorcycle" "DualTriWheelMotorcycle" "LightMotorcycle"


A_

+++Category string O "EmbassyMotorcycle" "MarginalMotorcycle"


"AreaoutMotorcycle" "ForeignMotorcycle" "TrialMotorcycle"
HT

"CoachMotorcycle"
TP

+++Helmet int O Helmet status, 0 : unknown, 1 : without helmet, 2 : with helmet


_A

[ Example ]
PI

GET http://192.168.1.108/cgi-bin/mediaFileFind.cgi?action=findNextFile&object=08137&
Request
count=100
fo

found=100
items[0].Channel=1
r

items[0].StartTime=2011-1-1 12:00:00
In

items[0].EndTime=2011-1-1 13:00:00
te

items[0].Type=jpg
lb

items[0].Events[0]=NonMotorDetect
items[0].FilePath=/mnt/dvr/sda0/2010/8/11/dav/15:40:50.jpg
ra

Response
items[0].Length=790
s

items[0].SummaryNew.Key=NonMotorRecordFilter
items[0].SummaryNew.Value.NumOfCycling=2
items[0].SummaryNew.Value.Color=White
items[0].SummaryNew.Value.Category=Bicycle
items[0].SummaryNew.Value.Helmet=1

Step 4 Close the finder.
This API is the same as the API in "4.10.5 Find Media Files".
Step 5 Destroy the finder.
This API is the same as the API in "4.10.5 Find Media Files".

4.10.12 Download Media File with the File Name


Download a file by filename. The <Filename> in URL is got by chapter file finding.

General APIs 147


Request URL http://<server>/cgi-bin/RPC_Loadfile/<Filename>
Method GET
Request Params ( none)
Request Example
http://192.168.1.108/cgi-bin/RPC_Loadfile/mnt/sd/2015-01-08/001/dav/19/19.57.12-19.58.25[M][0@0][0
].dav

Response Params (binary data in body )


<binary data>: Binary data pack
Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: Application/octet-stream
Content-Length: xxxx

<file data>
DA
HU

4.10.13 Download Media File between Times


A_

Download the media data between start time and end time.
HT

Request URL http://<server>/cgi-bin/loadfile.cgi?action=startLoad


TP

Method GET
_A

Request Params ( key=value format in URL )


PI

Name Type R/O Description Example


channel int R Channel number; starting from 1 1
fo

startTime string R Start time of the recording in the format “2010-05-25 12:05:00”
r

of: yyyy-mm-dd hh:mm:ss


endTime string R End time of the recording in the format “2010-05-25 12:10:00”
In

of: yyyy-mm-dd hh:mm:ss


te

subtype int O Stream type. 0


lb

If the parameter does not exist, the


ra

default value is 0.
0: Main stream
s

1: Sub stream 1
2: Sub stream 2
Types string O The type of files that are being “dav”
searched for
Request Example
http://192.168.1.108/cgi-bin/loadfile.cgi?action=startLoad&channel=1&startTime=2012-10-8%2013:00:0
1&endTime=2012-10-8%2014:00:01&subtype=0&Types=dav

Response Params (binary data in body )


<binary data>: Binary data pack
Response Example
HTTP/1.1 200 OK
Server: Device/1.0

General APIs 148


Content-Type: Application/octet-stream
Content-Length: xxxx

<file data>

4.10.14 Encrypted Download Media File with the File Name

Table 4-126

http://<server>/cgi-bin/RecordStreamInterleaved.cgi?action=attachStream&path=<File
Syntax
name>[&password=<password>]
Method GET
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
mnt/sd/2019-07-01/001/dav/12/12.36.16-12.36.26[F][0@0][0].dav
HTTP Code: 200 OK
DA

Content-Type: Application/octet-stream
HU

Success Content-Length: <fileLength>


Return Body:
A_

<data>
HT

<data>
TP

Parameters in URL:
_A

Filename: name of media files which would be downloaded.


Comment
password: password for encrypting media file data. if not set password, then use the
PI

preset password
fo

4.11 Log
r
In

4.11.1 Find Logs


te
lb

1. Whether or not found logs satisfied the conditions


ra

Table 4-127
s

http://<server>/cgi-bin/log.cgi?action=startFind&condition.StartTime=<start>&condition
Syntax
.EndTime=<end>[&condition.Type=<type>]
Method GET
Description Start to find log.
Find log between 2011-1-1 12:00:00 and 2011-1-10 12:00:00, URL is:
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
Success token=1
Return count=100
Parameters in URL:
start/end: the start/end time of log. Format is: yyyy-mm-dd hh:mm:ss.
Comment
In response, there is a token for further log finding process. If token is greater than 0,
logs are found; otherwise no logs are found.

General APIs 149


Type: log type. The range is { "System", "Config", "Event", "Storage", "Account", "Data",
"File", "CourseRecord" }.
count: The logcount for the search condition.
2. Get the particular number of logs

Table 4-128

Syntax http://<server>/cgi-bin/log.cgi?action=doFind&token=<TokenValue>&count=<logCount>
Method GET
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
found=2
items[0].RecNo=789
items[0].Time=2011-05-20 11:59:10
items[0].Type=ClearLog
items[0].User=admin
Success items[1].Detail.Compression=H.264->MJPG
DA

Return items[1].Detail.Data=Encode
HU

items[1].RecNo=790
A_

items[1].Time=2011-05-20 11:59:21
HT

items[1].Type=SaveConfig
items[1].User=System
TP


_A

Parameters in URL:
PI

The TokenValue is got by startFind in the above section, and logCount is the count of
Comment
logs for this query.
fo

The maximum value of logCount is 100.


r

Appendix:
In

Field in Description
te

Response
lb

found Count of found log, found is 0 if no log is found.


ra

User User name.


s

Type Log type.


Time Time of this log.
RecNo Log number.
Detail Log details.
3. Stop query logs

Table 4-129

Syntax http://<server>/cgi-bin/log.cgi?action=stopFind&token=<TokenValue>
Method GET
Description Stop query log by token TokenValue.
Example http://192.168.1.108/cgi-bin/log.cgi?action=stopFind&token=1
Success
OK
Return

General APIs 150


Parameters in URL:
Comment
The TokenValue is got by startFind in above section

4.11.2 Clear All the Logs

Table 4-130

Syntax http://<server>/cgi-bin/log.cgi?action=clear
Method GET
Description Clear all the logs.
Example http://192.168.1.108/cgi-bin/log.cgi?action=clear
Success
OK
Return
Comment —
DA

4.11.3 Backup Logs


HU
A_

Table 4-131
HT

http://<server>/cgi-bin/Log.backup?action=All&condition.StartTime=<startTime>&cond
TP

Syntax
ition.EndTime=<endTime>
_A

Method GET
PI

Download the log information between the start time and the end time as a file named
Description
Log.Backup default.
fo

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
r

HTTP/1.1 200 OK
In

CONTENT-LENGTH: 743087
te

CONNECTION: close
lb

Content-type: application/binarytet-stream; charset=utf-8


ra

&w_User: default
s

Success
&Time: 2014-09-01 15:20:45
Return
&Type: VideoLoss
&Content: EventType: VideoLoss
channel: <8>
StartTime: 2014-09-01 15:20:45


Parameters in URL:
startTime/endTime: the start/end time when log info built. 24 hour Format, as:
yyyy-mm-dd hh:mm:ss.
Comment
For example:
2014-8-25 00:02:32
2020-8-25 01:02:32

General APIs 151


4.11.4 Seek Find Logs
http://<server>/cgi-bin/log.cgi?action=doSeekFind&token=<TokenValue>&offset=<offsetVal
Syntax
ue>&count=<logCount>
Method GET
Descripti
Find log with token TokenValue, offset offsetValue and count logCount.
on
http://192.168.1.108/cgi-bin/log.cgi?action=doSeekFind&token=46878&offset=200&count=2
Example
00
found=2
items[0].RecNo=789
items[0].Time=2011-05-20 11:59:10
items[0].Type=ClearLog
items[0].User=admin
DA

items[0].Detail.Compression=H.264->MJPG
HU

items[0].Detail.Data=Encode
Success
items[1].RecNo=790
A_

Return
items[1].Time=2011-05-20 11:59:21
HT

items[1].Type=SaveConfig
TP

items[1].User=System
_A

items[1].Detail.Compression=H.264->MJPG
items[1].Detail.Data=Encode
PI


fo

Parameters in URL:
r

Comme The TokenValue is got by startFind in the above section, and logCount is the count of logs
In

nt for this query.offsetValue is the number which count from the first matched.
te

The maximum value of logCount is 100.


lb
ra

4.11.5 Export Encryped Log


s

Syntax http://<server>/cgi-bin/Log.exportEncrypedLog?action=All&condition.StartTime=<start
Time>&condition.EndTime=<endTime>&condition.Password=<password>
Method GET
Description Get encrypted log in zip format
Example http://192.168.1.108/cgi-bin/Log.exportEncrypedLog?action=All&condition.StartTime=2
014-8-25%2000:02:32&condition.EndTime=2020-8-25%2001:02:32&condition.Passwo
rd=12345
Success HTTP/1.1 200 OK
Return Transfer-Encoding: chunked
CONNECTION: keep_alive
Content-type: application/binarytet-stream; charset=utf-8
The binary data of encrypted log in zip format

General APIs 152


Comment StartTime/EndTime: the start/end time when log info built. 24 hour Format, as:
yyyy-mm-dd hh:mm:ss.
For example:
2014-8-25 00:02:32
2020-8-25 01:02:32
The Password is the input parameter for encrypted log in zip format.
The binary data should be saved as .zip forma

4.12 Upgrader

4.12.1 Strat to Upgrade

Table 4-132

Syntax http://<server>/cgi-bin/upgrader.cgi?action=uploadFirmware
DA

Method POST
HU

Use this message to upload the firmware, and when the device receiving all the data
A_

Description successfully, it will start to upgrade the device, and then use the getState method to get
HT

the state.
TP

POST /cgi-bin/upgrader.cgi?action=uploadFirmware HTTP/1.1


Host: 192.168.1.108
_A

Connection: keep-alive
PI

Content-Type: multipart/form-data; boundary=---------------------------8655433224198


Content-Length: xxxxxxxxx
fo
r

Example -----------------------------8655433224198
In

Content-Disposition:form-data;name="upgrade"; filename= "xxxxxx.bin"


Content-Type: application/octet-stream
te
lb

Firmware data….
ra
s

-----------------------------8655433224198--
Success
OK
Return
Comment —

4.12.2 Get Upgrade State

Table 4-133

Syntax http://<server>/cgi-bin/upgrader.cgi?action=getState
Method GET
Use this message to upload the firmware, and when the device receiving all the data
Description successfully, it will start to upgrade the device, and then use the getState method to get
the state.

General APIs 153


Example http://192.168.1.108/cgi-bin/upgrader.cgi?action=getState
Success state.State=Upgrading
Return state.Progress=45
Parameters in Response:
State: the state of the upgrade, it can be Preparing, Downloading, DownloadFailed,
Comment
Upgrading, Invalid, Failed, Succeeded, Cancelled, and NotEnoughMemory.
Progress: the progress of the upgrade.

4.12.3 Set upgrader url


url with Upgrade packet address
 Request
Syntax http://<server>/cgi-bin/upgrader.cgi?action=updateFirmwareByUrl[&Url=<Url>][&checkTy
pe=<checkType>][&checkSum=<checkSum>]
Method GET
DA

Parameter key=value format at URL


HU

Format
A_

Parameter Type Required Description Example


Url string Y Upgrade package https://aaa/bbb/ccc/license.bin
HT

address, also support ftp


TP

address
_A

checkType int N check method 0


PI

enumint8{
0: MD5
fo

}
checkSum string N Upgrade package f38ad920
r

checksum
In

Example
te

http://<server>/cgi-bin/upgrader.cgi?action=updateFirmwareByUrl=http://yfssp.dahuatech.com/#/approv
lb

al/dhReview/browse/210617165614&checkType=0&checkSum=f38ad920
ra

 Response
s

Parameter Format OK in response


Parameter Type Required Description Example
Example
OK

4.12.4 Cancel Upgrade


 Request
Syntax http://<server>/cgi-bin/upgrader.cgi?action=cancel
Method GET
参数格式 key=value format at URL
Parameter Type Required Description Example

General APIs 154


Example
http://<server>/cgi-bin/upgrader.cgi?action=cancel
 Response
Parameter Format OK in response
Parameter Type Required Description Example
Example
OK

4.12.5 Checking Cloud Update Version


Check cloud update version

Request URL http://<server>/cgi-bin/api/CloudUpgrader/check


Method POST
Request Params ( JSON format in body )
DA

Name Type R/O Description Example


HU

way int32 R Checking methods. 0


A_

enumint8{ 0:
Updating by updating
HT

server through direct


TP

connection. 1:
_A

Checking through
PI

proxy server. 2:
Detecting by acquiring
fo

cached test results. }


proxy object O Proxy server address,
r

valid when way==1


In

(optional).
te

+IP char[40] R Network address "10.1.2.3"


lb

+Port int32 O Port 8080


Request Example
ra

{
s

"way" : 0,
"proxy" : {
"IP" : "10.1.2.3",
"Port" : 8080
}
}

Response Params ( JSON format in body )


Name Type R/O Description Example
info object O Test results
Status enumchar[12 R Update status. "None"
] enumchar[12]{ "None": No
update is detected

General APIs 155


"Regular": Regular update
(It requires user
confirmation, and can only
be updated to a later
version). "Emergency":
Mandatory update (The
device automatically
performs detection and
update, and it can also
degrade to an earlier
version). “Automatic":
Automatic update (The
device automatically
updates when a new
version is available. It is
currently for custom use and
DA

needs to be enabled)}
+PackageType enumchar[32 O Update package type of "all"
HU

] new version. When State is


A_

not None, return


HT

enumchar[32]{
TP

"all": All package.


"ptz": PTZ main control
_A

package.
PI

"web"
"logo"
fo

"custom"
r

"gui"
In

"pd"
"data"
te

"ptz_power": PTZ power.


lb

"ptz_light": PTZ light.


ra

"ptz_heater": PTZ heater.


s

}
+OldVersion char[64] O Old version, which needs to "0000"
be returned when State is
not None.
+NewVersion char[64] O New version, which needs "0004"
to be returned when State is
not None.
+Attention char[2048] O Updated content of the new "What is new"
update package.
+PackageUrl char[256] O Download address of "https://lechange.com/1.zip"
update package (required
for agent upgrade).
+PackageId char[64] O Update package ID "1d2ee7"
+CheckSum char[64] O SHA-256 checksum of the "F3D288AB"

General APIs 156


update package
+BuildTime char[24] O Build time of update "08-10-2018 01:01:02"
package
Response Example
{
"info": {
"State": "None",
"PackageType": "all",
"OldVersion": "0000",
"NewVersion": "0004",
"Attention": "What is new",
"PackageUrl": "https://lechange.com/1.zip",
"PackageId": "1d2ee7",
"CheckSum": "F3D288AB"
"BuildTime": "08-10-2018 01:01:02"
}
DA

}
HU
A_

4.12.6 Performing Online Update


HT
TP

Perform online update


_A

Request URL http://<server>/cgi-bin/api/CloudUpgrader/execute


PI

Method POST
Request Params ( JSON format in body )
fo

Name Type R/O Description Example


r

NewVersion char[64] O If the cloud "2.42.00.001"


In

version is
te

newer than the


new version
lb

obtained in the
ra

last check, the


s

update fails.
way enumint8 R Update method 0
enumint8{ 0:
Updating by
updating server
through direct
connection. 1:
Updating by
proxy server}.
proxy object O Proxy server
address, which
is valid when
way=1
(optional).

General APIs 157


+IP char[40] O Network "10.1.2.3"
address
+Port uint16 O Port 8080
info object O Update
package
information,
which is
needed when
way==1
(optional).
+PackageUrl char[256] O Download "https://lechange.com/1.zip"
address of the
update
package
(required for
agent upgrade).
DA

+PackageId char[64] O Update "1d2ee7"


HU

package ID
+CheckSum char[64] O SHA-256 "F3D288AB"
A_

checksum of
HT

the update
TP

package
_A

Request Example
{
PI

"NewVersion" : "2.42.00.001",
"way" : 0,
fo

"proxy" : {
r

"IP" : "10.1.2.3",
In

"Port" : 8080
te

},
"info" : {
lb

"PackageUrl" : "https://lechange.com/1.zip",
ra

"PackageId" : "1d2ee7",
s

"CheckSum" : "F3D288AB"
}
}

Response Params ( JSON format in body )


Name Type R/O Description Example
Response Example
{}

4.12.7 Canceling Online Update


Cancel the online update during the download process. If you have already started writing Flash, you
cannot cancel the update.

General APIs 158


Request URL http://<server>/cgi-bin/api/CloudUpgrader/cancel
Method GET
Request Params (JSON format in body)
Name Type R/O Description Example
Request Example
{}

Response Params ( JSON format in body )


Name Type R/O Description Example
Response Example
{}

4.13 Http Uploading


DA

4.13.1 [Config] Active Image and Event Uploading


HU
A_

Configure the device to upload images and events to the specified address. Before configuration,
HT

the client should monitor in the specified address. Once the configuration is complete, the device would
TP

upload images and event data to this address using the command described in chapter " 4.13.2 Active
Image and Event Uploading ".
_A

The parameters for uploading image and event are as follows:


PI

Config Data Params


Name Type R/O Description Example
fo

R The parameters for uploading


r

PictureHttpUpload object
image and event
In

+PictureHttpUpload object R Enable or not


te

++Enable bool R Enable or not true


O Authentication "digest”
lb

"basic”: HTTP Basic Authentic


ra

++Type char[16] ation


s

"digest": HTTP Digest Authenti


cation
R The list of servers that receives
+UploadServerList object[]
uploaded information
R IP address or domain name of 192.168.1.208
++Address char[128]
the server
++Port int O Server port 80
++UserName char[32] O Username "abc”
++Password char[128] O Password "123”
++Uploadpath char[128] O Upload path "/example/handlepic.php”
O Code list for uploaded event ["CrossLineDetection","Fa
++EventType char[][32]
ceDetection"]

General APIs 159


Please refer to "4.2.1 Get and Set Configuration" for configuration. The specific example is as
follows:
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PictureHttpUpload
Get Config Response Example
table.PictureHttpUpload.PictureHttpUpload.Enable=true
table.PictureHttpUpload.PictureHttpUpload.Type=digest
table.PictureHttpUpload.UploadServerList[0].Address=192.168.1.208
table.PictureHttpUpload.UploadServerList[0].Port=80
table.PictureHttpUpload.UploadServerList[0].UserName=abc
table.PictureHttpUpload.UploadServerList[0].Password=123
table.PictureHttpUpload.UploadServerList[0].Uploadpath=/example/handlepic.php
table.PictureHttpUpload.UploadServerList[0].EventType[0]=CrossLineDetection
table.PictureHttpUpload.UploadServerList[0].EventType[1]=FaceDetection

Set Config Request Example


DA

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PictureHttpUpload.PictureHttpUpload
HU

.Enable=true&PictureHttpUpload.PictureHttpUpload.Type=digest&PictureHttpUpload.UploadServerList[
0].Address=192.168.1.208&PictureHttpUpload.UploadServerList[0].Port=80&PictureHttpUpload.Upload
A_

ServerList[0].UserName=abc&PictureHttpUpload.UploadServerList[0].Password=123&PictureHttpUploa
HT

d.UploadServerList[0].Uploadpath=/example/handlepic.php&PictureHttpUpload.UploadServerList[0].Ev
TP

entType[0]=CrossLineDetection&PictureHttpUpload.UploadServerList[0].EventType[1]=FaceDetection
_A

Set Config Response Example


OK
PI

4.13.2 Active Image and Event Uploading


fo
r

The device uploads images and event data to the specified address based on the client
In

configuration. For details on the parameters for each event, please refer to the corresponding [Event]
te

chapters. The IP address, port and URL of the uploaded target server is specified by the
PictureHttpUpload. Each set of images and events are sent within one separate HTTP request, in which
lb

multiple of images and events are contained. It is uploaded through multipart.


ra

Request URL http://<Address>:<Port>/<Uploadpath_of_PictureHttpUpload>


s

Method POST
Request Params ( multipart ; JSON in body; binary data in body )
Name Type R/O Description Example
Channel int R video channel, which start from 0 0
Time char[32] R "2022-03-30
Snap picture time
15:40:01"
Events object[] R Event Information list
+Code char[32] R Event Code "FaceRecognition"
+Action char[16] R Event action, with the values of "Start", "Pulse”
"Stop" "Pulse".
+Index int R Event channel number, starting from 0. 0
+Data object R For specific parameters of each event,
please refer to the corresponding chapters
for reference.

General APIs 160


Request Example
POST http://192.168.1.208/example/handlepic.php HTTP/1.1
User-Agent: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/json
Content-Length: <data length>

{
"Channel" : 0,
"TIme" : "2022-03-30 15:40:01"
"Events" : [ {
"Code" : "FaceRecognition",
"Action" : "Pulse",
DA

"Index" : 0
"Data" : {
HU

"UTC" : 123456789,
A_

……
HT

}
TP

}, …, { } ]
}
_A

--<boundary>
PI

Content-Type: image/jpeg
Content-Length: <data length>
fo
r

<jpeg data>
In

--<boundary>

te

--<boundary>--
lb
ra

Response Params ( OK in body )


s

Response Example
OK

4.13.3 [Config] Active Event Uploading


Configure the device to upload event (without image) to the specified address. Before configuration,
the client should monitor in the specified IP address. Once the configuration is complete, the device
would upload event data to this address using the command described in chapter " 4.13.4 Active Event
Uploading ".
The parameters for uploading event are as follows:
Config Data Params
Name Type R/O Description Example
R Parameters for uploading
EventHttpUpload object
event

General APIs 161


+EventHttpUpload object R Whether to enable the function
++Enable bool R Whether to enable the function true
O Authentication Type "digest”
"basic":HTTP Basic Authentic
++Type char[16] ation
"digest" :HTTP Digest Authen
tication
R The server list that receives
+UploadServerList object[]
uploaded information
R IP address or domain name of 192.168.1.208
++Address char[128]
the server
++Port int O Server port 80
++UserName char[32] O Username "abc”
++Password char[128] O Password 123’’
++Uploadpath char[128] O Upload path "/example/handleevt.php”
DA

Please refer to "4.2.1 Get and Set Configuration" for configuration. The specific example is as
HU

follows:
A_

Get Config Request Example


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=EventHttpUpload
HT

Get Config Response Example


TP

table.EventHttpUpload.EventHttpUpload.Enable=true
_A

table.EventHttpUpload.EventHttpUpload.Type=digest
PI

table.EventHttpUpload.UploadServerList[0].Address=192.168.1.208
table.EventHttpUpload.UploadServerList[0].Port=80
fo

table.EventHttpUpload.UploadServerList[0].UserName=abc
table.EventHttpUpload.UploadServerList[0].Password=123
r

table.EventHttpUpload.UploadServerList[0].Uploadpath=/example/handleevt.php
In
te

Set Config Request Example


lb

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&EventHttpUpload.EventHttpUpload.E
ra

nable=true&EventHttpUpload.EventHttpUpload.Type=digest&EventHttpUpload.UploadServerList[0].Add
ress=192.168.1.208&EventHttpUpload.UploadServerList[0].Port=80&EventHttpUpload.UploadServerLis
s

t[0].UserName=abc&EventHttpUpload.UploadServerList[0].Password=123&EventHttpUpload.UploadSe
rverList[0].Uploadpath=/example/handleevt.php
Set Config Response Example
OK

4.13.4 Active Event Uploading


Th device upload event data (without image) to the specified address based on the configuration of
the client. For the specific parameter of each event, please refer to the corresponding [Event] chapters.
The IP address, port and URL of the upload target server is specified by EventHttpUpload. Each event is
sent within one separate HTTP request.
Request URL http://<Address>:<Port>/<Uploadpath_of_EventHttpUpload>
Method POST

General APIs 162


Request Params ( JSON in body )
Name Type R/O Description Example
Code char[32] R Event code "FaceRecognition”
Action char[16] R "Event action, with the values of "Start", "Pulse”
"Stop""Pulse".
Index int R Event channel number, starting from 0 0
Data object R For the specific parameters for each event,
please refer to the corresponding chapters.
Request Example
Request Example
User-Agent: Device/1.0
Content-Type: application/json
Content-Length: <data length>

{
"Code" : "FaceRecognition",
DA

"Action" : "Pulse",
"Index" : 0
HU

Data
A_

"UTC" : 123456789,
HT

...
TP

}
}
_A
PI

Response Params ( OK in body )


Response Example
fo

OK
r
In

4.13.5 [Config] Active Report Data Uploading


te

Configure the device to upload report data to the specified address. Before configuration, the client
lb

should monitor in the specified IP address. Once the configuration is complete, the device would upload
ra

report data to this address using the command described in chapters 4.13.6 ~ 4.13.11.
s

The parameters for uploading image are as follows:


Config Data Params
Name Type R/O Description Example
ReportHttpUpload object R parameters for uploading event
+ReportHttpUpload object R Whether to enable the function
++Enable bool R Whether to enable the function true
O Authentication Type "digest”
"basic" :HTTP basic
++Type char[16] authentication
"digest" :HTTP digest
authentication
++Period int O Upload period (unit: hour) 1
R The server list that receives
+UploadServerList object
uploaded information

General APIs 163


R IP address or domain name of 192.168.1.208
++Address char[128]
the server
++Port int O Server port 80
++UserName char[32] O Username "abc”
++Password char[128] O Password 123’’
++Uploadpath char[128] O Upload path "/example/handleevt.php”
O For the uploaded report data list, ["NumberStat","ObjectDet
specific report data name, ect"]
++ReportType char [ ][40] please refer to the
corresponding command
reporting chapter description.

Please refer to "4.2.1 Get and Set Configuration" for configuration. The specific example is as
follows:
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=EventHttpUpload
DA

Get Config Response Example


HU

table.ReportHttpUpload.ReportHttpUpload.Enable=true
A_

table.ReportHttpUpload.ReportHttpUpload.Type=digest
table.ReportHttpUpload.ReportHttpUpload.Period=1
HT

table.ReportHttpUpload.UploadServerList[0].Address=192.168.1.208
TP

table.ReportHttpUpload.UploadServerList[0].Port=80
_A

table.ReportHttpUpload.UploadServerList[0].UserName=abc
PI

table.ReportHttpUpload.UploadServerList[0].Password=123
table.ReportHttpUpload.UploadServerList[0].Uploadpath=/example/handlerpt.php
fo

table.ReportHttpUpload.UploadServerList[0].ReportType[0]=NumberStat
table.ReportHttpUpload.UploadServerList[0].ReportType[1]=ObjectDetect
r
In

Set Config Request Example


te

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ReportHttpUpload.ReportHttpUpload.
lb

Enable=true&ReportHttpUpload.ReportHttpUpload.Type=digest&ReportHttpUpload.ReportHttpUpload.
ra

Period=1&ReportHttpUpload.UploadServerList[0].Address=192.168.1.208&ReportHttpUpload.UploadS
erverList[0].Port=80&ReportHttpUpload.UploadServerList[0].UserName=abc&ReportHttpUpload.Upload
s

ServerList[0].Password=123&ReportHttpUpload.UploadServerList[0].Uploadpath=/example/handlerpt.p
hp&ReportHttpUpload.UploadServerList[0].ReportType[0]=NumberStat&ReportHttpUpload.UploadServ
erList[0].ReportType[1]=ObjectDetect
Set Config Response Example
OK

4.13.6 People Counting Report Data Uploading


If the client subscribes to the Numberstat (Number Statistics) report data through the
ReportHttpUpload configuration, the device will use this command to upload the data to the specified
address. The IP address, port and URL of the target server is specified by ReportHttpUpload. Each
people counting report data is sent within one separate HTTP request.
Request URL http://<Address>:<Port>/<Uploadpath_of_ReportHttpUpload>

General APIs 164


Method POST
Request Params ( JSON in body )
Name Type R/O Description Example
NumberStat Object[] R NumberStat: each dimension is a channel.
+SN char[32] R Device serial number "1C03E08YAZ00020”
+PeopleCount Object[] O Humber statistics, the number of arrays is
that of the cycles. If the period is an hour,
then the number of array is one. If the
period is three hours, then the number of
array is three.
++StartTime char[20] O Start time "2012-03-14
00:00:00"
EndTime: char[20] O End time "2012-03-14
23:59:59"
++EnteredSubt uint O Subtotal of entered flow 56
otal
DA

++ExitedSubtot uint O Subtotal of exit flow 56


al
HU

++AreaID uint16 O Area ID. 1


A_

port
HT

++Channel int O Channel No. 0


TP

+ManNumDete Object[] O Statistics of the number of the people in the


ction region. The number of arrays equals to that
_A

of the period. If the time of period is an


PI

hour, then the number of array is one. If the


time of the period is three hours, then the
fo

number of array is three.


r

++StartTime char[20] O Start time "2012-03-14


In

00:00:00"
te

EndTime: char[20] O End time "2012-03-14


23:59:59"
lb

++InsideSubtot uint O Used with 56


ra

al ManNumDetection,QueueDetection, the
s

subtotal of number of people in the region


++AreaID uint16 O Area ID. 1
port
++AverageStay uint O Average regional retention time 10
Time
++Channel int O Channel No. 0
+QueueDetecti Object[] O Queuing Management Data. The number
on of arrays equals to that of the period. If the
time of period is an hour, then the number
of array is one. If the time of the period is
three hours, then the number of array is
three.
++StartTime char[20] O Start time "2012-03-14
00:00:00"

General APIs 165


++EndTime char[20] O Statistics end time "2012-03-14
23:59:59"
++InsideSubtot uint O Subtotal people in the area when 56
al ManNumDetection and QueueDetection
are used
++AreaID uint16 O Area ID 1
++AverageStay uint O Average stranding time in area 10
Time
++Channel int O Channel No. 0
Request Example
POST http://192.168.1.208:80/example/handlerpt.php HTTP/1.1
User-Agent: Device/1.0
Content-Type: application/json
Content-Length: <data length>

{
DA

"NumberStat" : [ {
"SN" : "6M053FDYAQ00003"
HU

"ManNumDetection" : [ {
A_

"Channel" : 0,
HT

"EndTime" : "2021-03-11 17:59:59",


TP

"EnteredSubtotal" : 0,
"ExitedSubtotal" : 0,
_A

"StartTime" : "2021-03-11 17:00:00"


PI

}, {
"Channel" : 0,
fo

"EndTime" : "2021-03-11 6:59:59 PM",


r

"EnteredSubtotal" : 0,
In

"ExitedSubtotal" : 0,
"StartTime" : "2021-03-11 6:00:00 PM"
te

}, …, { } ],
lb

"PeopleCount" : [ {
ra

"Channel" : 0,
s

"EndTime" : "2021-03-11 5:59:59 PM",


"EnteredSubtotal" : 0,
"ExitedSubtotal" : 0,
"StartTime" : "2021-03-11 5:00:00 PM"
}, {
"Channel" : 0,
"EndTime" : "2021-03-11 6:59:59 PM",
"EnteredSubtotal" : 0,
"ExitedSubtotal" : 0,
"StartTime" : "2021-03-11 6:00:00 PM"
}, …, { } ],
"QueueDetection" : [ {
"Channel" : 0,
"EndTime" : "2021-03-11 5:59:59 PM",

General APIs 166


"EnteredSubtotal" : 0,
"ExitedSubtotal" : 0,
"StartTime" : "2021-03-11 5:00:00 PM"
}, {
"Channel" : 0,
"EndTime" : "2021-03-11 6:59:59 PM",
"EnteredSubtotal" : 0,
"ExitedSubtotal" : 0,
"StartTime" : "2021-03-11 6:00:00 PM"
}, …, { } ]
}
}

Response Params ( OK in body )


Response Example
OK
DA

4.13.7 Video Structuring Report Data Upload


HU
A_

When the client subscribes ObjectDetect (video Structuring) dashboard, the device will upload video
HT

structuring dashboard to the specified address. The target service address and port, URL are designated
TP

by ReportHttpUpload. Each video structuring report data is sent within one separate HTTP request.
_A

Request URL http://<Address>:<Port>/<Uploadpath_of_ReportHttpUpload>


Method POST
PI

Request Params ( JSON in body )


Name Type R/O Description Example
fo

ObjectDetect Object[] R Video structured data, the first dimension is


r

[] channel, the second dimension is cycle


In

count, the cycle is an hour, the array is 1,


te

the cycle is 3 hours and the array is 3.


SN char[32] R Device SN "1C03E08YAZ00020"
lb

+UTC uint O The end time of statistical Cycle (local UTC 1608508800
ra

time)
s

+UTCMS uint O Milliseconds 0


+Period int O Statistical cycle (unit: minute) 60
+PeriodBySec int O Statistical cycle (unit: second) 60
onds
+MotoVehicles int O Traffic volume of motorized vehicle such as 45
motorbike and tricycles
+Vehicles int O Total count of motorized and non-motorized 0
vehicle
+VehicleTypeFl object O Statistical data on the traffic volume based
ow on vehicle type
++PasserbyVe int O Pedestrian traffic flow 0
hicles
Request Example
POST http://192.168.1.208:80/example/handlerpt.php HTTP/1.1

General APIs 167


User-Agent: Device/1.0
Content-Type: application/json
Content-Length: <data length>

{
"ObjectDetect" : [ [ {
"MotoVehicles" : 8,
"Period" : 60,
"PeriodBySeconds" : 0,
"SN" : "6J0CB81YAG10101",
"UTC" : 1615492800,
"UTCMS" : 0,
"VehicleTypeFlow" : {
"PasserbyVehicles" : 6
},
"Vehicles" : 17
DA

}, …, { } ], …, [ ] ]
}
HU
A_

Response Params ( OK in body )


HT

Response Example
TP

OK
_A

4.13.8 People Flow Heat Map Report Data Upload


PI

When the client subscribes HeatMap (customer flow heat map report data, the device will upload
fo

video structuring data to the specified address. The target service address and port, URL are designated
r

by ReportHttpUpload. Each people flow heat map report data is sent within one separate HTTP request.
In

Request URL http://<Address>:<Port>/<Uploadpath_of_ReportHttpUpload>


te

Method POST
Request Params ( JSON in body )
lb

Name Type R/O Description Example


ra

HeatMap Object[] R Heatmap is presneted in binary format.


s

Each dimension is a channel.


+Channel int O Channel 0
+SN char[32] R Device SN "1C03E08YAZ00020"
+StartTime char[20] O Statistics start Time "2012-03-14
00:00:00"
+EndTime char[20] O Statistics end time "2012-03-14
23:59:59"
+width uint O Image width 200
+height uint O Image height 100
+EncodeData string O base64 encoding of Heat map data "abcd="
Request Example
POST http://192.168.1.208:80/example/handlerpt.php HTTP/1.1
User-Agent: Device/1.0
Content-Type: application/json

General APIs 168


Content-Length: <data length>

{
"HeatMap" : [ {
"Channel" : 0,
"SN" : "66:66:66:56:78:9a",
"StartTime" : "2021-03-12 14:00:00",
"EndTime" : "2021-03-12 15:00:00",
"height" : 64,
"width" : 64
"EncodeData" : "abcd=",
}, …, {} ]
}

Response Params ( OK in body )


Response Example
DA

OK
HU

4.13.9 ANPR Report Data Upload


A_
HT

When the client subscribes RoadFlowStat (road monitoring) report data, the device will upload video
TP

structuring datato the specified address. The target service address and port, URL are designated by
_A

ReportHttpUpload. Each ANPR report data is sent within one separate HTTP request.
Request URL http://<Address>:<Port>/<Uploadpath_of_ReportHttpUpload>
PI

Method POST
Request Params ( JSON in body )
fo

Name Type R/O Description Example


r

RoadFlowStat Object[] R Road monitoring data, the first dimension is


In

[] channel, the second dimension is cycle


te

count. The cycle is an hour and the array is


1. The cycle is 3 hours and the array is 3.
lb

SN char[32] O Device SN "1C03E08YAZ00020"


ra

+UTC uint O End time of statistical cycle 1608508800


s

+UTCMS uint O Milliseconds 0


+Lane int O User defined lane number 1
+PresetID int O PTZ preset, which must greater than 0. 1
+Period int O Statistical cycle (unit: minute) 60
+PeriodBySec int O Statistical cycle (unit: second) 60
onds
+MotoVehicles int O Traffic flow of non-motorized vehicles such 45
as motorbike and tricycles.
+Vehicles int O Total count of motorized and non-motorized 0
vehicle
+VehicleTypeFl object O Statistical data on the traffic volume based
ow on vehicle type
++PasserbyVe int O Pedestrian traffic flow 0
hicles

General APIs 169


Request Example
POST http://192.168.1.208:80/example/handlerpt.php HTTP/1.1
User-Agent: Device/1.0
Content-Type: application/json
Content-Length: <data length>

{
"RoadFlowStat" : [ [ {
"SN" : "6J0CB81YAG10101",
"UTC" : 1615485600,
"UTCMS" : 0,
"Lane" : 1,
"PresetID" : 0,
"Period" : 60,
"PeriodBySeconds" : 0,
"MotoVehicles" : 0,
DA

"Vehicles" : 26506
"VehicleTypeFlow" : {
HU

"PasserbyVehicles" : 0
A_

},
HT

}, …, { } ], … , [ ] ]
TP

}
_A

Response Params ( OK in body )


PI

Response Example
OK
fo
r

4.13.10 Crowd Distribution Report Data upload


In
te

When the client subscribes CrowdDistriMap (Crowd Distribution) report data, the device will upload
video structuring data to the specified address. The target service address and port, URL are designated
lb

by ReportHttpUpload. Each crowd distribution report data is sent within one separate HTTP request.
ra

Request URL http://<Address>:<Port>/<Uploadpath_of_ReportHttpUpload>


s

Method POST
Request Params ( JSON in body )
Name Type R/O Description Example
CrowdDistriMap Object[] R Data statistics on crowd distribution.
Each dimension is the data of a
channel.
SN char[32] O Device SN "1C03E08YAZ00020"
+CrowdDistriMap object O Report Data on Crowd Distribution
Map
++DataList object[64] O Return Crowd Distribution Map data 1
list. The array size is 64 at most.
+++UTC uint32 O UTC time (local UTC time) when the 6555478
data is recorded
+++AreaName char[32] O Statistics Area name "CMD-5"

General APIs 170


+++PeopleNum int O The number of people in statistics area 60
Request Example
POST http://192.168.1.208:80/example/handlerpt.php HTTP/1.1
User-Agent: Device/1.0
Content-Type: application/json
Content-Length: <data length>

{
"CrowdDistriMap" : [ {
"CrowdDistriMap" : {
"DataList" : [ {
"AreaName" : "CDM-1",
"PeopleNum" : 0,
"UTC" : 1617375600
}, {
"AreaName" : "CDM-1",
DA

"PeopleNum" : 0,
"UTC" : 1617379200
HU

}]
A_

},
HT

"SN" : "7B0606BYAQ00010"
TP

}, … , { } ]
}
_A
PI

Response Params ( OK in body )


Response Example
fo

OK
r
In

4.13.11 Vehicle Density Report Data Upload


te

When the client subscribes VehiclesDistri vehicle density) report data, the device will upload video
lb

structuring data to the specified address. The target service address and port, URL are designated by
ra

ReportHttpUpload. Each vehicle density report data is sent within one separate HTTP request.
s

Request URL http://<Address>:<Port>/<Uploadpath_of_ReportHttpUpload>


Method POST
Request Params ( JSON in body )
Name Type R/O Description Example
VehiclesDistri Object[] R Data statistics on vehicle density
distribution. Each dimension is the data
of a channel.
+SN char[32] O Device SN "1C03E08YAZ00020"
+CongestionDetec object O The data report of vehicle density 0
tion congestion rules.
++DataNum uint32 O Number of returned entires on vehicle 60
congestion rules.
++DataList object[] O The data list of vehicle congestion
rules. The array size equal to DataNum

General APIs 171


and the element is 64 at most.
+++UTC uint32 O UTC time (local UTC time) when the 3665789
data is recorded
+++RuleName char[32] O Rule name "VD-1"
+++VehiclesNum int O The number of vehicles 32
+VehicleLimitDete object O The report data of traffic flow limit 0
ction detection rules
++DataNum uint32 O Returned data entries on the traffic flow 1
limit rules
++DataList object[] O The data list of traffic flow limit
detection rules. 64 elements at most.
+++UTC uint32 O UTC time when the data is recorded 3665789
+++RuleName char[32] O Rule name
+++VehiclesNum int O The number of vehicles 40
Request Example
POST http://192.168.1.208:80/example/handlerpt.php HTTP/1.1
DA

User-Agent: Device/1.0
HU

Content-Type: application/json
Content-Length: <data length>
A_
HT

{
TP

"VehiclesDistri" : [ {
"CongestionDetection" : {
_A

"DataList" : [ {
PI

"RuleName" : "VD-1",
"UTC" : 1617375600,
fo

"VehiclesNum" : 0
r

}, {
In

"RuleName" : "VD-1",
te

"UTC" : 1617379200,
"VehiclesNum" : 0
lb

} ],
ra

"DataNum" : 2
s

},
"SN" : "7B0606BYAQ00010",
"VehicleLimitDetection" : {
"DataNum" : 0
}
}, … , { } ]
}

Response Params ( OK in body )


Response Example
OK

General APIs 172


5 Camera APIs
5.1 Image

5.1.1 Brightness, Contrast and Saturation

 Get brightness, contrast and saturation

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
Method GET
Description Get brightness, contrast and saturation
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
DA

Success head.Name=Day,
HU

Return head.Brightness=50,
head.Contrast=50,
A_

head.Saturation=50,
HT

head.Hue=50,
TP

head.Gamma=50,
_A

head.ChromaSuppress=50,
head.Style=Standard,
PI

head.TimeSection=1 00:00:00-24:00:00
Comment Parameters in URL:
fo

paramName and paramValue are as table below.


r

In table below,
In

head = table.VideoInSharpness [ChannelNo] [ConfigNo]


te

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

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
ra

night, and 2 means config for normal scene.


s

 Set brightness, contrast and saturation

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set brightness, contrast and saturation
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoColor[0][0].Brig
Example
htness=50
Success
OK
Return
Parameters in URL:
Comment paramName and paramValue are as table below.
In table below,

Camera APIs 173


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:

ParamName ParamValue type Description


head.Brightness integer Brightness, range is [0—100]
head.Contrast integer Contrast, range is [0—100]
head.Saturation integer Saturation, range is [0—100]

5.1.2 Sharpness
 Get sharpness
DA

Table 5-1
HU

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInSharpness
A_

Method GET
HT

Description Get sharpness


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInSharp
TP

Example
ness
_A

Success head.Level=4
PI

Return head.Sharpness=8
Parameters in URL:
fo

paramName and paramValue are as table below.


r

In table below,
In

head = table.VideoInSharpness [ChannelNo] [ConfigNo]


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

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


lb

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
ra

night, and 2 means config for normal scene.


s

 Set sharpness

Table 5-2

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set sharpness
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInSharpness[0]
Example
[0].Level=10&VideoInSharpness[0][0].Mode=1&VideoInSharpness[0][0].Sharpness=0
Success
OK
Return
Parameters in URL:
Comment
paramName and paramValue are as table below.

Camera APIs 174


In table below,
head = 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:

ParamName ParamValue type Description


head.Sharpness integer Range is 0—100
head.Level integer Range is 0—100

5.1.3 Flip, Mirror and Rotate90


 Get flip, mirror and Rotate90
DA

Table 5-3
HU

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoImageControl
A_

Method GET
HT

Description Get flip, mirror and Rotate90


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoImageC
TP

Example
ontrol
_A

head.Flip=true
Success
PI

head.Mirror=false
Return
head.Rotate90=0
fo

Parameters in Response:
r

head = table.VideoImageControl [ChannelNo]


In

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

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
lb

night, and 2 means config for normal scene.


ra

 Set flip, mirror and Rotate90


s

Table 5-4

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set flip, mirror and Rotate90
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoImageControl[
Example
0].Flip=true
Success
OK
Return
Parameters in URL:
Comment head = VideoImageControl [ChannelNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to

Camera APIs 175


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


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:
head.Rotate90 integer 0: No rotate
1: clockwise rotate 90°
2: anticlockwise rotate 90°
DA
HU

5.2 Exposure
A_
HT

5.2.1 Exposure Config


TP

 Get exposure
_A
PI

Table 5-5
fo

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

Description Get exposure


In

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

ure
lb

head.AntiFlicker=0
head.Gain=50
ra

head.GainMax=50
s

head.GainMin=0
Success
head.Iris=50
Return
head.IrisAuto=false
head.Mode=0
head.Value1=40
head.Value2=40
Parameters in Response:
head = table.VideoInExposure[ChannelNo][ConfigNo]
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.

 Set exposure

Camera APIs 176


Table 5-6

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set exposure
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
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.
DA

Appendix:
HU

ParamName ParamValue type Description


A_

Range is {0,1,2}
HT

AntiFlicker mode:
TP

head.AntiFlicker integer 0: Outdoor


_A

1: 50 Hz AntiFlicker
2: 60 Hz AntiFlicker
PI

Range is [0—100]
fo

head.Gain integer If GainAuto is true, it's upper limit of auto gain,


else it's the fixed gain adjust value.
r

Range is 0–100; the value must be greater than


In

head.GainMax integer
GainMin.
te

Range is 0–100; the value must be smaller than


head.GainMin integer
lb

GainMax.
head.Iris integer Manual Iris setting. Range is 0–100.
ra

Enable Iris automatically.


s

true: IrisAuto
head.IrisAuto bool
false: No IrisAuto

0: "Auto" by default
1: Low noise
2: Anti-smear
4: Manual (range)
head.Mode integer 5: Aperture priority
6: Manual (fixed)
7: Gain priority
8: Shutter priority
9: Flash light matching mode
Range is [0-1000], unit is millisecond
head.Value1 float
If ExposureSpeed is 0(AutoExposure enable), it's

Camera APIs 177


ParamName ParamValue type Description
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

5.3 Backlight

5.3.1 Backlight Config


 Get backlight

Table 5-7

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInBacklight
DA

Method GET
HU

Description Get backlight


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInBackli
A_

Example
ght
HT

head.GlareInhibition=50
Success
TP

head.Mode=Off
Return
_A

head.WideDynamicRange=50
Parameters in Response:
PI

head = table.VideoInBacklight[ChannelNo][ConfigNo]
fo

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

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for
In

night, and 2 means config for normal scene.


te

 Set backlight
lb
ra

Table 5-8
s

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set backlight
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInBacklight[0][
Example
0].GlareInhibition=50
Success
OK
Return
Parameters in URL:
head = VideoInBacklight[ChannelNo][ConfigNo]
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.

Camera APIs 178


Appendix:

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
SSA: Scene adaptation
head.WideDynamicRange integer Range is 1–100.

5.4 White Balance

5.4.1 White Balance Config


DA

 Get white balance


HU

Table 5-9
A_
HT

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInWhiteBalan
Syntax
TP

ce
Method GET
_A

Description Get white balance


PI

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

head.GainBlue=50
Success
r

head.GainRed=50
Return
In

head.Mode=Auto
Parameters in Response:
te

head = table.VideoInWhiteBalance[ChannelNo][ColorConfigNo]
lb

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

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


s

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.

 Set white balance

Table 5-10

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set white balance
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInWhiteBalanc
Example
e[0][0].GainBlue=50
Success
OK
Return

Camera APIs 179


Parameters in URL:
head = VideoInWhiteBalance[ChannelNo][ConfigNo]
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:

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."
Auto; Indoor; Outdoor; ATW; Manual; Sodium;
head.Mode char[][32]
DA

Natural; StreetLamp; ManualDatum


HU
A_

5.5 Day-Night
HT
TP

5.5.1 Day-Night Config


_A
PI

 Get day-night
fo

Table 5-11
r

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInDayNight
In

Method GET
te

Description Get day-night


lb

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

head.Delay=10
Success head.Mode=Brightness
s

Return head.Sensitivity=2
head.Type=Mechanism
head = table.VideoInDayNight[ChannelNo][ConfigNo]:
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.

 Set Day-Night

Table 5-12

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

Camera APIs 180


Method SET
Description Set day-night
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInDayNight[0][
Example
0].Mode=BlackWhite
Success
OK
Return
Parameters in URL:
Comment ParamName and paramValue are as table below. In table below,
head = VideoInDayNight[ChannelNo][ConfigNo]
Appendix:
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"
DA

head.Mode string "Brightness": Day/Night Auto


HU

"BlackWhite": Always black-and-white


A_

"Photoresistor": Switch according to photoresistor,


"Gain": Switch according to gain
HT

head.Sensitivity integer Range is [1-3]. Sensitivity of switching mode


TP

Range is [2-10].
head.Delay integer
_A

Delay seconds when switching mode.


PI

5.6 Zoom and Focus


fo

To get the capability set of video input, refer to 4.5.12. For instance, you can use the following URL:
r

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

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 .
te

5.6.1 Adjust Focus


lb
ra

Adjust magnification and focus.


s

Request URL http://<server>/cgi-bin/devVideoInput.cgi?action=adjustFocus


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O The video channel number which starts 1
from 1, and the default value is 1.
focus double O Relative stepping position of the vari-focal 0.5
motor; range: [0–1].
-1 means resetting.
zoom double O Relative stepping position of the zoom -0.5
motor; range: [0–1].
-1 means resetting.
Request Example

Camera APIs 181


http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.5&zoom=-0.5

Response Params ( OK in body )


Response Example
OK

5.6.2 Adjust Focus Continuously


Continuously adjust magnification and focus. Firstly, send a "non-zero" value to start zooming and
adjusting the focal length to drive the motor to move, and then send “0” to stop the motor from moving. If
only one of the operations is required, set the value of the other operation as -1.

Request URL http://<server>/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O The video channel number which starts 1
DA

from 1, and the default value is 1.


HU

focus double O Relative focusing rate; range: [-1,1]. 0.02


A_

-1: No operation
0: Stop
HT

Positive number: Moving forward


TP

Negative number: Moving backward


_A

zoom double O Relative zooming rate; range: [-1,1]. -1


PI

-1: No operation
0: Stop
fo

Request Example
r

http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&channel=1&focus=0.0
2&zoom=-1
In
te

Response Params ( OK in body )


lb

Response Example
ra

OK
s

5.6.3 Auto Focus


Auto focus.

Request URL http://<server>/cgi-bin/devVideoInput.cgi?action=autoFocus


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O The video channel number which starts 1
from 1, and the default value is 1.
Request Example
http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=autoFocus&channel=1

Response Params ( OK in body )

Camera APIs 182


Response Example
OK

5.6.4 Get Focus Status


Get the focusing status.

Request URL http://<server>/cgi-bin/devVideoInput.cgi?action=getFocusStatus


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O The video channel number which starts 1
from 1, and the default value is 1.
Request Example
http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getFocusStatus&channel=1

Response Params ( key=value format in body )


DA

Name Type R/O Description Example


HU

status object R Return the status information


A_

Relative stepping position of the focusing motor; 0.8


+Focus double R
HT

range: [0,1]
Relative stepping position of the zooming motor; 0.3
TP

+Zoom double R
range: [0,1]
_A

Focusing status "Normal"


PI

+Status char[16] R "Normal": Normal


"Autofocus": Auto focusing
fo

Response Example
r

status.Focus=0.8
In

status.Zoom=0.3
status.Status=Normal
te
lb

5.6.5 [Config] Zoom Config


ra

Zooming configuration parameter:


s

Config Data Params


Name Type R/O Description Example
VideoInZoom object[][] R Zooming configuration parameter;
two-dimensional array.
The first dimension represents the video
channel which starts from 1, and the
second dimension represents the lighting
scene. The beginning three elements
constantly represent day, night and
general scene.
+Name char[16] O Scene name "Day"
+Speed int O Zooming speed; range: [0–100] 8
+DigitalZoom bool O Whether to enable digital zoom true

Camera APIs 183


For getting and setting the configurations, see 4.2.1 Get and Set Configure”.
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoom
Get Config Response Example
table.VideoInZoom[0][0].Name=Day
table.VideoInZoom[0][0].Speed=8
table.VideoInZoom[0][0].DigitalZoom=true

Set Config Request Example


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInZoom[0][0].DigitalZoom=false
&VideoInZoom[0][0].Speed=8
Set Config Response Example
OK
DA

 Get zoom
HU
A_

Table 5-13
HT

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoom
TP

Method GET
_A

Description Get zoom


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInZoo
PI

Example
m
fo

head.DigitalZoom=true
Success Return
head.Speed=7
r

Parameters in URL:
In

head = table.VideoInZoom[ChannelNo][ConfigNo]
te

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

ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means


ra
s

 Set zoom

Table 5-14

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method SET
Description Set zoom
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInZoom[0][0].D
Example
igitalZoom=false&VideoInZoom[0][0].Speed=8
Success
OK
Return
Parameters in URL:
Comment head = VideoInZoom[ChannelNo][ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to

Camera APIs 184


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


true: Enable Digital Zoom
head.DigitalZoom integer
false: Disable Digital Zoom
head.Speed integer Range is 0—100

5.6.6 [Config] Focus Config


Vari-focal configuration parameter:
Config Data Params
Name Type R/O Description Example
VideoInFocus object[][] R Vari-focal configuration parameter;
DA

two-dimensional array.
HU

The first dimension represents the video


channel which starts from 1, and the
A_

second dimension represents the lighting


HT

scene. The beginning three elements


TP

constantly represent day, night and general


_A

scene.
+Name char[16] O Scene name "Day"
PI

+Mode int O Focus mode 2


2: Auto focus
fo

3: Semi Auto (Customizable, uses auto


r

focus first, and then locks the focusing


In

module. Auto focus is not available at the


te

time, and you have to manually adjust the


focal length.)
lb

4: Manual focus
ra

+FocusLimit int O Recommended limit value of near-field 2000


s

focusing; unit: mm.


The value range depends on the device
capability.
+FocusFarLimit int O Recommended limit value of far-field 5000
focusing; unit: mm.
The value range depends on the device
capability.
+AutoFocusTrace int O Vari-focal tracking 1
0: Close
1: Open
+IRCorrection int O IR light focusing and correction 1
0: No correction
1: Manual correction
2: Auto correction

Camera APIs 185


+Sensitivity int O Focusing sensitivity 1
0: High
1: Default
2: Low
+FocusLimitSelect char[16] O Focuings limit mode (The distance limit for "Auto"
Mode near-field focusing)
"Manual"
"Auto"

For getting and setting the configurations, see 4.2.1 Get and Set Configure”.
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoInFocus
Get Config Response Example
table.VideoInFocus[0][0].Name=Day
table.VideoInFocus[0][0].Mode=0
table.VideoInFocus[0][0].Sensitivity=1
DA

table.VideoInFocus[0][0].FocusLimitSelectMode=Manual,
HU

table.VideoInFocus[0][0].FocusLimit=2000
A_

table.VideoInFocus[0][0].FocusFarLimit=5000
table.VideoInFocus[0][0].AutoFocusTrace=0
HT

table.VideoInFocus[0][0].IRCorrection=0
TP


_A
PI

Set Config Request Example


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInFocus[0][0].FocusLimit=2000
fo

&VideoInFocus[0][0].FocusFarLimit=5000&VideoInFocus[0][0].Sensitivity=1
r

Set Config Response Example


OK
In
te

5.7 Lighting
lb
ra

5.7.1 Lighting Config


s

 Get lighting

Table 5-15

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Lighting
Method GET
Description Get lighting
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Lighting
head.Correction=50
head.FarLight[0].Angle=0
Success
head.FarLight[0].Light=0
Return
head.Mode=ZoomPrio
head.NearLight[0].Angle=0

Camera APIs 186


head.NearLight[0].Light=0
head.MiddleLight[0].Angle=50
head.MiddleLight[0].Light=50
head = table.Lighting[ChannelNo][ConfigNo]:
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.

 Set lighting

Table 5-16

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set lighting
DA

Turn on light:
HU

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].FarLig
A_

ht[0].Light=10&Lighting[0][0].NearLight[0].Light=90&Lighting[0][0].Mode=Manual
Example
HT

Shift the light to ZoomPrio mode:


TP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].Correct
_A

ion=50&Lighting[0][0].Mode=ZoomPrio
PI

Success
OK
Return
fo

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

In table below,
In

Comment head = Lighting[ChannelNo][ConfigNo]


te

Some lighting equipment has the following restriction:


lb

Lighting[0][0].FarLight[0].Light + Lighting[0][0].NearLight[0].Light+ Lighting[0][0].


MiddleLight [0]. Light <=100.
ra
s

Appendix:

ParamName ParamValue type Description


Light mode.
The range is {"Manual", "Auto", "Off",
"ZoomPrio"}.
head.Mode string
The following are special for composite lamps.
The range is { "Timing" , "SmartLight" ,
"ExclusiveManual" }
Light compensation.
head.Correction integer The range is [0—100], effective in ZoomPrio
mode.
Range is [0—100].
head.FarLight[Index].Light integer
The luminance of far light.

Camera APIs 187


ParamName ParamValue type Description
Range is [0—100].
head.MiddleLight[Index].Light integer
The luminance of middle light.
Range is [0—100].
head.NearLight[Index].Light integer
The luminance of near light.

5.8 Video in Options

5.8.1 Video in Options Config


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.
 Get video in options

Table 5-17
DA

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoInOptions
HU

Method GET
Get video in options config, such as Backlight, ExposureSpeed, DayNightColor,
A_

Description
DayOptions, NightOptions, and NormalOptions.
HT

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

ns
_A

head.Backlight=0
PI

head.DayNightColor=false
head.ExposureSpeed=0
fo

head.ExposureValue1=0.100000
head.ExposureValue2=80.000000
r

head.ExternalSync=0
In

head.ExternalSyncPhase=0
te

head.FlashControl.Mode=0
lb

head.FlashControl.Pole=0
head.FlashControl.Value=0
ra

head.FlashControl.PreValue=0
s

head.Flip=false
Success
head.Gain=50
Return
head.GainAuto=true
head.IrisAuto=false
head.Mirror=false
head.NightOptions.AntiFlicker=0
head.NightOptions.Backlight=0
head.NightOptions.BacklightRegion[0]=3096
head.NightOptions.BacklightRegion[1]=3096
head.NightOptions.BacklightRegion[2]=5096
head.NightOptions.BacklightRegion[3]=5096
head.NightOptions.BrightnessThreshold=50
head.NightOptions.DayNightColor=2
head.NightOptions.ExposureMode=0

Camera APIs 188


head.NightOptions.ExposureSpeed=0
head.NightOptions.ExposureValue1=0
head.NightOptions.ExposureValue2=40
head.NightOptions.ExternalSyncPhase=125
head.NightOptions.Flip=false
head.NightOptions.Gain=50
head.NightOptions.GainAuto=true
head.NightOptions.GainBlue=50
head.NightOptions.GainGreen=50
head.NightOptions.GainMax=50
head.NightOptions.GainMin=0
head.NightOptions.GainRed=50
head.NightOptions.GlareInhibition=0
head.NightOptions.IrisAuto=true
head.NightOptions.Mirror=false
head.NightOptions.Profile=3
DA

head.NightOptions.ReferenceLevel=50
HU

head.NightOptions.Rotate90=0
head.NightOptions.SunriseHour=0
A_

head.NightOptions.SunriseMinute=0
HT

head.NightOptions.SunriseSecond=0
TP

head.NightOptions.SunsetHour=23
_A

head.NightOptions.SunsetMinute=59
head.NightOptions.SunsetSecond=59
PI

head.NightOptions.SwitchMode=4
head.NightOptions.WhiteBalance=Auto
fo

head.NightOptions.WideDynamicRange=0
r

head.NightOptions.WideDynamicRangeMode=0
In

head.NormalOptions.AntiFlicker=0
te

head.NormalOptions.Backlight=0
head.NormalOptions.BacklightRegion[0]=3096
lb

head.NormalOptions.BacklightRegion[1]=3096
ra

head.NormalOptions.BacklightRegion[2]=5096
s

head.NormalOptions.BacklightRegion[3]=5096
head.NormalOptions.BrightnessThreshold=50
head.NormalOptions.DayNightColor=1
head.NormalOptions.ExposureMode=0
head.NormalOptions.ExposureSpeed=0
head.NormalOptions.ExposureValue1=0
head.NormalOptions.ExposureValue2=40
head.NormalOptions.ExternalSyncPhase=125
head.NormalOptions.Flip=false
head.NormalOptions.Gain=50
head.NormalOptions.GainAuto=true
head.NormalOptions.GainBlue=50
head.NormalOptions.GainGreen=50
head.NormalOptions.GainMax=50

Camera APIs 189


head.NormalOptions.GainMin=0
head.NormalOptions.GainRed=50
head.NormalOptions.GlareInhibition=0
head.NormalOptions.IrisAuto=true
head.NormalOptions.Mirror=false
head.NormalOptions.Profile=0
head.NormalOptions.ReferenceLevel=50
head.NormalOptions.Rotate90=0
head.NormalOptions.SunriseHour=0
head.NormalOptions.SunriseMinute=0
head.NormalOptions.SunriseSecond=0
head.NormalOptions.SunsetHour=23
head.NormalOptions.SunsetMinute=59
head.NormalOptions.SunsetSecond=59
head.NormalOptions.SwitchMode=0
head.ReferenceLevel=50
DA

head.ReferenceLevelEnable=false
HU

head.Rotate90=0
head.SignalFormat=BT656
A_

head.WhiteBalance=Disable
HT

Parameters in Response:
TP

head = table.VideoInOptions[ChannelNo]
Comment
ChannelNo: integer, array index starts from 0, which means video channel (equals to
_A

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


PI

 Set video in options


fo

Table 5-18
r

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

Syntax
alue>[&<paramName>=<paramValue>…]
te

Method GET
lb

Set video in options config, such as Backlight, ExposureSpeed, DayNightColor,


Description
ra

DayOptions, NightOptions, and NormalOptions.


Set Auto Exposure:
s

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=0&VideoInOptions[0].ExposureSpeed=0

Set Low Noise:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=1&VideoInOptions[0].ExposureSpeed=0&VideoInOptions[0].GainMin=0
Example
&VideoInOptions[0].GainMax=60

Set Low Motion Blur:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=2&VideoInOptions[0].ExposureSpeed=0&VideoInOptions[0].GainMin=0
&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=0&VideoInOptio
ns[0].ExposureValue2=20

Camera APIs 190


Set Manual:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].E
xposureMode=4&VideoInOptions[0].ExposureSpeed=32&VideoInOptions[0].GainMin=
0&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=40&VideoInOp
tions[0].ExposureValue2=40

Set SmartIRExposure:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].S
martIRExposure=true

Set Video Rotate:


Filp:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].Fli
p=true
Mirror:
DA

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].Mi
rror=true
HU

Or turn 90°:
A_

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].R
HT

otate90=1
TP

Set White Balance:


_A

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
PI

hiteBalance=Night
Or
fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
r

hiteBalance=Custom&VideoInOptions[0].GainRed=50&VideoInOptions[0].GainBlue=50
In

&VideoInOptions[0].GainGreen=50
(Sometimes you should set mode first before set GainRed or GainBlue:
te

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].W
lb

hiteBalance=Custom )
ra

Success
OK
s

Return
Parameters in URL:
In table below, head = VideoInOptions[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).

Appendix:

ParamName ParamValue type Description


Range is [0—n]
n depends on capability in GetVideoInputCaps
0: backlight closed.
head.Backlight integer
1: backlight grade 1
...
n - backlight grade n

Camera APIs 191


ParamName ParamValue type Description
Range is {0,1,2}
0: always multicolor
head.DayNightColor integer
1: autoswitch along with brightness,
2: always monochrome
Range is {0,1,2, 4}
0: AutoExposure
head.ExposureMode integer 1: Gain first
2: Exposure first
4: Manual.
Range is [0 — n+1]
n depends on capability in GetVideoInputCaps
0: AutoExposure
head.ExposureSpeed integer 1-n-1: manual Exposure grade
n: AutoExposure with time limit.
n+1: manualExposure with user-defined time
DA

(n is supported maximum exposure grade )


HU

Range is [0.1—80], unit is millisecond


If ExposureSpeed is 0(AutoExposure enable), it's
A_

head.ExposureValue1 float
lower limit of AutoExposure time, otherwise it's
HT

time of manualExposure
TP

Range is [0.1-80], unit is millisecond


_A

head.ExposureValue2 float Upper limit of AutoExposure time, should be bigger


than ExposureValue1
PI

Range is {0,1}
External Synchronous
fo

head.ExternalSync integer
0: Internal Synchronization
r

1: External Synchronous
In

Range is [0°—360°]
head.ExternalSyncPhase foat
te

External Synchronous Signal Phase


bool true: enable, false: disable
lb

head.SmartIRExposure
Range is {0,1,2}
ra

0: forbid flash
integer
s

head.FlashControl.Mode
1: always flash
2: auto flash
Range is {0,1, 2, 3}
Trigger mode:
0: low level
head.FlashControl.Pole integer
1: high level
2: rising-edge
3: falling-edge

Camera APIs 192


ParamName ParamValue type Description
Range is [0—15]
Flashlight time-unit:
0: 0us,
1: 64us,
head.FlashControl.Value integer
2: 128us,
3: 192us

15 - 960us
Range is [0—100]
head.FlashControl.PreValue integer It is threshold of brightness value: if brightness is
less than this value, flash light will begin to work.
true: enable video flip function
head.Flip bool
false: disable video flip function
Range is [0—100]
head.Gain integer If GainAuto is true, it's upper limit of auto gain, else
DA

it's the fixed gain adjust value.


HU

Range is [0—100]
head.GainBlue integer Gain for blue value, Value is effective when
A_

WhiteBalance is "Custom."
HT

Range is [0—100]
TP

head.GainRed integer Gain for red value, Value is effective when


_A

WhiteBalance is "Custom."
Range is [0—100]
PI

head.GainGreen integer Gain for green value, Value is effective when


WhiteBalance is "Custom."
fo

true: GainAuto
r

head.GainAuto bool
false: No GainAuto
In

true: IrisAuto
head.IrisAuto bool
te

false: No IrisAuto
lb

true: enable video mirror function


head.Mirror bool
false: disable video mirror function
ra

White balance Mode.


s

Range is {Disable, Auto, Custom, Sunny, Cloudy,


Home, Office, Night}
Some IPC supports common modes: "Disable",
head.WhiteBalance String "Auto", "Sunny", "Night", "Outdoor", "Custom"
Sometimes the device support other advanced
modes: "CustomColorTemperature", "Indoor",
"ATW", "Manual", "AutoOutdoor", "ManualDatum"
and so on.
Range is [0—100]
head.ReferenceLevel integer The expected average brightness level of video
frames.

Camera APIs 193


ParamName ParamValue type Description
Range is {0,1,2}
Video rotation:
head.Rotate90 integer 0: No rotate
1: clockwise rotate 90°
2: anticlockwise rotate 90°
Range is {Inside, BT656, 720p, 1080p, 1080i,
head.SignalFormat String 1080sF}
Input Signal Mode
Range is {0,1,2}
AntiFlicker mode:
head.AntiFlicker integer 0: Outdoor
1: 50 Hz AntiFlicker
2: 60 Hz AntiFlicker
Range is [0—100]
head.GlareInhibition integer GlareInhibition:
DA

0: Close GlareInhibition.
HU

NightOptions contain a set of parameters used


when brightness is not enough.
A_

head.NightOptions.Brightnes Range is [0—100]


HT

integer
sThreshold when brightness is less than the
TP

BrightnessThreshold, parameters change to


_A

Nightoptions.
true: IrisAuto
PI

head.NightOptions.IrisAuto bool
false: No IrisAuto
Range is [00—23]
fo

head.NightOptions.SunriseH
integer
our Sunrise hour.
r

head.NightOptions.SunriseMi Range is [00—59]


integer
In

nute Sunrise minute


te

head.NightOptions.SunriseS Range is [00—59]


integer
econd Sunrise second
lb

head.NightOptions.SunsetHo
ra

integer
ur Sunset time. Its range is same with sunrise time,
s

head.NightOptions.SunsetMi and it should be after sunrise time.


integer
nute NightOptions are used if time is after sunset time
head.NightOptions.SunsetSe and before sunrise time.
integer
cond
Range is {0,1,2}
0: NoSwitch, always use day options.
1: Switch depends on brightness.
head.NightOptions.SwitchMo
integer 2: Switch depends on time, switch to NightOptions
de
when time is after sunset time and before sunrise.
3: NoSwitch, always use NightOptions.
4: No switch, always use NormalOptions.

Camera APIs 194


ParamName ParamValue type Description
Range is {0,1,2,3}
0: use temporary day options.
head.NightOptions.Profile integer 1: use temporary NightOptions.
2: use temporary NormalOptions.
3: depends on head.NightOptions.SwitchMode
head.NightOptions.Exposure
integer
Speed
head.NightOptions.Exposure
float
Value1
head.NightOptions.Exposure
float
Value2
head.NightOptions.Gain integer
head.NightOptions.GainAuto bool
head.NightOptions.GainBlue integer
head.NightOptions.GainGree
integer
DA

n
HU

head.NightOptions.GainRed integer
A_

head.NightOptions.WhiteBal
String Range is the same as relevant items of day
ance
HT

options in this table.


head.NightOptions.Referenc
TP

integer Example:
eLevel
Value range of head.NightOptions.ExposureSpeed
_A

head.NightOptions.ExternalS
float is the same with head. ExposureSpeed.
PI

yncPhase
head.NightOptions.AntiFlicke
integer
fo

r
integer
r

head.NightOptions.Backlight
head.NightOptions.DayNight
In

integer
Color
te

head.NightOptions.Exposure
integer
lb

Mode
ra

head.NightOptions.GlareInhi
integer
bition
s

head.NightOptions.Mirror integer
head.NightOptions.Flip integer
head.NightOptions.Rotate90 integer
head.NomalOptions.Brightne
integer
ssThreshold
head.NormalOptions.IrisAuto bool
NomalOptions contain a set of parameters similar
head.NormalOptions.Sunrise
integer with NightOptions.
Hour
Range is the same as relevant items of
head.NormalOptions.Sunrise
integer NightOptions in this table.
Minute
head.NormalOptions.Sunrise
integer
Second

Camera APIs 195


ParamName ParamValue type Description
head.NormalOptions.Sunset
integer
Hour
head.NormalOptions.Sunset
integer
Minute
head.NormalOptions.Sunset
integer
Second
head.NormalOptions.Exposu
integer
reSpeed
head.NormalOptions.Exposu
float
reValue1
head.NormalOptions.Exposu
float
reValue2
head.NormalOptions.Gain integer
head.NormalOptions.GainAu
bool
to
DA

head.NormalOptions.GainBlu
integer
HU

e
A_

head.NormalOptions.GainGr
integer
een
HT

head.NormalOptions.GainRe
TP

integer
d
_A

head.NormalOptions.WhiteB
String
PI

alance
head.NormalOptions.Referen
integer
fo

ceLevel
r

head.NormalOptions.Externa
float
lSyncPhase
In

head.NormalOptions.AntiFlic
integer
te

ker
lb

head.NormalOptions.Backlig
integer
ht
ra

head.NormalOptions.DayNig
s

integer
htColor
head.NormalOptions.Exposu
integer
reMode
head.NormalOptions.GlareIn
integer
hibition
head.NormalOptions.Mirror integer
head.NormalOptions.Flip integer
head.NormalOptions.Rotate9
integer
0

Camera APIs 196


6 Storage APIs
6.1 Storage Devices

6.1.1 Get Hard Disk Information


Get the hard disk information.

Request URL http://<server>/cgi-bin/storageDevice.cgi?action=factory.getPortInfo


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
DA

http://192.168.1.108/cgi-bin/storageDevice.cgi?action=factory.getPortInfo
HU

Response Params ( key=value format in body )


A_

Name Type R/O Description Example


HT

into object R Return the hard disk information


TP

+Total uint O The number of ports of the bus, including the 2


_A

expansion bus.
+Plug uint O The number of the mounted IDE (damaged IDEs 1
PI

are excluded)
+Mask uint64 O Indicates whether there is an IDE (including 1
fo

damaged IDE) mounted on the bus channel.


r

Each bit represents the main IDE or the sub IDE


In

of the bus channel.


te

If the bit is set to "1", there is a mounted IDE. If


the bit is set to "0", there is no mounted IDE. For
lb

example, bit 0 represents the main IDE of IDE0,


ra

bit1 represents the sub IDE of IDE0, bit2


s

represents the main IDE of IDE1, bit3 represents


the sub IDE of IDE1, and more.
+Bad uint O Indicates whether there is a damaged IDE 0
mounted on each channel.
Each bit represents the main or sub IDE of each
channel. If the bit is set to "1", there is a damaged
IDE. If the bit is set to "0", there is no damaged
IDE. See Mask for the corresponding relationship.
+IDE uint O The number of mounted IDE 1
+Esata uint O The total port number of the eSATA 4
Response Example
info.Total=2
info.Plug=1
info.Mask=1

Storage APIs 197


info.Bad=0
info.IDE=1
info.Esata=4

6.1.2 Get the Name of All Storage Devices


Get the name of all storage devices.

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


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
http://192.168.1.108/cgi-bin/storageDevice.cgi?action=factory.getCollect

Response Params ( key=value format in body )


Name Type R/O Description Example
DA

list char[][64] R Return the name of the storage [ "/dev/sda0", "/dev/sda1",


HU

device "/dev/sg1"]
A_

Response Example
HT

list[0]="/dev/sda0"
list[1]="/dev/sda1"
TP

list[2]="/dev/sg1"
_A
PI

6.1.3 Get Storage Device Information


fo

Get all the storage device information .


r

Request URL http://<server>/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo


In

Method GET
te

Request Params ( key=value format in URL )


Name Type R/O Description Example
lb

Request Example
ra

http://192.168.1.108/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo
s

Response Params ( key=value format in body )


Name Type R/O Description Example
list object R Return object
+info object[] R Object array of the storage device information
++Detail object[] O Partition information
+++IsError bool O Whether the partition is abnormal false
+++Pointer uint O Partition operation handle 27023434
+++TotalBytes double O Total partition space; unit: Byte 0
Partition type "ReadWrite"
+++Type char[16] O "ReadWrite": Read and write partition
"ReadOnly": Read only partition
char[12 "/mnt/dvr/sd
+++Path O Partition name
8] a0"

Storage APIs 198


+++UsedBytes double O Occupied partition space; unit: Byte
++Name char[32] R Device name "/dev/sda"
Device status "Success"
"Error": Failed to get the device status
++State char[4] R
"Initializing": Getting the device status
"Success": Successfully get the device status
Response Example
list.info[0].Detail[0].IsError=false
list.info[0].Detail[0].Pointer=27023434
list.info[0].Detail[0].TotalBytes=0
list.info[0].Detail[0].Type=ReadWrite
list.info[0].Detail[0].Path=/mnt/dvr/sda0
list.info[0].Detail[0].UsedBytes=0
list.info[0].Name=/dev/sda
list.info[0].State=Success
DA

6.1.4 Get Storage Capability


HU
A_

Table 6-1
HT

Syntax http://<server>/cgi-bin/storage.cgi?action=getCaps
TP

Method GET
_A

Description Get storage capabilities.


Example http://192.168.1.108/cgi-bin/storage.cgi?action=getCaps
PI

Success caps.RedundantDisk.Support=false
Return
fo

caps.SupportRemoteLimit=true
Comment —
r
In

6.1.5 Format Camera SD-Card


te
lb

Table 6-2
ra

http://<server>/cgi-bin/storageDevice.cgi?action=setDevice&type=FormatPatition&path=<p
Syntax
s

ath> [&<paramName>=<paramValue>…]
Method GET
Descriptio
Format camera SD card.
n
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
type string R operation
path string O disk part path
formattype Array<object> O disk part information
+fs string R File system type
http://192.168.1.108/cgi-bin/storageDevice.cgi?action=setDevice&type=FormatPatition&pa
Example
th= /dev/sda&formattype[0].fs=fat32
Success OK

Storage APIs 199


Return
If set successfully, return true, else return false.
Comment path : The stringValue is got from cgi API "Get storage device information"
(/cgi-bin/storageDevice.cgi?action=getDeviceAllInfo). stringValue is list[0].Name.

6.2 NAS

6.2.1 NAS Information


 Get NAS config

Table 6-3

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

Description Get all the directories on the NAS server.


HU

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

table.NAS[0].Name="FTP1"
table.NAS[0].Enable=true
HT

table.NAS[0].Protocol="FTP"
TP

Success table.NAS[0].Address="www.ttt.com"
_A

Return table.NAS[0].Port=21
PI

table.NAS[0].UserName="anonymity"
table.NAS[0].Password="none"
fo

table.NAS[0].Directory="share"
Comment —
r

 Set NAS config


In
te

Table 6-4
lb

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

alue>[&<paramName>=<paramValue>…]
s

Method GET
Description Set NAS config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&NAS[0].Name=nas0
Example
1&NAS[0].Enable=true
Success
OK
Return
Parameters in URL:
In table below,
Comment
Head=NAS[index]
index: The index of the NAS Server

Appendix:

ParamName ParamValue type Description


Head.Name string NAS name.

Storage APIs 200


ParamName ParamValue type Description
Head.Enable bool Enable/Disable the NAS.
The range is {"FTP", "SFTP", "SMB", "NFS", "Cloud",
Head.Protocol string
"ISCSI" }
Head.Address string The IP address or host name.
Head.Port integer NAS port.
Head.UserName string NAS username.
Head.Password string NAS password.
Head.Directory string Directory name.

6.3 Storage Point

6.3.1 Record Storage Point


 Get record storage point config
DA

Table 6-5
HU
A_

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=RecordStoragePoi
Syntax
nt
HT

Method GET
TP

Description Get record storage point config.


_A

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

gePoint
table.RecordStoragePoint [0].TimingRecord.Local=1
fo

table.RecordStoragePoint [0].TimingRecord.Redundant=Redundant
table.RecordStoragePoint [0].TimingRecord.Remote=FTP
r

Success
table.RecordStoragePoint [0].TimingRecord.AutoSync=false
In

Return
table.RecordStoragePoint [0].TimingRecord.AutoSyncRange=0
te

table.RecordStoragePoint [0].TimingRecord.LocalForEmergency=false
lb

table.RecordStoragePoint [0].TimingRecord.CompressBefore=15
Comment —
ra

 Set record storage point config


s

Table 6-6

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set record storage point config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&RecordStoragePoint[
Example
0].TimingRecord.Local=local
Success
OK
Return
Parameters in URL:
Comment In table below,
ch: integer, array index starts from 0, which means video channel(equals to video

Storage APIs 201


channel index -1, and so 0 means channel 1).
recType: The range is {"TimingRecord", "VideoDetectRecord", "AlarmRecord",
"EventRecord", "TimingSnapShot", "VideoDetectSnapShot", "AlarmSnapShot",
"EventSnapShot"}

Appendix:

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.
RecordStoragePoint[ch].[recType].Redu
string Redundant directory name.
ndant
RecordStoragePoint[ch].[recType].Remo
string Remote directory name.
te
DA

When remote directory recovers, auto


RecordStoragePoint[ch].[recType].Auto
HU

bool synchronize local directory to remote


Sync
A_

directory or not.
From the remote directory recovering
HT

time, how long the data needs to be


RecordStoragePoint[ch].[recType].Auto
TP

integer synchronized. The unit is hour. If it is


SyncRange
_A

0, all the data needs to be


synchronized.
PI

When the remote directory is


RecordStoragePoint[ch].[recType].Local
fo

bool unusable, save the data the local


ForEmergency
directory or not.
r

RecordStoragePoint[ch].[recType].Comp The days' data which will be


In

integer
ressBefore compressed.
te

6.3.2 Storage Group


lb
ra

 Get storage group config


s

Table 6-7

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageGroup
Method GET
Description Get storage group config.
http://192.168.1.168/cgi-bin/configManager.cgi?action=getConfig&name=StorageGrou
Example
p
table.StorageGroup[0].Channels[0].MaxPictures=0
table.StorageGroup[0].FileHoldTime=0
Success table.StorageGroup[0].Memo=For Reading & Writing Files
Return table.StorageGroup[0].Name=ReadWrite
table.StorageGroup[0].OverWrite=true
table.StorageGroup[0].PicturePathRule=%y-%M-%d/%c/jpg/%h/%m/%s[%E][%O@%S

Storage APIs 202


][%R].jpg
table.StorageGroup[0].RecordPathRule=%y-%M-%d/%c/dav/%h/%h.%m.%s-%h.%m.
%s[%E][%O@%S][%R].dav
table.StorageGroup[1].Channels[0].MaxPictures=0
table.StorageGroup[1].FileHoldTime=0
table.StorageGroup[1].Memo=For FTP Files
table.StorageGroup[1].Name=Remote
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
Comment —
 Set storage group config

Table 6-8
DA

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

Syntax
alue>[&<paramName>=<paramValue>…]
A_

Method GET
HT

Description Set storage group config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageGroup[0].Na
TP

Example
me=main
_A

Success
OK
PI

Return
Parameters in URL:
fo

In table below,
r

Comment Index = Storage Group index


In

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

Appendix:
lb
ra

ParamName ParamValue type Description


s

StorageGroup[Index].Name string Storage group name.


StorageGroup[Index].Memo string Storage group memo.
StorageGroup[Index].FileHoldTime integer How many days the file will hold.
Over write or not when there is not enough
StorageGroup[Index].OverWrite bool
storage.
The max pictures beyond which the old
StorageGroup[Index].Channels[ch].
Integer pictures will be over written. If it is 0, the old
MaxPictures
pictures will be not over written.
StorageGroup[Index].Channels[ch].
string The channel path.
Path

Storage APIs 203


6.4 SDEncrypt

6.4.1 Encrypt SD Card

Table 6-9

http://<server>/cgi-bin/SDEncrypt.cgi?action=encrypt&deviceName=<deviceName>&p
Syntax
assword=<password>
Method GET
Description SD encryption operation.
http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=encrypt&deviceName=/dev/mmc0&
Example
password=123456
Success
OK
Return
If set successfully, return true, else return false.
DA

deviceName: The stringValue is got from cgi API Get storage device information
Comment
HU

(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The stringValue Card is Encrypted
A_
HT

6.4.2 Decrypt SD Card


TP
_A

Table 6-10
PI

http://<server>/cgi-bin/SDEncrypt.cgi?action=decrypt&deviceName=<deviceName>&p
Syntax
fo

assword=<password>
Method GET
r

Description SD decrypt operation.


In

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=decrypt&deviceName=/dev/mmc0&
Example
te

password=123456
lb

Success
OK
Return
ra

If set successfully, return true, else return false.


s

deviceName: The stringValue is got from cgi API Get storage device information
Comment
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The stringValue ard is Encrypted

6.4.3 Clear SD Card Password

Table 6-11

http://<server>/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=<deviceNa
Syntax
me>&password=<password>
Method GET
Description SD clear password operation.
Example http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=/dev/

Storage APIs 204


mmc0&password=123456
Success
OK
Return
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 stringValue ard is Encrypted

6.4.4 Modify SD Card Password

Table 6-12

http://<server>/cgi-bin/SDEncrypt.cgi?action=modifyPassword&deviceName=<device
Syntax
Name>&password=<password>&oldPassword=<oldPassword>
Method GET
Description SD change password operation.
DA

http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=clearPassword&deviceName=/dev/
Example
HU

mmc0&password=123456&oldPassword=admin123
Success
A_

OK
Return
HT

If set successfully, return true, else return false.


TP

deviceName: The stringValue is got from cgi API Get storage device information
_A

Comment (cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
password: The new stringValue Card is Encrypted
PI

oldPassword: The old stringValue Card is Encrypted


fo

6.4.5 Get SD Card Operate Error Policy


r
In

Table 6-13
te
lb

http://<server>/cgi-bin/SDEncrypt.cgi?action=getOperateErrorPolicy&deviceName=<de
Syntax
viceName>&operate=<operate>
ra

Method GET
s

When decrypt, clearPassword, modifyPassword failed, get the error info, leftTimes and
Description
left time.
http://192.168.1.108/cgi-bin/SDEncrypt.cgi?action=getOperateErrorPolicy&deviceNam
Example
e=/dev/mmc0&operate=decrypt
Success policy.leftTimes=5
Return policy.lockSeconds=30
If set successfully, return true, else return false.
deviceName: the stringValue is got from cgi API Get storage device information
(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).
Comment
Operate: operate type, can be: decrypt, modifyPassword and clearPassword
leftTimes : remain operate times, max is 5
lockSeconds : lock operate time, unit is seconds, max is 30

Storage APIs 205


6.4.6 Storage Health Alarm Settings
 Get StorageHealthAlarm config

Table 6-14

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageHealthAlar
Syntax
m
Method GET
Description Get SD health info alarm config.
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=StorageHealthAlar
Example
m
table.StorageHealthAlarm.Enable=true
Success table.StorageHealthAlarm.LowerLimit=10
Return table.StorageHealthAlarm.EventHandler= (output of EventHandler is described in
GetEventHandler)
DA

Comment —
HU

 Set StorageHealthAlarm config


A_

Table 6-15
HT

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

Syntax
alue>[&<paramName>=<paramValue>…]
_A

Method GET
PI

Description Set SD health info alarm config.


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&StorageHealthAlarm.
fo

Example
Enable=true
r

Success
OK
In

Return
Comment —
te
lb
ra
s

Storage APIs 206


7 Display APIs
7.1 GUI

7.1.1 GUISet
 Get GUISet config

Table 7-1

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=GUISet
Method GET
Description Get the GUI settings. Every video out screen has a group setting.
DA

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

table.GUISet[index].WindowAlpha=128
table.GUISet[index].TimeTitleEnable=true
A_

table.GUISet[index].TimeTitlePos[0]=0
HT

table.GUISet[index].TimeTitlePos[1]=0
TP

table.GUISet[index].TimeTitlePos[2]=8191
_A

table.GUISet[index].TimeTitlePos[3]=8191
table.GUISet[index].MenuShowOption=0
PI

Success table.GUISet[index].MenuAutoHideTime=10
Return table.GUISet[index].AutoLogout=10
fo

table.GUISet[index].ChannelTitleShowEnable=true
r

table.GUISet[index].ChannelTitlePos[0]=0
In

table.GUISet[index].ChannelTitlePos[1]=0
te

table.GUISet[index].ChannelTitlePos[2]=8191
table.GUISet[index].ChannelTitlePos[3]=8191
lb

table.GUISet[index].AutoGuideEnable=true
ra


s

Parameters in Response :
Comment
index: the array index which starts from 0.
 Set GUISet config

Table 7-2

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
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
Example
pha=192&GUISet[0].TimeTitleEnable=false&GUISet[0].MenuShowOption=1
Success
OK
Return

Display APIs 207


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


Diaphaneity of the window
GUISet[index].WindowAlpha integer
background.
GUISet[index].TimeTitleEnable bool Show the time title or not.
GUISet[index].TimeTitlePos[0] integer
GUISet[index].TimeTitlePos[1] integer
The position of the time title.
GUISet[index].TimeTitlePos[2] integer
GUISet[index].TimeTitlePos[3] integer
0: Show the directory.
GUISet[index].MenuShowOption integer 1: Hide the directory.
DA

2: Timing-hide the directory.


HU

How many seconds to hide the


GUISet[index].MenuAutoHideTime integer
A_

directory.
How many minutes to auto logout.
HT

GUISet[index].AutoLogout integer The range is [0-120]. 0 expresses not


TP

logout.
_A

GUISet[index].ChannelTitleShowEnable bool Show the channel title or not.


PI

GUISet[index].ChannelTitlePos[0] integer
GUISet[index].ChannelTitlePos[1] integer
The position of the channel title.
fo

GUISet[index].ChannelTitlePos[2] integer
GUISet[index].ChannelTitlePos[3]
r

integer
GUISet[index].AutoGuideEnable bool Auto guide or not when startup.
In
te

7.2 Split Screen


lb
ra

7.2.1 Split Screen Mode


s

 Get split screen mode

Table 7-3

Syntax http://<server>/cgi-bin/split.cgi?action=getMode&channel=<ChannelNo>
Method GET
Description Get the split screen mode.
Example http://192.168.1.108/cgi-bin/split.cgi?action=getMode&channel=1
Success mode=split1
Return group=4
Parameters in URL:
Comment
ChannelNo: the display screen No. Start from 1 and <= 2.
 Set split screen mode

Display APIs 208


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
Success
OK
Return
Parameters in URL:
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"
Comment
/ "FitDisplayUnit4"};
group: the No. of a group which contains certain number channels. For example, if 16
DA

video channels display in split4 Mode which contains 4 video channels on Screen, then
HU

there are 4 groups and each group contains 4 video channels.


A_

7.3 Moniter Tour


HT
TP

7.3.1 Moniter Tour


_A
PI

 Get moniter tour config


fo

Table 7-5
r

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MonitorTour
In

Method GET
te

Description Get monitor tour config.


lb

Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MonitorTour
table.MonitorTour[ch].Enable=128
ra

table.MonitorTour[ch].Interval=true
s

Success
table.MonitorTour[ch].Mask.Split1=0,1,5
Return
table.MonitorTour[ch].Mask.Split8=0,1,5
table.MonitorTour[ch].Collections=Favortite1, Favortite2…
Comment —
 Set moniter tour config

Table 7-6

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set monitor tour config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&MonitorTour[0].Enabl
Example
e=true

Display APIs 209


Success
OK.
Return
Parameters in URL:
Comment
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
MonitorTour[ch].Mask.Split8 — Channel array for split8
MonitorTour[ch].Collections — Split collections

7.3.2 Enable Tour

Table 7-7
DA
HU

http://<server>/cgi-bin/split.cgi?action=enableTour&channel=<ChannelNo>&enable=<fl
Syntax
A_

ag>
Method GET
HT

Description Enable tour in every video channel on a screen or not.


TP

Example http://192.168.1.108/cgi-bin/split.cgi?action=enableTour&channel=1&enable=true
_A

Success
OK
PI

Return
ChannelNo: the display screen No. Start from 1 and <= 2.
Comment
fo

flag : true or false


r

7.3.3 Monitor Collection


In
te

 Get monitor collection config


lb

Table 7-8
ra
s

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MonitorCollection
Method GET
Description Get monitor collection config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MonitorCollec
Example
tion
table.MonitorCollection.collectionname. Mode=Split1
table.MonitorCollection.collectionname.Windows[winno].Enable= true
table.MonitorCollection.collectionname.Windows[winno].Device=device1
Success table.MonitorCollection.collectionname.Windows[winno].VideoChannel=5
Return table.MonitorCollection.collectionname.Windows[winno].VideoStream=Main
table.MonitorCollection.collectionname.Windows[winno].AudioChannel=5
table.MonitorCollection.collectionname.Windows[winno].AudioStream=Main

Comment Parameters in Response :

Display APIs 210


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

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
Success
OK
Return
Parameters in URL:
DA

The paramName and paramValue are in the table below.


In table below:
HU

Comment Collect=MonitorCollection.collectionname.
A_

collectionname: can be any name.


HT

winno: integer, the array index which equals to the window index in a screen and starts
from 0.
TP
_A

Appendix:
PI

ParamName ParamValue type Description


The range is the same as
fo

Collect.Mode string
SetSplitMode.
r

Collect.Windows[winno].Enable bool Enable the window or not.


In

Collect.Windows[winno].Device string The device Id.


Collect.Windows[winno].VideoChannel integer The video channel.
te

The range is {"Main", "Extra1",


lb

Collect.Windows[winno].VideoStream string
"Extra2", "Extra3", "Auto"}.
ra

Collect.Windows[winno].AudioChannel integer The audio channel.


s

The range is {"Main", "Extra1",


Collect.Windows[winno].AudioStream string
"Extra2", "Extra3", "Auto"}.

Display APIs 211


8 Comm APIs
8.1 PTZ

8.1.1 PTZ Config


 Get PTZ config

Table 8-1

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Ptz
Method GET
Description Get PTZ config.
DA

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

table.Ptz[port].Address=8
A_

table.Ptz[port].Attribute[0]=115200
HT

table.Ptz[port].Attribute[1]=8
table.Ptz[port].Attribute[2]=Even
TP

Success
table.Ptz[port].Attribute[3]=1
_A

Return
table.Ptz[port].Homing[0]=0
PI

table.Ptz[port].Homing[1]=30
table.Ptz[port].NumberInMatrixs=0
fo

table.Ptz[port].ProtocolName=NONE
r

Parameters in Response:
Comment
port is PTZ port index, start form 0.
In

 Set PTZ config


te
lb

Table 8-2
ra

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

alue>[&<paramName>=<paramValue>…]
Method GET
Description Set PTZ config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Ptz[0].Address=192.
168.0.1&Ptz[0].Attribute[0]=9600
Success OK
Return
Comment port in below ParamName is PTZ port index, start form 0.

Appendix:

ParamName ParamValue type Description


Range is [0—255].
Ptz[port].Address integer Device address, if there are more than one device
connected to this port, distinguish them by this

Comm APIs 212


ParamName ParamValue type Description
address.
The baud rate. Range is {1200, 2400, 4800, 9600,
Ptz[port].Attribute[0] integer
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}.
Ptz[port].Attribute[3] float
Stop bit.
Range is {-1,0—255}
Ptz[port].Homing[0] integer -1: homing is not enabled.
[0—255]: preset point number
Range is [0—65535].
No operation timeout, unit is seconds.
Ptz[port].Homing[1] integer
After no operation timeout, PTZ go to preset point
DA

set in Ptz[port].Homing[0].
HU

PTZ protocol name depends on PTZ capability.


Ptz[port].ProtocolName string
Refer to GetProtocolList to get the protocol list.
A_

Ptz[port].ControlDelayTime integer PTZ control delay time, unit: second


HT

PTZ control priority,the range is "RS485", "Net".


Ptz[port].ControlPriority string
TP

default : "Net"
_A

8.1.2 Get PTZ Protocol List


PI
fo

Table 8-3
r

Syntax http://<server>/cgi-bin/ptz.cgi?action=getProtocolList[&channel=<ChannelNo>]
In

Method GET
te

Description Get the protocol list that PTZ can support. Unsupported now.
lb

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getProtocolList&channel=1
info.RS[0]=Pelco
ra

Success info.RS[1]=DH-SD1
s

Return info.Coaxial[0]=HD-CVI
info.Coaxial[1]=HD-CVI2.0
Response contains all support PTZ protocols of the server.
Comment
ChannelNo: integer, video channel index which starts from 1.

8.1.3 Get PTZ Capability of Current Protocol

Table 8-4

Syntax http://<server>/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps[&channel=<ChannelNo>]
Method GET
Description Get PTZ channel protocol capabilities.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getCurrentProtocolCaps&channel=1

Comm APIs 213


caps.AlarmLen=0
caps.AuxMax=8
caps.AuxMin=1
caps.CamAddrMax=255
caps.CamAddrMin=1
caps.Flip=false
caps.Focus=false
caps.Interval=200
caps.Iris=false
caps.Menu=false
caps.MonAddrMax=255
caps.MonAddrMin=0
caps.Name=DH-SD1
caps.Pan=false
caps.PanSpeedMax=255
caps.PanSpeedMin=1
Success
DA

caps.PatternMax=5
Return
caps.PatternMin=1
HU

caps.PresetMax=80
A_

caps.PresetMin=1
HT

caps.Tile=false
TP

caps.TileSpeedMax=255
caps.TileSpeedMin=1
_A

caps.TourMax=7
PI

caps.TourMin=0
caps.Type=1
fo

caps.Zoom=false
r

caps.PtzMotionRange.HorizontalAngle[0]=0
In

caps.PtzMotionRange.HorizontalAngle[1]=360
caps.PtzMotionRange.VerticalAngle[0]=-20
te

caps.PtzMotionRange.VerticalAngle[1]=90
lb

caps.ZoomMax=30
ra

caps.ZoomMin=1
s

Parameters in URL:
Comment
ChannelNo: PTZ channel index which starts from 1.

Appendix:

Field in response Description


AlarmLen Alarm length in protocol.
AuxMax
Maximum/Minimum number for auxiliary functions.
AuxMin
CamAddrMax
Maximum/Minimum channel address.
CamAddrMin
Flip True or false, support picture flip or not.
Focus True or false, support focus or not.
Iris True or false, support Iris adjusts or not.
Menu True or false, support internal menu of the PTZ or not.

Comm APIs 214


Field in response Description
MonAddrMax
Maximum/Minimum monitor address.
MonAddrMin
Name Name of the operation protocol.
Pan True or false, support pan or not.
PanSpeedMax
Maximum/Minimum pan speed.
PanSpeedMin
PatternMax
Maximum/Minimum pattern path number.
PatternMin
PresetMax
Maximum/Minimum preset point number.
PresetMin
Tile True or false, support tilt or not.
Zoom True or false, support zoom or not.
TileSpeedMax
Maximum/Minimum tile speed.
TileSpeedMin
TourMax
DA

Maximum/Minimum tour path number.


TourMin
HU

Type Type of PTZ protocol.


A_

Horizontal angle range,[0] for minimum angle,[1] for maximum


HT

PtzMotionRange.HorizontalAngle angle
it only when Pan was true
TP

Vertical angle range,[0] for minimum angle,[1] for maximum angle


_A

PtzMotionRange.VerticalAngle
it only when Tile was true
PI

ZoomMax Maximum/Minimum Zoom.


ZoomMin it only when Zoom was true
fo
r

8.1.4 Get PTZ Status


In
te

Table 8-5
lb

Syntax http://<server>/cgi-bin/ptz.cgi?action=getStatus[&channel=<ChannelNo>]
ra

Method GET
Description Get PTZ status.
s

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=getStatus&channel=1
status.UTC=6538920
status.MoveStatus=Idle
Success
status.ZoomStatus=Idle
Return
status.PresetID=10
status.Position=120,12,2
Comment ChannelNo: integer, video channel index which starts from 1.

8.1.5 PTZ Control


 PTZ Basic Movement

Start moving the PTZ.

Comm APIs 215


Request URL http://<server>/cgi-bin/ptz.cgi?action=start
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The PTZ channel index; starting from 1 1
code char[16] R See the following table for the operation "Up"
codes for PTZ movement.
arg1 int O Operation parameter 1: See the following 0
table for the meaning of the operation code.
arg2 int O Operation parameter 2: See the following 1
table for the meaning of the operation code.
arg3 int O Operation parameter 3: See the following 0
table for the meaning of the operation code.
Request Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Up&arg1=0&arg2=1&arg3=0
DA

Response Params ( OK in body )


HU

Response Example
OK
A_
HT

Stop moving the PTZ.


TP

Request URL http://<server>/cgi-bin/ptz.cgi?action=stop


Method GET
_A

Request Params ( key=value format in URL )


PI

Name Type R/O Description Example


channel int R The PTZ channel index; starting from 1 1
fo

code char[16] R See the following table for the operation "Up"
r

codes for PTZ movement.


In

arg1 int O Operation Parameter 1, reserved. 0


te

arg2 int O Operation Parameter 2, reserved. 0


arg3 int O Operation Parameter 3, reserved. 0
lb

Request Example
ra

http://192.168.1.108/cgi-bin/ptz.cgi?action=stop&code=Up&channel=1&arg1=0&arg2=0&arg3=0
s

Response Params ( OK in body )


Response Example
OK

Appendix: Operation codes for PTZ movement and the parameters.

Code Code description arg1 arg2 arg3


Vertical motion speed;
Up Move up 0 0
range: [1–8]
Vertical motion speed;
Down Move down 0 0
range: [1–8]
Horizontal motion speed;
Left Move left 0 0
range: [1–8]
Right Move right 0 Horizontal motion speed; 0

Comm APIs 216


Code Code description arg1 arg2 arg3
range: [1–8]
Move in an upper-left Vertical motion speed; Horizontal motion speed;
LeftUp 0
direction range: [1–8] range: [1–8]
Move in an upper-right Vertical motion speed; Horizontal motion speed;
RightUp 0
direction range: [1–8] range: [1–8]
Move in an lower-left Vertical motion speed; Horizontal motion speed;
LeftDown 0
direction range: [1–8] range: [1–8]
Move in an lower-right Vertical motion speed; Horizontal motion speed;
RightDown 0
direction range: [1–8] range: [1–8]
ZoomWide Zoom in 0 0 0
ZoomTele Zoom out 0 0 0
FocusNear Focus (near-field) 0 0 0
FocusFar Focus (far-field) 0 0 0
IrisLarge Increase the aperture 0 0 0
IrisSmall Decrease the aperture 0 0 0
DA

 Start Continuously Moving the PTZ


HU

Start continuously moving the PTZ


A_

Request URL http://<server>/cgi-bin/ptz.cgi?action=start&code=Continuously


HT

Method GET
TP

Request Params ( key=value format in URL )


_A

Name Type R/O Description Example


PI

channel int R The PTZ channel index; starting from 1 1


arg1 int O See the table below for the motion direction 5
fo

and step length.


arg2 int O See the table below for the motion direction 5
r

and step length.


In

arg3 int O Zooming speed; range: [-100–100] 5


te

arg4 int O Overtime period; unit: s (maximum 3600 s). 60


lb

If the PTZ does not receive the stop


command before the preset overtime
ra

period, it will stop moving automatically.


s

Request Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&code=Continuously&channel=1&arg1=5&arg2=5&arg3
=5&arg4=60

Response Params ( OK in body )


Response Example
OK

Appendix: Direction of the continuous movement of the PTZ and the step length parameters.

Move description arg1 arg2


Continuously move left < -4 0
Continuously move right >4 0
Continuously move up 0 >4

Comm APIs 217


Move description arg1 arg2
Continuously move down 0 < -4
Continuously move in an
< -4 >4
upper-left direction
Continuously move in an
>4 >4
upper-right direction
Continuously move in a
< -4 < -4
lower-left direction
Continuously move in a
>4 < -4
lower-right direction

Stop continuously moving the PTZ

Request URL http://<server>/cgi-bin/ptz.cgi?action=stop&code=Continuously


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
DA

channel int R The PTZ channel index; starting from 1 1


HU

code char[16] R See the following table for the operation "Up"
codes for PTZ movement.
A_

arg1 int O Operation Parameter 1, reserved. 0


HT

arg2 int O Operation Parameter 2, reserved. 0


TP

arg3 int O Operation Parameter 3, reserved. 0


_A

arg4 int O Operation Parameter 4, reserved. 0


Request Example
PI

http://192.168.1.108/cgi-bin/ptz.cgi?action=stop&code=Continuously&channel=1&arg1=0&arg2=0&arg3
fo

=0&arg4=0
r

Response Params ( OK in body )


In

Response Example
te

OK
3D Positioning
lb


ra

The PTZ moves to the specified position [startX, startY], [endX, endY] on the screen through 3D
positioning .
s

Request URL http://<server>/cgi-bin/ptzBase.cgi?action=moveDirectly


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The PTZ channel index; starting from 1 1
startPoint int[2] R The start point of the target matrix [startX, [7253,2275]
startY]; relative coordinate; the value of X
and Y is normalized to a number between 0
and 8192.
endpoint int[2] R The end point of the target matrix [startX, [7893,3034]
startY]; relative coordinate; the value of X
and Y is normalized to a number between 0
and 8192.

Comm APIs 218


Request Example
http://192.168.1.108/cgi-bin/ptzBase.cgi?action=moveDirectly&channel=1&startPoint[0]=7253&startPoin
t[1]=2275&endPoint[0]=7893&endPoint[1]=3034

Response Params ( OK in body )


Response Example
OK
 Relative PTZ Movement

Relative PTZ movement

Request URL http://<server>/cgi-bin/ptz.cgi?action=moveRelatively


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The PTZ channel index; starting from 1 1
arg1 double O Relative horizontal motion; normalized to [-1, 1] 0.1
DA

arg2 double O Relative vertical motion; normalized to [-1, 1] 0.1


HU

arg3 double O Relative zoom; normalized to [-1, 1] 0.5


Request Example
A_

http://192.168.1.108/cgi-bin/ptz.cgi?action=moveRelatively&channel=1&arg1=0.1&arg2=0.1&arg3=0.5
HT
TP

Response Params ( OK in body )


_A

Response Example
OK
PI

 Accurate PTZ Positioning


fo

Accurate PTZ positioning; the actual parameter range depends on the device.
r

For capability details, execute the command mentioned in "8.1.3 Get PTZ Capability of Current
In

Protocol".
te

Request URL http://<server>/cgi-bin/ptz.cgi?action=moveAbsolutely


lb

Method GET
ra

Request Params ( key=value format in URL )


Name Type R/O Description Example
s

channel int R The PTZ channel index; starting from 1 1


arg1 double O Relative horizontal position; normalized to [-1, 1]; -0.8
arg1 < 0: Angle = 180.0 × arg1 + 360.0, and the
actual range is [180.0, 360.0];
arg1 ≥ 0: Angle = 180.0 × arg1, and the actual
range is [0, 180.0]
arg2 double O Absolute vertical position; normalized to [-1, 1]; 0.3
Angle = -180.0 × arg2 , the actual range is
[-180.0, 180.0]
arg3 double O Absolute zoom; normalized to [-1, 1] 0.5
Request Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=moveAbsolutely&channel=1&arg1=-0.8&arg2=0.3&arg3=0.5

Comm APIs 219


Response Params ( OK in body )
Response Example
OK

8.1.6 Preset
 Getting Preset Information

Get the preset information

Request URL http://<server>/cgi-bin/ptz.cgi?action=getPresets


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O Video channel number, starting from 1; the 1
default value is 1.
Request Example
DA

http://192.168.1.108/cgi-bin/ptz.cgi?action=getPresets&channel=1
HU

Response Params ( key=value format in body )


A_

Name Type R/O Description Example


HT

presets object[] R List of preset information


TP

+Index int R The preset number; starting from 1 1


+Name char[256] O The preset name "preset1"
_A

Preset type 0
PI

0: Normal preset
+Type int O
1: Preset configured with smart rules
fo

2: Special preset
r

Function List of the Special Presets "VideoBlack


In

"VideoBlack": Day/Night Mode (B/W) "


+PresetFunction char[16] O
te

"VideoColor": Day/Night Mode (Color)


"VideoBrightness": Day/Night Mode (Auto)
lb

The coordinate of the preset and zoom; three [900, -900,


ra

integers 5]
s

The first parameter is the horizontal coordinate;


range: [0,3599], referring to 0° to 359.9° (the
number of degree is expanded by 10 times).
+Position int[3] O The second parameter is the vertical coordinate;
range: [-1800,1800], referring to -180° to 180°
(the number of degree is expanded by 10
times).
The third parameter is the expansion parameter;
range: [0,128], referring to the zoom range.
Response Example
presets[0].Index=1
presets[0].Name=Preset 1
presets[0].Type=0
presets[0].PresetFunction="VideoBlack"

Comm APIs 220


presets[0].Position=[900, -900, 5]

 Moving to the Preset

Move to the preset.

Request URL http://<server>/cgi-bin/ptz.cgi?action=start&code=GotoPreset


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The PTZ channel index; starting from 1 1
arg1 int O Ignore 0
arg2 int R The preset number; starting from 1 1
arg3 int O Ignore 0
Request Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&code=GotoPreset&channel=1&arg1=0&arg2=1&arg3=
0
DA
HU

Response Params ( OK in body )


Response Example
A_

OK
HT

 Configuring Preset
TP

Configure a preset.
_A

Request URL http://<server>/cgi-bin/ptz.cgi?action=start&code=SetPreset


PI

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

Name Type R/O Description Example


r

channel int R The PTZ channel index; starting from 1 1


In

arg1 int O Ignore 0


te

arg2 int R The preset number; starting from 1 1


arg3 int O Ignore 0
lb

Request Example
ra

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&code=SetPreset&channel=1&arg1=0&arg2=2&arg3=0
s

Response Params ( OK in body )


Response Example
OK
 Configuring Preset Name

Configure a name for the preset.

Request URL http://<server>/cgi-bin/ptz.cgi?action=SetPreset


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The PTZ channel index; starting from 1 1
arg1 int R The preset number; starting from 1 2
arg2 char[256] R The preset name "preset2"

Comm APIs 221


Request Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=SetPreset&channel=1&arg1=2&arg2=preset2

Response Params ( OK in body )


Response Example
OK
 Deleting Preset

Delete a preset.

Request URL http://<server>/cgi-bin/ptz.cgi?action=start&code=ClearPreset


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R The PTZ channel index; starting from 1 1
arg1 int O Ignore 0
arg2 int R The preset number; starting from 1 2
DA

arg3 int O Ignore 0


HU

Request Example
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&code=ClearPreset&channel=1&arg1=0&arg2=2&arg3
A_

=0
HT
TP

Response Params ( OK in body )


_A

Response Example
OK
PI

8.1.7 Tour
fo
r

 Start the tour


In
te

Table 8-6
lb

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StartTour&arg1=<index
Syntax
ra

>&arg2=0&arg3=0
Method GET
s

Description Start the tour.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StartTour&arg1=1&arg
Example
2=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 the number of tour route
 Stop the tour

Table 8-7

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StopTour&arg1=<index
Syntax
>&arg2=0&arg3=0

Comm APIs 222


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:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is the number of tour route
 Add tour group

Table 8-8

http://<server>/cgi-bin/ptz.cgi?action=setTour&channel=<ch>&arg1=<index>&arg2=<nam
Syntax
e>
Method GET
Descriptio Add tour group, including set the tour route and name. Frequently used with add tour
DA

n preset.
HU

Example http://192.168.1.108/cgi-bin/ptz.cgi?action=setTour&channel=1&arg1=1&arg2=1
A_

Success
OK
HT

Return
TP

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
_A

Comment
arg1 is the number of tour route
PI

arg2 is tour name


 Delete tour group
fo
r

Table 8-9
In

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=ClearTour&arg1=<inde
Syntax
te

x>&arg2=0&arg3=0
lb

Method GET
Description Delete the tour group with specified number.
ra

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=ClearTour&arg1=1&ar
s

Example
g2=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 the number of tour group
 Add tour preset

Table 8-10

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AddTour&arg1=<index
Syntax
1>&arg2=<index2>&arg3=0
Method GET
Description Add preset to tour group.

Comm APIs 223


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
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

Table 8-11

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=DelTour&arg1=<index1
Syntax
>&arg2=<index2>&arg3=0
Method GET
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
DA

Example
=2&arg3=0
HU

Success
OK
A_

Return
HT

Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
TP

Comment
arg1 is the number of tour route
_A

arg2 is the number of preset


PI

8.1.8 Scan
fo
r

 Set left boundary


In

Table 8-12
te
lb

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetLeftLimit&arg1=<ind
Syntax
ex>&arg2=0&arg3=0
ra

Method GET
s

Description Set left boundary.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetLeftLimit&arg1=1&
Example
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 the scan number
 Set right boundary

Table 8-13

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetRightLimit&arg1=<in
Syntax
dex>&arg2=0&arg3=0

Comm APIs 224


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
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 8-14

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoScanOn&arg1=<in
Syntax
dex>&arg2=0&arg3=0
Method GET
Description Start scanning.
DA

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoScanOn&arg1=1
HU

Example
&arg2=0&arg3=0
A_

Success
OK
HT

Return
TP

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1—n].
_A

arg1 is scan number


PI

 Stop scan
fo

Table 8-15
r

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoScanOff&arg1=<in
In

Syntax
dex>&arg2=0&arg3=0
te

Method GET
lb

Description Stop scanning.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoScanOff&arg1=1
ra

Example
&arg2=0&arg3=0
s

Success
OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is scan number

8.1.9 Pattern
 Start pattern record

Table 8-16

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=SetPatternBegin&arg1=
Syntax
<index>&arg2=0&arg3=0

Comm APIs 225


Method GET
Description Start pattern record.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=SetPatternBegin&arg1
Example
=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
 Stop pattern record

Table 8-17

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=
HU

Example
1&arg2=0&arg3=0
A_

Success
OK
HT

Return
TP

Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
_A

arg1 is pattern number


PI

 Start pattern
fo

Table 8-18
r

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StartPattern&arg1=<ind
In

Syntax
ex>&arg2=0&arg3=0
te

Method GET
lb

Description Start pattern.


http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StartPattern&arg1=1&
ra

Example
arg2=0&arg3=0
s

Success
OK
Return
Parameters in URL:
Comment ch is PTZ channel index which starts from 1. Range is [1 — n].
arg1 is pattern number
 Stop pattern

Table 8-19

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=StopPattern&arg1=<ind
Syntax
ex>&arg2=0&arg3=0
Method GET
Description Stop pattern.
Example http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=StopPattern&arg1=1&

Comm APIs 226


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

8.1.10 Pan
 Start pan

Table 8-20

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.
DA

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoPanOn&arg1=0&
HU

Example
arg2=0&arg3=0
A_

Success
OK
HT

Return
Parameters in URL:
TP

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
_A

 Stop pan
PI

Table 8-21
fo

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=AutoPanOff&arg1=0&ar
r

Syntax
g2=0&arg3=0
In

Method GET
te

Description Stop pan.


lb

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=AutoPanOff&arg1=0&
Example
arg2=0&arg3=0
ra

Success
s

OK
Return

Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].

8.1.11 PTZ Auto Movement


 Get PTZ auto movement configuration

Table 8-22

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=PtzAutoMovement
Method GET
Description Get PTZ auto movement configuration.

Comm APIs 227


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=PtzAutoMove
Example
ment
table.PtzAutoMovement[port][Task].Enable = true
table.PtzAutoMovement[port][Task].TimeSection[week][section] = 0 00:00:00-23:59:59

table.PtzAutoMovement[port][Task].Function = None
table.PtzAutoMovement[port][Task].ScanId = 0
Success
table.PtzAutoMovement[port][Task].PresetId = 0
Return
table.PtzAutoMovement[port][Task].PatternId = 0
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:
port is PTZ port index, start from 0.
Comment Task is the number of task, start from 0.
DA

week: from 1 to 7.
HU

section: time section, from 0 to 5.


 Set PTZ auto movement
A_
HT

Table 8-23
TP

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

Syntax
alue>[&<paramName>=<paramValue>…]
PI

Method GET
Description Set PTZ auto movement.
fo

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&PtzAutoMovement[0]
Example
r

[0].Function=Preset&PtzAutoMovement[0][0].PresetId=1
Success
In

OK
Return
te

Parameters in URL:
lb

In table below,
ra

head=PtzAutoMovement[port][task]
Comment port is PTZ port index, start from 0.
s

task is the number of task, start from 0.


week: from 1 to 7.
section: time section, from 0 to 5.

Appendix:

ParamName ParamValue type Description


head.Enable bool Enable/Disable PtzAutoMovement
timeSchedule[week][section]=1 10:00:00-11:00:00
head.TimeSection timeSchedule

head.Function string Range is {Scan, Preset, Pattern, Tour}.
head.ScanId integer Scan Id, start from 1
head.PresetId integer Preset Id, start from 1
head.PatternId integer Pattern Id, start from 1

Comm APIs 228


head.TourId integer Tour Id, start from 1
head.AutoHoming.Time integer Recover time, unit is second.
head.SnapshotEnable bool Enable/Disable Snap, when "Fuction" is "Preset".
head.SnapshotDelayTime integer Delay time of snap, when "Fuction" is "Preset".

8.1.12 PTZ Restart

Table 8-24

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Restart&arg1=0&arg
Syntax
2=0&arg3=0
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
DA

OK
Return
HU

Parameters in URL:
Comment
A_

ch is PTZ channel index which starts from 1. Range is [1 — n].


HT

8.1.13 PTZ Reset


TP
_A

Table 8-25
PI

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Reset&arg1=0&arg2
Syntax
fo

=0&arg3=0
Method GET
r

Description PTZ reset.


In

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Reset&arg1=0&arg
te

Example
2=0&arg3=0
lb

Success
OK
ra

Return
Parameters in URL:
s

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].

8.1.14 OSD Menu


 Enter the menu

Table 8-26

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Menu&arg1=0&arg2
Syntax
=0&arg3=0
Method GET
Description Enter the menu.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Menu&arg1=0&arg
Example
2=0&arg3=0

Comm APIs 229


Success
OK
Return
Parameters in URL:
Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
 Exit the menu

Table 8-27

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Exit&arg1=0&arg2=0&
Syntax
arg3=0
Method GET
Description Exit the menu.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Exit&arg1=0&arg2=0
Example
&arg3=0
Success
OK
Return
Parameters in URL:
DA

Comment
ch is PTZ channel index which starts from 1. Range is [1 — n].
HU

 Confirm
A_
HT

Table 8-28
TP

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=Enter&arg1=0&arg2=0
Syntax
_A

&arg3=0
Method GET
PI

Description Confirm the menu.


fo

http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=Enter&arg1=0&arg2=
Example
0&arg3=0
r

Success
In

OK
Return
te

Parameters in URL:
Comment
lb

ch is PTZ channel index which starts from 1. Range is [1 — n].


Start the basic operation of menu
ra


s

Table 8-29

http://<server>/cgi-bin/ptz.cgi?action=start&channel=<ch>&code=<code>&arg1=<arg1
Syntax
>&arg2=<arg2>&arg3=<arg3>
Method GET
Description Start the basic operation of menu.
http://192.168.1.108/cgi-bin/ptz.cgi?action=start&channel=1&code=MenuUp&arg1=0&
Example
arg2=0&arg3=0
Success
OK
Return
Parameters in URL:
ch is PTZ channel index which starts from 1. Range is [1 — n].
Comment
code is PTZ operation, and arg1, arg2, arg3 are arguments of operation.
code and argN values are listed in table below.

Comm APIs 230


Appendix:

Code Code description arg1 arg2 arg3


MenuUp MenuUp 0 0 0
MenuDown MenuDown 0 0 0
MenuLeft MenuLeft 0 0 0
MenuRight MenuRight 0 0 0

8.2 Wiper

8.2.1 Move Continuously


Make the wiper continuously move until you call the stopMove function to stop it.

Request URL http://<server>/cgi-bin/rainBrush.cgi?action=moveContinuously


Method GET
DA

Request Params ( key=value format in URL )


HU

Name Type R/O Description Example


channel int O Video channel number, starting from 1; the default 1
A_

value is 1
HT

interval int R Interval for the motion of the wiper; unit: second 5
TP

Request Example
_A

http://192.168.1.108/cgi-bin/rainBrush.cgi?action=moveContinuously&channel=1&interval=5
PI

Response Params ( OK in body )


Response Example
fo

OK
r
In

8.2.2 Stop Move


te

Stop the motion of the wiper.


lb
ra

Request URL http://<server>/cgi-bin/rainBrush.cgi?action=stopMove


Method GET
s

Request Params ( key=value format in URL )


Name Type R/O Description Example
channel int O Video channel number, starting from 1; the 1
default value is 1
Request Example
http://192.168.1.108/cgi-bin/rainBrush.cgi?action=stopMove&channel=1

Response Params ( OK in body )


Response Example
OK

Comm APIs 231


8.2.3 Move Once
Control the wiper to move once.

Request URL http://<server>/cgi-bin/rainBrush.cgi?action=moveOnce


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O video channel index which starts from 1, 1
default 1 if not specified.
Request Example
http://192.168.1.108/cgi-bin/rainBrush.cgi?action=moveOnce&channel=1

Response Params ( OK in body )


Response Example
OK
DA

8.3 Illuminator
HU
A_

The following commands are applicable to non-intelligent illuminators.


HT
TP

8.3.1 Visible-light Illuminator


_A

Request
PI

Template
http://<server>/cgi-bin/configManager.cgi?action=setConfig&SignLight[0].onCycle=30
fo

Method GET
r

Parameter key=value format in URL


In

Format
te

Parameter Type Required Description Example


Uint32 Yes Range[0-100] 30
lb

onCycle
ra

Example
s

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&SignLight[0].onCycle=30
Response
Parameter OK at body
Format
Parameter Type Required Description Example
Example
OK

8.4 Flashlight

8.4.1 [Config] Flashlight Config


Configuration parameters of the flashing light (Not recommended).

Comm APIs 232


Config Data Params
Name Type R/O Description Example
R Configuration parameters of the flashing
FlashLight object
light
+Enable bool R Whether to enable the flashing light true
+Brightness int R Brightness; range [0, 100] 50
R Two-dimensional array in strings. [ [ "1 00:00:00-
The first dimension of the array is the day of 23:59:59", "0 0
the week; range: [0-6] (Sunday–Saturday). 0:00:00-23:59:
The second dimension is the period index. 59","0 00:00:0
One day is divided into multiple periods, and 0-23:59:59", "
the range is [0–23]. 0 00:00:00-23:
Each period is set as a string in the format of 59:59", … ] ]
mask hh: mm: ss-hh: mm: ss
Mask: Value range: [0, 1]
char[7][24][
+TimeSection hh: Hour; range: [0–24]
32]
DA

mm: Minute; range: [0–59]


ss: Second; range: [0–59]
HU

Mask value:
A_

0: Disable the parameter in the period


HT

1: Enable the parameter in the period


TP

For example:
TimeSection[1][0]=1 12:00:00—18:00:00
_A

Meaning the flashing light works from


PI

12:00:00 through 18:00:00 on Monday.


For getting and setting the configurations, see 4.2.1 Get and Set Configure”.
fo

Get Config Request Example


r

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FlashLight
In

Get Config Response Example


te

table.FlashLight.Enable=true
table.FlashLight.Brightness=50
lb

table.FlashLight.TimeSection[0][0]=1 00:00:00-23:59:59
ra

table.FlashLight.TimeSection[0][1]=0 00:00:00-23:59:59
s


table.FlashLight.TimeSection[6][5]=0 00:00:00-23:59:59

Set Config Request Example


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FlashLight.Enable=true&FlashLight.B
rightness=50&FlashLight.TimeSection[1][0]=1%2012:00:00-18:00:00
Set Config Response Example
OK

Comm APIs 233


8.5 Coaxial Control IO

8.5.1 Control White Light or Speaker


Send commands for controlling the white light and speaker

Request URL http://<server>/cgi-bin/coaxialControlIO.cgi?action=control


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O It is the video channel number for the white 1
light, and the audio output channel for the
speaker. The default value is 0.
info object[] R Operation details
+Type int R Operation type 1
1: White light
DA

2: Speaker
HU

+IO int R Switch 1


A_

1: On
2: Off
HT

+TriggerMode int R Trigger Mode 2


TP

1: Linked trigger
_A

2: Manual trigger
PI

Request Example
http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action=control&channel=1&info[0].Type=1&info[0].IO=
fo

1&info[0].TriggerMode=2
r

Response Params ( OK in body )


In

Response Example
te

OK
lb

8.5.2 Get White Light and Speaker Status


ra
s

Get the status of the white light and the speaker.

Request URL http://<server>/cgi-bin/coaxialControlIO.cgi?action=getstatus


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O The video channel number which starts 1
from 1, and the default value is 1.
Request Example
http://192.168.1.108/cgi-bin/coaxialControlIO.cgi?action=getstatus&channel=1

Response Params ( key=value format in body )


Name Type R/O Description Example
status object R Return status information

Comm APIs 234


+whitelight char[4] R White light status, "on" or "off" "on"
+speaker char[4] R Speaker status, "on" or "off" "on"
Response Example
status.whitelight=on
status.speaker=on

8.6 Pir Alarm

8.6.1 Configure Pir Parameter


 Get pir parameter

Table 8-30

Syntax http://<server>/cgi-bin/pirAlarm.cgi?action=getPirParam&[channel=<channelNo>]
Method GET
DA

Description Get pir parameter.


HU

Example http://192.168.1.108/cgi-bin/pirAlarm.cgi?action=getPirParam&channel=1
head.Enable=true
A_

head.PirLink.LightingLink.Enable=true
HT

head.PirLink.LightingLink.LightLinkType=Filcker
TP

head.PirLink.LightingLink.FilckerIntevalTime=5
_A

head.PirLink.LightingLink.LightDuration=10
head.PirLink.LightingLink.WhiteLightTimeSection=TimeSection
PI

head.PirLink.TimeSection[weekday][0]=1 00:00:00-24:00:00
head.PirLink.TimeSection[weekday][1]=0 02:00:00-24:00:00
fo

head.PirLink.TimeSection[weekday][2]=0 03:00:00-24:00:00
r

head.PirLink.TimeSection[weekday][3]=0 04:00:00-24:00:00
In

head.PirLink.TimeSection[weekday][4]=0 05:00:00-24:00:00
te

head.PirLink.TimeSection[weekday][5]=0 06:00:00-24:00:00
head.RecordEnable=true
lb

head.RecordChannels=[0, 1, 2]
ra

Success
head.RecordLatch=10
Return
s

head.AlarmOutEnable=true
head.AlarmOutChannels=[1, 4]
head.AlarmOutLatch=10
head.SnapshotEnable=true
head.SnapshotChannels=[2, 4]
head.MailEnable=true
head.AlarmBellEnable=true
head.AlarmBellLatch=10
head.Dejitter=0
head.LogEnable=true
head.DetectWindow[0].Level=3
head.DetectWindow[0].Id=0
head.DetectWindow[0].Name=Region0
head.DetectWindow[0].Sensitive=58

Comm APIs 235


head.DetectWindow[0].Threshold=4
head.DetectWindow[0].Region[0]=3932160
head.DetectWindow[0].Region[1]=3932160


head. DetectWindow [1]…
if a device has one or more pir, PirParam is a array
channel : video channel index
Comment
weekday : range is [0-6] (Sunday - Saturday)
head=configEx[channelNo]
 set pir parameter

Table 8-31

http://<server>/cgi-bin/pirAlarm.cgi?action=setPirParam&[channel=<channelNo>]&<pa
Syntax
ramName>=<paramValue>...&<paramName>=<paramValue>
Method GET
DA

Description Set pir parameter.


HU

http://192.168.1.108/cgi-bin/pirAlarm.cgi?action=setPirParam&channel=1&configEx[1].
Example
A_

Enable=true&configEx[1].PirLink.LightingLink.Enable=true&...
HT

Success
OK
Return
TP

channel : video channel index


_A

Comment
head=configEx[channelNo]
PI

Appendix:
fo

ParamName ParamValue type Description


r

Enable/Disable motion detect feature in a


head.Enable bool
In

channel.
WinNum
te

Index of detect window, there are 4 detect


lb

windows at present. Each window is


ra

divided into 18 lines and 22 blocks/line.


s

head.DetectWindow[WinNum].Level integer
Range is [1—6].
Sensitivity of pir
1: lowest sensitivity.
6: highest sensitivity.
head.DetectWindow[WinNum].Id integer It is the Id of a detect window.
head.DetectWindow[WinNum].Nam
string It is the name of a detect window.
e
Range is [0—100].
head.DetectWindow[WinNum].Sens
integer It presents more sensitive if the value is
itive
larger.
Range is [0—100].
head.DetectWindow[WinNum].Thre
integer It presents the threshold value when trigger
shold
motion detect.

Comm APIs 236


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
1=Line 2

Currently, region is divided into 18 lines


head.DetectWindow[WinNum].Regi
integer and 22 blocks/line.
on[LineNum]
A bit describes a block in the line.
Bit = 1: motion in this block is monitored.
Example:
DA

MotionDetect[0].Region[0] = 4194303
(0x3FFFFF):: motion in channel 0 line 0's
HU

22 blocks is monitored.
A_

MotionDetect[0].Region[1] =0: motion in


HT

line 1's 22 blocks is not monitored.


TP

MotionDetect[0].Region[17] = 3: in the last


line of channel 0, motion in the left two
_A

blocks is monitored.
PI

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


Staurday)
fo

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


r

timesection table index.


In
te

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


head.TimeSection[wd][ts] string Mask: [0—65535], hh: [0—24], mm: [0—
lb

59], ss: [0—59]


ra

Mask indicates record type by bits:


s

Bit0: regular record


Bit1: motion detection record
Bit2: alarm record
Bit3: card record
Range is {0, 1}
head.PirLink.RecordChannels[ch] Integer 0 – do not record on video channel ch
1 – record on video channel ch
head.PirLink.RecordEnable bool Enable/Disable record function.
Range is [10—300].
head.PirLink.RecordLatch integer Unit is seconds, indicates the time to
record after input alarm is cleared.

Comm APIs 237


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.
Range is [10—300].
head.PirLink.AlarmOutLatch Integer Unit is seconds, indicates the time to
output alarm after input alarm is cleared.
Range is {0, 1}
head.PirLink.SnapshotChannels[ch] integer 0 — do not snapshot on video channel ch
1 — snapshot on video channel ch
head.PirLink.SnapshotEnable bool Enable/Disable snapshot function.
Range is [0—255].
head.PirLink.Dejitter integer Alarm signal dejitter seconds. Alarm signal
DA

change during this period is ignored.


HU

head.PirLink.MailEnable bool Enable/Disable mail send for alarm.


head.PirLink.AlarmBellEnable bool Enable/Disable mail send for alarm.
A_

Range is [10, 300]


HT

head.PirLink.AlarmBellLatch integer
Unit is seconds
TP

head.PirLink.LogEnable bool Enable/Disable log for alarm.


_A
PI
fo
r
In
te
lb
ra
s

Comm APIs 238


9 Video Analyse APIs
9.1 People Counting

9.1.1 Get Summary


Get summary information of people statistics in video.

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=getSummary


Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int O Video channel index which starts from 1, default is 1. 1
DA

Request Example
http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getSummary&channel=1
HU
A_

Response Params ( key=value format in body )


HT

Name Type R/O Description Example


TP

summary object R Summary information of people statistics in video .


_A

+Channel int R Video channel index which starts from 0. 1


Rule type, it can be: "NumberSta
PI

 "ManNumDetection": count the people num in t"


region, and the detail stat is in "InsideSubtotal"
fo

+RuleName string R param.


r

 "NumberStat": count the people entering and


In

leaving the region, and the detail stat is in


te

"EnteredSubtotal" and "ExitedSubtotal"param.


+EnteredSubto
lb

object O People enter stat.


tal
ra

++Total int R Total enter num. 14


s

++Today int R Today enter num. 0


++Hour int R This hour enter num. 0
++TotalInTime 0
int O Today enter num after call clearSectionStat.
Section
+ExitedSubtota
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 0
int O Today leave num after call clearSectionStat.
Section
+InsideSubtota
object O People inside region stat.
l
++Total int R Today inside num. 65

Video Analyse APIs 239


array<obj
++ManStayStat O The entering and leaving stat of people that leaved.
ect>
2012-01-04
+++EnterTime string O People enter time.
00:00:00
2012-01-04
+++ExitTime string O People leave time.
00:00:45
Response Example
summary.Channel=0
summary.RuleName=NumberStat
summary.EnteredSubtotal.Today=0
summary.EnteredSubtotal.Total=14
summary.EnteredSubtotal.TotalInTimeSection=0
summary.ExitedSubtotal.Today=0
summary.ExitedSubtotal.Total=32
summary.ExitedSubtotal.TotalInTimeSection=0
summary.InsideSubtotal.Total=65
DA

summary.InsideSubtotal.ManStayStat[0].EnterTime=2012-01-04 00:00:00
summary.InsideSubtotal.ManStayStat[0].ExitTime=2012-01-04 00:00:45
HU

summary.InsideSubtotal.ManStayStat[1].EnterTime=2012-01-04 00:00:00
A_

summary.InsideSubtotal.ManStayStat[1].ExitTime=2012-01-04 00:00:45
HT

9.1.2 Query the Count of People


TP
_A

 Start to find
PI

Start to find video stat info, in response, there is a token for further info finding process, and there is
fo

a totalCount shows how many data count(s).


r

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=startFind


In

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

Name Type R/O Description Example


lb

Video channel index which starts from 1, 1


channel int O
ra

default is 1.
s

condition object R Find condition.


2012-01-04
+StartTime string R Find time range start
00:00:00
2012-01-04
+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.)
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.

Video Analyse APIs 240


+PlanID int O The plan id, only valid for dome camera. 2
The ptz preset index which starts from 1, only 1
+PtzPresetId int O valid for dome camera. Note: new device
should use PtzPresetId instead of PlanID.
Array<i The area id which starts from 1, max array size [1,2]
+AreaID O
nt> is 20.
The other search rule, can be : AverageStayTime
+OtherRule string O
AverageStayTime
Request Example
http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=startFind&channel=1&condition.StartTime=201
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

Response Params ( key=value format in body )


Name Type R/O Description Example
Token for this search, use this token to get result 12345
token int R
DA

and stop search.


HU

totalCount int R Number of find result. 56


Response Example
A_

token=12345
HT

totalCount=56
TP

 Get the find result


_A

Get the find result of Video Stat info with channel, token, begin Number and count.
PI

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=doFind


fo

Method GET
r

Request Params ( key=value format in URL )


In

Name Type R/O Description Example


Video channel index which starts from 1, 1
te

channel int O default is 1.


lb

NOTE: must be the same as startFind.


ra

Token for this search, use this token to get 12345


token int R
result and stop searching.
s

The start count. It must be between 0 and 0


beginNumber int R
totalCount -1.
count int R The count of info for this query. 20
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 )


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

Video Analyse APIs 241


+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
for dome camera.
+AreaID int O The area id which starts from 1. 3
The average stay time, only valid when startFind 20
+AverageStayT
int O with OtherRule param’s value is
ime
“AverageStayTime”.
Rule name, it can be: NumberStat
 "ManNumDetection": count people num in
region, detail stat is in "InsideSubtotal"param
+RuleName string R
 "NumberStat": count people enter and leave
region, detail stat is in "EnteredSubtotal"and
"ExitedSubtotal"param.
2012-01-04
+StartTime string O Find time range start
00:00:00
2012-01-04
+EndTime string O Find time range end
DA

00:02:00
+EnteredSubto 14
HU

int O Total enter num.


tal
A_

+ExitedSubtota 5
int O Total leave num.
HT

l
TP

+InsideSubtota 65
int O Total inside num.
l
_A

Response Example
PI

found=20
info[0].Channel=0
fo

info[0].AreaID=2
r

info[0].RuleName=NumberStat
In

info[0].StartTime=2012-03-14 00:00:00
te

info[0].EndTime=2012-04-14 00:00:00
info[0].EnteredSubtotal=14
lb

info[0].ExitedSubtotal=5
ra

info[0].InsideSubtotal=65
s

info[1].Channel=0
info[1].AreaID=3
info[1].RuleName=NumberStat
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

 Stop the searching session


Stop query video stat by channel and token.

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=stopFind


Method GET

Video Analyse APIs 242


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.
NOTE: must be the same as startFind.
Token for this search, use this token to get 12345
token int R
result and stop searching.
Request Example
GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=stopFind&channel=1&token=12345

Response Params ( OK in body )


Response Example
OK

9.1.3 Clear the People Count Information


DA

Clear the people count information.


HU

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=clearSectionStat


A_

Method GET
HT

Request Params ( key=value format in URL )


Name Type R/O Description Example
TP

Video channel index which starts from 1, 1


_A

channel int O
default is 1.
PI

Request Example
GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=clearSectionStat&channel=1
fo
r

Response Params ( OK in body )


In

Response Example
OK
te
lb

9.1.4 Subscribe the People Count Information


ra
s

Subscribe the people count information.

Request URL http://<server>/cgi-bin/videoStatServer.cgi?action=attach


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.
Send heartbeat interval, range is [1, 60],unit is 5
second. If the URL contains this parameter,
and the value is 5, it means every 5 seconds
heartbeat int O 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.

Video Analyse APIs 243


Request Example
http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=attach&channel=1&heartbeat=5

Response Params ( key=value format in body )


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
Rule type, it can be: NumberStat
 "ManNumDetection": Count people num in
region, detail stat is in "InsideSubtotal" param.
+RuleName string R
 "NumberStat": Count people entering and
leaving region, detail stat is in
"EnteredSubtotal" and "ExitedSubtotal" param.
+EnteredSubto
object O People enter stat.
tal
++Total int R Total enter num. 14
DA

++Today int R Today enter num. 2


HU

++Hour int R This hour enter num. 1


++TotalInTime 0
A_

int O Today enter num after call clearSectionStat.


Section
HT

+ExitedSubtota
object O People leave stat.
TP

l
_A

++Total int R Total leave num. 32


++Today int R Today leave num. 3
PI

++Hour int R This hour leave num. 2


fo

++TotalInTime 0
int O Today leave num after call clearSectionStat.
Section
r

+InsideSubtota
In

object O People inside region stat.


l
te

++Total int R Today inside num. 65


array<obj
lb

++ManStayStat O The entering and leaving stat of people that leaved.


ect>
ra

2012-01-04
+++EnterTime string O People enter time
s

00:00:00
2012-01-04
+++ExitTime string O People leave time
00:00:45
Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: text/plain
Content-Length: <length>

summary.Channel=0

Video Analyse APIs 244


summary.RuleName=NumberStat
summary.EnteredSubtotal.Today=2
summary.EnteredSubtotal.Total=14
summary.EnteredSubtotal.TotalInTimeSection=1
summary.ExitedSubtotal.Today=3
summary.ExitedSubtotal.Total=32
summary.ExitedSubtotal.TotalInTimeSection=2
summary.InsideSubtotal.Total=65
summary.InsideSubtotal.ManStayStat[0].EnterTime=2012-01-04 00:00:00
summary.InsideSubtotal.ManStayStat[0].ExitTime=2012-01-04 00:00:45
summary.InsideSubtotal.ManStayStat[1].EnterTime=2012-01-04 00:00:00
summary.InsideSubtotal.ManStayStat[1].ExitTime=2012-01-04 00:00:45
--<boundary>
Content-Type: text/plain
Content-Length: 11
DA

Heartbeat
HU

--<boundary>
Content-Type: text/plain
A_

Content-Length: <length>
HT
TP

summary.Channel=0
summary.RuleName=NumberStat
_A

summary.EnteredSubtotal.Today=2
PI

summary.EnteredSubtotal.Total=14

fo
r

9.1.5 [Event] NumberStat


In
te

Table 9-1
lb

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


ra

Description When people number triggers the rule, send this event.
s

[ Event Params ] ( JSON format )


Name Type R/O Param Description
Number int R Total number in detect region.
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.
PresetID int O The preset id, if omit, means preset is unknown.
[ Example ]
--<boundary>
Content-Type: text/plain
Event
Content-Length: <length>

Video Analyse APIs 245


Code=NumberStat;action=Start;index=0;data={
"Number": 120,
"EnteredNumber": 180,
"ExitedNumber": 60,
"Type": "EnterOver",
"Area": 2
}
--<boundary>

9.1.6 [Event] ManNumDetection

Table 9-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.
[ Event Params ] ( JSON format )
DA

Name Type R/O Param Description


HU

Array<obje
ManList R The people info list.
ct>
A_

The detected people bounding box, 4 interge, refer to x's value


HT

of left-top point, y's value of left-top point, x's value of


+BoundingBox Array<int> R
TP

right-bottom point, y's value of right-bottom point. Coordinate


_A

remap to 0 — 8192.
+Stature int R The people's stature, unit is cm.
PI

AreaID int O The area id, begin from 1, if omit, means single area.
fo

PresetID int O The preset id, if omit, means preset is unknown.


[ Example ]
r

--<boundary>
In

Content-Type: text/plain
te

Content-Length: <length>
lb

Code=ManNumDetection;action=pulse;index=0;data={
ra

Event "ManList": [ { "BoundingBox": [2992,1136,4960,5192], "Stature": 170 },


s

{ "BoundingBox": [4392,4136,6960,6512], "Stature": 175 },


{…}, … ],
"AreaID" : 2
}
--<boundary>

9.1.7 [Event] CrowdDetection

Table 9-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 )

Video Analyse APIs 246


Name Type R/O Param Description
Array<obje
CrowdList O The global crowd density overrun list.
ct>
The center point, must be two int, means x and y value,
+Center Array<int> R
coordinate remap to 0 — 8192.
+Radius int R The radius length.
Array<obje
RegionList O The people num overrun region list.
ct>
+RegionID int R The region index.
+PeopleNum int R The people count in region.
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Event Code=CrowdDetection;action=start;index=0;data={
DA

"CrowdList": [ { "Center" : [5734,2377],"Radius" : 10}, …{} ],


HU

"RegionList" : [ { "RegionID" : 0, "PeopleNum" : 100 },…{} ]


}
A_

--<boundary>
HT
TP

9.2 FaceRecognitionServer
_A
PI

9.2.1 Create Face Group


fo

Table 9-4
r
In

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=createGroup
Method GET
te

Description Create a face group.


lb

[ Request Params ] ( key=value format at URL )


ra

Name Type R/O Param Description


s

groupName string R The face group name, max string length is 127.
The description detail of the face group, max string length is
groupDetail string 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 ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=createGroup&groupName
=Test1&groupDetail=ForTest1
Response groupID=10000

Video Analyse APIs 247


9.2.2 Modify Face Group

Table 9-5

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyGroup
Method GET
Description Modify a face group.
[ 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.
groupName string R The name of the the face group, max string length is 127.
groupDetail string O Description detail of the face group, max string length is 255.
[ Response Params ] ( OK )
[ Example ]
GET
DA

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=modifyGroup&groupID=10
000&groupName=Test1&groupDetail=ForTest1
HU

Response OK
A_
HT

9.2.3 Delete Face Group


TP
_A

Table 9-6
PI

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deleteGroup
Method GET
fo

Description Delete a face group.


r

[ Request Params ] ( key=value format at URL )


In

Name Type R/O Param Description


te

groupID string R The identity of the face group, max string length is 63.
[ Response Params ] ( OK )
lb

[ Example ]
ra

GET
s

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deleteGroup&groupID=100
00
Response OK

9.2.4 Deploy Face Group


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 9-7

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=putDisposition
Method GET

Video Analyse APIs 248


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.
list Array<object> R List of disposition info.
+channel int R Video channel index which starts from 1.
+similary int R The threshold of the face similary, 0 — 100.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
report array<bool> R Result of putting disposition for each request channel.
[ Example ]
GET
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
report[0]=true
DA

Response
report[1]=false
HU

 Delete some disposition from group


A_

Table 9-8
HT
TP

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deleteDisposition
Method GET
_A

Descripti
PI

Remove the deployment of face group from some video channels.


on
[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


r

groupID string R The identity of the face group, max string length is 63.
In

channel Array<int> R Video channel index which starts from 1.


te

[ Response Params ] ( key=value format )


Name Type R/O Param Description
lb

report array<bool> R Result of deleting disposition for each request channel.


ra

[ Example ]
s

GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deleteDisposition&groupID
=10000&channel[0]=1&channel[1]=2
report[0]=true
Response
report[1]=false
 set disposition group to channel

Table 9-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.

Video Analyse APIs 249


[ 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.
[ Response Params ] ( OK )
[ Example ]
GET
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
Response OK
 get disposition group from channel

Table 9-10
DA

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=getGroup
HU

Method GET
A_

Get the Deployment about the video channel.


Descripti
HT

Note: If the video channel does not deploy any group, then the response will be success
on
TP

with empty http body.


[ Request Params ] ( key=value format at URL )
_A

Name Type R/O Param Description


PI

channel int R Video channel index which starts from 1.


[ Response Params ] (key=value format)
fo

Name Type R/O Param Description


r

groupID Array<int> R The identity of the face group, max string length is 63.
In

similary Array<int> R The threshold of the face similary, 0 — 100.


te

[ Example ]
Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=getGroup&channel=1
lb

groupID[0]=10001
ra

groupID[1]=10003
s

groupID[2]=10006
….
Response
similary[0]=80
similary[1]=75
similary[2]=85
….

9.2.5 Find Face Group

Table 9-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.

Video Analyse APIs 250


[ Request Params ] ( key=value format at URL )
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.
+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.
+channels Array<int> O Video channel index which starts from 0.
+similarity Array<int> O The threshold of the face similary.
+groupType string O The type of face group
Array<Array<s
+TimeSection O The time section of face group
tring>>
[ Example ]
DA

Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=findGroup


HU

GroupList[0].groupID=00001
A_

GroupList[0].groupName=Test1
GroupList[0].groupDetail=ForTest1
HT

GroupList[0].groupSize=30
TP

GroupList[0].channels[0]=1
_A

GroupList[0].channels[1]=2
PI


GroupList[0].similarity[0]=80
fo

GroupList[0].similarity[1]=75

r

GroupList[0].groupType=BlackListDB
In

GroupList[0].TimeSection[0][0]=1 00:00:00-23:59:59
te

GroupList[0].TimeSection[0][1]=0 00:00:00-23:59:59
lb

GroupList[0].TimeSection[0][2]=0 00:00:00-23:59:59
GroupList[0].TimeSection[0][3]=0 00:00:00-23:59:59
ra

Response
GroupList[0].TimeSection[0][4]=0 00:00:00-23:59:59
s

GroupList[0].TimeSection[0][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][0]=1 00:00:00-23:59:59
GroupList[0].TimeSection[1][1]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][2]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][3]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[1][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[2][0]=1 00:00:00-23:59:59
GroupList[0].TimeSection[2][1]=0 00:00:00-23:59:59
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

Video Analyse APIs 251


GroupList[0].TimeSection[3][1]=0 00:00:00-23:59:59
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
GroupList[0].TimeSection[4][3]=0 00:00:00-23:59:59
GroupList[0].TimeSection[4][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[4][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][0]=1 00:00:00-23:59:59
GroupList[0].TimeSection[5][1]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][2]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][3]=0 00:00:00-23:59:59
GroupList[0].TimeSection[5][4]=0 00:00:00-23:59:59
DA

GroupList[0].TimeSection[5][5]=0 00:00:00-23:59:59
GroupList[0].TimeSection[6][0]=1 00:00:00-23:59:59
HU

GroupList[0].TimeSection[6][1]=0 00:00:00-23:59:59
A_

GroupList[0].TimeSection[6][2]=0 00:00:00-23:59:59
HT

GroupList[0].TimeSection[6][3]=0 00:00:00-23:59:59
TP

GroupList[0].TimeSection[6][4]=0 00:00:00-23:59:59
GroupList[0].TimeSection[6][5]=0 00:00:00-23:59:59
_A
PI

GroupList[1].groupID=00003
GroupList[1].groupName=Test3
fo

GroupList[1].groupDetail=ForTest3
r

GroupList[1].groupSize=50
In

GroupList[1].channels[0]=1
GroupList[1].channels[1]=2
te


lb

GroupList[1].similarity[0]=70
ra

GroupList[1].similarity[1]=85
s

9.2.6 Re-Abstract Feature By Group


 Start ReAbstract

Table 9-12

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=groupReAbstract
Method GET
Abstract features for the groups.
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 )

Video Analyse APIs 252


Name Type R/O Param Description
groupID Array<int> R The identity of the face group, max string length is 63.
[ 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
Response token=12345
 Stop ReAbstract

Table 9-13

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopGroupReAbstract
Method GET
DA

Descripti
Stop the abstract features process.
on
HU

[ Request Params ] ( key=value format at URL )


A_

Name Type R/O Param Description


HT

token int R The identity of this operation.


TP

[ Response Params ] ( OK )
[ Example ]
_A

GET
PI

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=stopGroupReAbstract&tok
en=12345
fo

Response OK
r
In

9.2.7 Add Person


te
lb

Table 9-14
ra

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=addPerson
s

Method POST
Description Add a person to a group.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The identity of the face group that this person to add. Max string
groupID string R
length is 63.
name string R The person name, max string length is 63.
birthday string O The person's birthday, ex: "1980-01-01".
sex string O Sex, it can be "Male", "Female", "Unknown".
The country name, length must be 2, and value should be
country string O
according to ISO3166.
province string O The province name, max string length is 63.
city string O The city name, max string length is 63.
certificateType string O The certificate type. It can be: "IC', "Passport", "Unknown".

Video Analyse APIs 253


id string O The ID of certificate type, max string length is 31.
[ Response Params ] (key=value format )
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
Request
Content-Type: image/jpeg
Content-Length: <image size>

<JPEG image data>


Response uid=0005

9.2.8 Modify Person


DA
HU

Table 9-15
A_

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyPerson
HT

Method POST
TP

Modify a person's info.


_A

Note: If you do not want to change the image about the person, the request should not
Description
contain the image data.
PI

Note: You should provide at lease one optional param to update.


fo

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
r

uid string R The identity of the Person, max string length is 31.
In

The identity of the Face Group that this Person in. max string
groupID string R
te

length is 63.
lb

name string O The person's name, max string length is 63.


birthday string O The person's birthday, ex: "1980-01-01".
ra

sex string O Sex, it can be "Male", "Female", "Unknown".


s

The country name, length must be 2, and value should be


country string O
according to ISO3166.
province string O The province name, max string length is 63.
city string O The city name, max string length is 63.
certificateType string O The certificate type. It can be: "IC', "Passport", "Unknown".
id string O The ID of certificate type, max string length is 31.
[ Response Params ] ( OK )
[ Example ]
POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=modifyPerson&uid=0005&grou
Request pID=10000&name=ZhangSan&birthday=1980-01-05&sex=Male&country=CN&province=
ZheZhang&city=Hangzhou HTTP/1.1
Content-Type: image/jpeg

Video Analyse APIs 254


Content-Length: <image size>

<JPEG image data>


Response OK

9.2.9 Delete Person

Table 9-16

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=deletePerson
Method GET
Description Delete a person from a group.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
uid string R The identity of the person, max string length is 31.
The identity of the face group that this Person in. max string
DA

groupID string R
length is 63.
HU

[ Response Params ] ( OK )
A_

[ Example ]
GET
HT

Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=deletePerson&uid=001&gr
TP

oupID=10000
_A

Response OK
PI

9.2.10 Find Person


fo

Start to find
r


In

Table 9-17
te

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFind
lb

Method GET
ra

Start to find person in face groups.


Description
s

Note: the returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
condition Object R Search scope condition.
+GroupID Array<string> R The list of identity of the face group, max string length is 63.
person object O Person condition.
+Name string O Person Name, max string length is 63.
+Sex string O Sex, it can be "Male", "Female", "Unknown".
string O Country name, length must be 2, and value should be
+Country
according to ISO3166.
+Province string O Province name, max string length is 63.
+City string O City name, max string length is 63.
+CertificateType string O Certificate Type. It can be: "IC', "Passport", "Unknown".
+ID string O Person ID of CertificateType, max string length is 31.

Video Analyse APIs 255


+FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.
[ Response Params ] ( key=value format )
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]
Request
=10000&condition.GroupID[1]=10003&person.Sex=Male&person.Country=CN&person.F
eatureState=1
token=123456789
Response
totalCount=24
 Get find result

Table 9-18
DA

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFind
HU

Method GET
A_

Descripti Get one result of person's information from the search result set.
HT

on Note: the returned token will be expired after 60 seconds without any doFind call.
TP

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
_A

Token for this search, use this token to get result and stop
PI

token uint R
search.
The index in search result, should between 0 and totalCount
fo

index uint R
–1.
r

[ Response Params ] ( JSON format )


In

Name Type R/O Param Description


te

person object R Person condition.


+UID string R The identity of the person, max string length is 31.
lb

string R The identity of the face group that this Person in. max string
ra

+GroupID
length is 63.
s

+Name string R The person name, max string length is 63.


+Sex string O Sex, it can be "Male", "Female", "Unknown".
+Birthday string O The person's birthday, ex: "1980-01-01".
string O Country name, length must be 2, and value should be
+Country
according to ISO3166.
+Province string O Province name, max string length is 63.
+City string O City name, max string length is 63.
+CertificateType string O Certificate Type, can be: "IC', "Passport", "Unknown".
+ID string O Person ID of CertificateType, max string length is 31.
+FeatureState int O Feature State, 0:Unknown, 1:Failed, 2:OK.
[ Example ]
GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFind&token=123456789&in
dex=0

Video Analyse APIs 256


HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Content-Length: <length>

--<boundary>
Content-Type: text/plain
Content-Length: <length>

person.UID=0005
person.GroupID=10000
person.Name=ZhangSan
person.Birthday=1980-01-01
Response
person.Sex=Male
person.Country=CN
person.Province=ZheJiang
DA

person.City=HangZhou
person.CertificateType=IC
HU

person.ID=1234567890
A_

person.FeatureState=0
HT

--<boundary>
TP

Content-Type: image/jpeg
Content-Length: <image size>
_A
PI

< jpeg image data ... >


--<boundary>--
fo

 Stop finding
r
In

Table 9-19
te

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFind
lb

Method GET
ra

Descripti
Stop the search session.
on
s

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
The token for this search, use this token to get result and stop
token uint R
search.
[ Response Params ] ( OK )
[ Example ]
GET
Request
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFind&token=123456789
Response OK

9.2.11 Re-Abstract Features By Person


 Start ReAbstract

Video Analyse APIs 257


Table 9-20

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=reAbstract
Method GET
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 )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=reAbstract&uid[0]=001&ui
d[1]=002
Response OK
DA

 Stop ReAbstract
HU

Table 9-21
A_
HT

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopReAbstract
TP

Method GET
Descripti
_A

Stop the abstract features process.


on
PI

[ Request Params ] ( None )


[ Response Params ] ( OK )
fo

[ Example ]
r

Request GET http://192.168.1.108/cgi-bin/faceRecognitionServer.cgi?action=stopReAbstract


In

Respons
OK
te

e
lb

9.2.12 [Config] Face Recognition AlarmOut Setting


ra
s

 Get FaceRecognitionAlarm config

Table 9-22

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionAlar
URL
m
Method GET
Description Get the Face Recognition Alarm Out Setting.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )
Name Type R/O Param Description
table object R Config info table.
+FaceRecognitio
array<object> R Each face group has one config object in this array.
nAlarm

Video Analyse APIs 258


++GroupID String R The face group ID, max string length is 63.
++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.
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
Request http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionAlar
m
table.FaceRecognitionAlarm[0].GroupID=0017
table.FaceRecognitionAlarm[0].GroupName=wsd
DA

table.FaceRecognitionAlarm[0].AlarmOutEnable=true
HU

table.FaceRecognitionAlarm[0].AlarmChannel[0].AlarmRuleMask=0
table.FaceRecognitionAlarm[0].AlarmChannel[0].AlarmOutLatch=5
A_

table.FaceRecognitionAlarm[0].AlarmChannel[1].AlarmRuleMask=0
HT

table.FaceRecognitionAlarm[0].AlarmChannel[1].AlarmOutLatch=8
TP


Response
_A

table.FaceRecognitionAlarm[1].GroupID=0018
table.FaceRecognitionAlarm[1].GroupName=cst
PI

table.FaceRecognitionAlarm[1].AlarmOutEnable=true
fo

table.FaceRecognitionAlarm[1].AlarmChannel[0].AlarmRuleMask=0
table.FaceRecognitionAlarm[1].AlarmChannel[0].AlarmOutLatch=10
r

table.FaceRecognitionAlarm[1].AlarmChannel[1].AlarmRuleMask=0
In

table.FaceRecognitionAlarm[1].AlarmChannel[1].AlarmOutLatch=15
te


Set FaceRecognitionAlarm config
lb


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

Method GET
s

Descripti
Set the Face Recognition Alarm Out Setting.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
FaceRecognition
array<object> R Each face group has one config object in this array.
Alarm
+GroupID String R The face group ID, max string length is 63.
+GroupName String R The face group name, max string length is 127.
+AlarmOutEnabl
Bool R Enable AlarmOut or not.
e
+AlarmChannel Array<object> R Each AlarmOut channel has one config object in this array.

Video Analyse APIs 259


Alarm rule mask.
++AlarmRuleMa
Int R  Bit 0 : recognition success
sk
 Bit 1 : recognition failed
++AlarmOutLatc
Int R Alarm out delay, seconds, value between 1 and 300.
h
[ Response Params ] ( OK )
[ Example ]
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

9.2.13 Find Person by Picture


DA

 Start to find
HU

Table 9-23
A_
HT

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindByPic
Method POST
TP

Start to find person in face groups by picture. The search may last for some time, so the
_A

response may push at regular intervals until 100% Progress


PI

Description Note: If you want to find person in face groups by person info, see above "Find
Person"API.
fo

Note: The returned token will be expired after 60 seconds without any doFind call.
r

[ Request Params ] ( key=value format in URL )


In

Name Type R/O Param Description


GroupID array<string> R Face groups to find, max string length is 63.
te

Similarity int R Similarity percent, 1 — 100.


lb

MaxCandidate int O Max Candidate result number.


ra

[ Response Params ] ( JSON format )


s

Name Type R/O Param Description


The token of this search, use this token to get result and stop
token uint R
search.
progress uint R Search Progress, 100 means finished.
totalCount int R Result num, return -1 means still searching.
[ Example ]
POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindByPic&GroupID[0]=0000
1&GroupID[1]=00003&Similarity=80&MaxCandidate=500
Request Content-Type: image/jpeg
Content-Length: <image size>

<JPEG data>
Respons HTTP/1.1 200 OK

Video Analyse APIs 260


e Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/json
Content-Length: <length>

{ "token": 123456789,
"progress": 20
"totalCount": -1
}
--<boundary>
Content-Type: application/json
Content-Length: <length>
DA

{ "token": 123456789,
"progress": 60
HU

"totalCount": -1
A_

}
HT

--<boundary>
TP

Content-Type: application/json
Content-Length: <length>
_A
PI

{ "token": 123456789,
"progress": 100
fo

"totalCount": 350
r

}
In

--<boundary>--
Get the find result
te


lb

Table 9-24
ra

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindByPic
s

Method GET
Get the find result, reply using multipart format, first part is json string to describe all
Descripti candidate person, then the following parts are the person's pictures, refer by UID and
on GroupID in part header Content-Info.
Note: the returned token will be expired after 60 seconds without any doFind call.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.
The index in search result, should between 0 and totalCount
index uint R
–1.
count uint R Number of result person to get.
[ Response Params ] ( JSON format )

Video Analyse APIs 261


Name Type R/O Param Description
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 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".
++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
string O Certificate Type. It can be "IC', "Passport", or "Unknown".
pe
DA

++ID string O Person ID of CertificateType, max string length is 31.


HU

++FeatureStat
int O Feature State, 0:Unknown, 1:Failed, 2:OK.
A_

e
++HomeAddre
HT

string O Home Address, ex: “binanRoad NO1199”


ss
TP

+Similarity int R Similarity.


_A

[ Example ]
PI

GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindByPic&token=12345678
fo

9&index=0&count=10
r

HTTP/1.1 200 OK
Server: Device/1.0
In

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


te

Connection: closed
lb
ra

--<boundary>
Content-Type: application/json
s

Content-Length: <length>

{ "Found" : 10,
Response
"Candidates" : [
{
"person" : {
"UID" : "0001",
"GroupID" : "001",
"Name" : "ZhangSan",
"Birthday" : "1980-01-05",
"Sex" : "Male",
...
},

Video Analyse APIs 262


"Similarity" : 85
},
{
"person" : {
"UID" : "0002",
"GroupID" : "002",
"Name" : "LiSi",
"Birthday" : "1980-01-06",
"Sex" : "Male",
...
},
"Similarity" : 80
},
{ ... }, ...
]
}
DA

--<boundary>
Content-Info: UID=0001&GroupID=001
HU

Content-Type: image/jpeg
A_

Content-Length: <length>
HT
TP

< jpeg image data ... >


_A

--<boundary>
Content-Info: UID=0002&GroupID=002
PI

Content-Type: image/jpeg
Content-Length: <length>
fo
r

< jpeg image data ... >


In

--<boundary>
...
te

 Stop finding
lb
ra

Table 9-25
s

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindByPic
Method GET
Descripti
Stop the search session.
on
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindByPic&token=12345678
9

Video Analyse APIs 263


Response OK

9.2.14 Find History Person by Picture


 Start to find

Table 9-26

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindHistoryByPic
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.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
DA

Channel int R Video channel index which starts from 0.


HU

StartTime string R Start time to search, ex: 2018-01-13T00:00:00Z.


A_

EndTime string R End time to search, ex: 2018-01-14T00:00:00Z.


HT

Similarity int R Similarity percent, 1 — 100.


TP

MaxCandidate int O Max Candidate result number.


[ Response Params ] ( JSON format )
_A

Name Type R/O Param Description


PI

Token for this search, use this token to get result and stop
token uint R
search.
fo

progress uint R Search Progress, 100 means finished.


r

totalCount int R Result num, return -1 means still searching.


In

[ Example ]
te

POST
http://<server>/cgi-bin/faceRecognitionServer.cgi?action=startFindHistoryByPic&Channe
lb

l=0&StartTime=2018-01-13T00:00:00Z&EndTime=2018-01-14T00:00:00Z&Type=All&Si
ra

milarity=80&MaxCandidate=500
Request
s

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

<JPEG data>

Video Analyse APIs 264


HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/json
Content-Length: <length>

{ "token": 123456789,
"progress": 20
"totalCount": -1
}
--<boundary>
Content-Type: application/json
Response
Content-Length: <length>
DA

{ "token": 123456789,
HU

"progress": 60
A_

"totalCount": -1
HT

}
TP

--<boundary>
Content-Type: application/json
_A

Content-Length: <length>
PI

{ "token": 123456789,
fo

"progress": 100
r

"totalCount": 350
In

}
te

--<boundary>--
 Get find result
lb
ra

Table 9-27
s

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindHistoryByPic
Method GET
Get the find result, reply by multipart, first part is json string to describe all candidate person,
Descripti
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.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Token for this search, use this token to get result and stop
token uint R
search.
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 )

Video Analyse APIs 265


Name Type R/O Param Description
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.
+Similarity int R Similarity.
+Time string O Appear time of the Person, format is "2013-09-02 00:00:00".
[ Example ]
GET
Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=doFindHistoryByPic&token=12
3456789&index=0&count=12
HTTP/1.1 200 OK
Server: Device/1.0
DA

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


HU

Connection: closed
A_

--<boundary>
HT

Content-Type: application/json
TP

Content-Length: <length>
_A
PI

{ "Found" : 12,
"Candidates" : [
fo

{
"person" : {
r

"UID" : "0001",
In

"Sex" : "Male",
te

"Age" : 30,
lb

Response "Glasses": 1
},
ra

"Similarity" : 85
s

“Time”: “2013-09-02 00:00:00”


},
{
"person" : {
"UID" : "0002",
"Sex" : "Male",
"Age" : 50,
"Glasses": 2
},
"Similarity" : 80
“Time”: “2013-09-02 00:00:00”
},
{ ... }, ...
]

Video Analyse APIs 266


}
--<boundary>
Content-Info: UID=0001
Content-Type: image/jpeg
Content-Length: <length>

< jpeg image data ... >


--<boundary>
Content-Info: UID=0002
Content-Type: image/jpeg
Content-Length: <length>

< jpeg image data ... >


--<boundary>
...
 Stop finding
DA

Table 9-28
HU
A_

URL http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindHistoryByPic
HT

Method GET
Descripti
TP

Stop finding.
on
_A

[ Request Params ] ( key=value format in URL )


PI

Name Type R/O Param Description


Token for this search, use this token to get result and stop
token uint R
fo

searching.
r

[ Response Params ] ( OK )
In

[ Example ]
GET
te

Request http://<server>/cgi-bin/faceRecognitionServer.cgi?action=stopFindHistoryByPic&token=1
lb

23456789
ra

Response OK
s

9.2.15 [Event] FaceDetection

Table 9-29

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


When the video channel disposition with some face group, and the video channel detect
Description
a face, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Faces Array<object> R The detected faces info.

Video Analyse APIs 267


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 right
+BoundingBox Array<int> R
—bottom point, y's value of right—bottom point. Coordinate
remap to 0 — 8192.
+Sex string O Sex, it can be "Man", "Woman".
+Age int O Age.
+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
mask.
+Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.
[ Example ]
DA

--<boundary>
HU

Content-Type: text/plain
Content-Length: <length>
A_
HT

Code=FaceDetection;action=Start;index=0;data={
TP

"Faces": [ { "BoundingBox": [2992,136,6960,8192],


_A

"Sex": "Man",
"Age": 40,
PI

Event
"Feature": [ "WearGlasses", "Smile"],
fo

"Eye": 2,
"Mouth": 1,
r

"Mask": 1,
In

"Beard": 2
te

}, {…}, … ]
}
lb

--<boundary>
ra
s

9.2.16 [Event] FaceRecognition

Table 9-30

Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event


When the video channel disposition with some face group, and the video channel detect
Description
a face, after recognize in the face groups, send this event.
[ Event Params ] ( key=value format )
Name Type R/O Param Description
Events array<object> R Event info array.
+EventBaseInf
object R Base info of event.
o
++Code String R Event Code. It should be FaceRecognition.

Video Analyse APIs 268


++Action String R Event Action. It can be "Start", "Stop" or "Pulse".
++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.
The identity of the Face Group that this Person in. max string
+++GroupID string R
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.
+++City string O City name, max string length is 63.
+++CertificateT
DA

string O Certificate Type. It can be: "IC', "Passport", "Unknown".


ype
HU

+++ID string O Person ID of CertificateType, max string length is 31.


A_

Similarity of the Candidates person and the detected person,


++Similarity int O
value between 1 — 100.
HT

+Face object O The attribute information of face.


TP

++Sex string O Sex, it can be "Man", "Woman".


_A

++Age int O Age.


PI

Face feature, can be some of the following : "WearGlasses",


"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",
++Feature array<string> O
fo

"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",


r

"Confused", "Scream".
++Eye int O Eye status, 0: not detected, 1: close eye, 2: open eye.
In

++Mouth int O Mouth status, 0: not detected, 1: close mouth, 2: open mouth.
te

Mask status, 0: not detected, 1: not wearing mask, 2: wearing


++Mask int O
lb

mask.
ra

++Beard int O Beard status, 0: not detected, 1: no beard, 2: has beard.


[ Example ]
s

--<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo .Code=FaceRecognition
Events[0].EventBaseInfo .Action=Pulse
Event Events[0].EventBaseInfo .Index=0
Events[0].UID=00105
Events[0].Candidates[0].Person.UID=0012
Events[0].Candidates[0].Person.GroupID=10000
Events[0].Candidates[0].Person.Name=ZhangSan
Events[0].Candidates[0].Person.Birthday=1980-01-02
Events[0].Candidates[0].Person.Sex=Male

Video Analyse APIs 269



Events[0].Candidates[0].Similarity=80
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

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
Events[0].Face.Eye=2
Events[0].Face.Mouth=1
DA

Events[0].Face.Mask=1
Events[0].Face.Beard=2
HU

--<boundary>
A_

Content-Type: image/jpeg
HT

Content-Length: <image size>


TP

<Jpeg image data>


_A

--<boundary>
PI

9.2.17 [Event] FaceFeatureAbstract


fo
r

Table 9-31
In
te

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


When Re-Abstract Feature By Group or By Person, the abstract progress detail will send
lb

Description
in this event.
ra

[ Event Params ] ( JSON format )


s

Name Type R/O Param Description


Infos Array<object> R Abstrace detail Info, max size is 100.
Abstract state, it can be :
 "Success" : Abstract success,
+State String R
 "False" : Failed to abstract;
 "Process" : In Process;
+Process int O The abstract progress.
+UID string O The identity of the person, max string length is 31.
+GroupID string O The identity of the face group, max string length is 63.
[ Example ]

Video Analyse APIs 270


--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=FaceFeatureAbstract;action=Start;index=0;data={
"Infos": [ { "State": "Progress",
Event
"Progress": 30,
"UID": "20005",
"GroupID": "10000"
}, {…}, … ]
}
--<boundary>

9.2.18 [Config] Face Recognition Event Handler Setting


 Get FaceRecognitionEventHandler config
DA

Table 9-32
HU
A_

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionEve
URL
ntHandler
HT

Method GET
TP

Description Get the Face Recognition Event Handler Setting.


_A

[ Request Params ] ( None )


PI

[ Response Params ] ( key=value format )


Name Type R/O Param Description
fo

table object R Config info table.


r

+FaceRecognitio
array<object> R Each face group has one config object in this array.
In

nEventHandler
++GroupID String R The face group ID, max string length is 63.
te

++GroupName String R The face group name, max string length is 127.
lb

Report event mask, 0 means not to report event.


++EventEnable
ra

int R  Bit 0 : recognition success


Mask
s

 Bit 1 : recognition failed


Record media file mask., 0 means not to record.
++RecordEnable
int R  Bit 0 : recognition success
Mask
 Bit 1 : recognition failed
++RecordLatch Int R Record latch time, unit is second.
Snap picture mask., 0 means not to snap picture
++SnapEnableM
Int R  Bit 0 : recognition success
ask
 Bit 1 : recognition failed
Send mail mask., 0 means not to send mail.
++MailEnableMa
Int R  Bit 0 : recognition success
sk
 Bit 1 : recognition failed
[ Example ]

Video Analyse APIs 271


GET
Request http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=FaceRecognitionEve
ntHandler
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

Response
table.FaceRecognitionEventHandler[1].GroupID=0018
table.FaceRecognitionEventHandler[1].GroupName=cst
table.FaceRecognitionEventHandler[1].EventEnableMask=3
table.FaceRecognitionEventHandler[1].RecordEnableMask=0
table.FaceRecognitionEventHandler[1].RecordLatch=10
DA

table.FaceRecognitionEventHandler[1].SnapEnableMask=3
table.FaceRecognitionEventHandler[1].MailEnableMask=0
HU


A_

 Set FaceRecognitionEventHandler config


HT

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

Method GET
_A

Descripti
Set the Face Recognition Event Handler Setting.
on
PI

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
fo

FaceRecognition
r

array<object> R Each face group has one config object in this array.
Alarm
In

+GroupID String R The face group ID, max string length is 63.
te

+GroupName String R The face group name, max string length is 127.
lb

Report event mask, 0 means not to report event.


+EventEnableM
int R  Bit 0 : recognition success
ra

ask
 Bit 1 : recognition failed
s

Record media file mask., 0 means not to record.


+RecordEnable
int R  Bit 0 : recognition success
Mask
 Bit 1 : recognition failed
+RecordLatch Int R Record latch time, unit is second.
Snap picture mask., 0 means not to snap picture
+SnapEnableMa
Int R  Bit 0 : recognition success
sk
 Bit 1 : recognition failed
Send mail mask., 0 means not to send mail.
+MailEnableMas
Int R  Bit 0 : recognition success
k
 Bit 1 : recognition failed
[ Response Params ] ( OK )
[ Example ]

Video Analyse APIs 272


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

9.2.19 [Config] Face-ID Recognition Threshold


Request
Template http://<server>/cgi-bin/configManager.cgi?action=setConfig&CitizenPictureCompare
Rule.Threshold=60
Method GET
Parameter key=value format in URL
DA

Format
HU

Parameter Type Required Description Example


Threshold uint8 Yes Face-ID comparison 60
A_

threshold [1, 100]


HT

Example
TP

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&CitizenPictureCompareRule.Threshol
_A

d=60
Response
PI

Parameter OK at body
Format
fo

Parameter Type Required Description Example


r

Example
In

OK
te
lb

9.2.20 Exporting Face Database


ra
s

The exported data is binary.

Request URL http://<server>/cgi-bin/api/FaceLibImExport/export


Method POST
Request Params (JSON format in body)
Name Type R/O Description Example
groupID char[64] R Person group ID "10"
Password char[64] O Unzip password "abcd"
Request Example
{
"groupID" : "10",
"password": "abcd"
}

Video Analyse APIs 273


Response Params (binary in body )
Name Type R/O Description Example
Response Example
HTTP/1.1 200 OK
NTP Server Device/1.0
Content-Type: application/octet-stream
Content-Length: <length>

< binary data>

9.2.21 Importing Face Database


The imported data is binary.

Request URL http://<server>/cgi-bin/api/FaceLibImExport/import


DA

Method POST
HU

Request Params (multipart in body)


Name Type R/O Description Example
A_

password char[64] O Unzip password "abcd"


HT

Request Example
TP

POST http://<server>/cgi-bin/api/FaceLibImExport/import HTTP/1.1


_A

User-Agent: client/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
PI
fo

--<boundary>
Content-Type: application/json
r

Content-Length: 20
In
te

{
lb

"password": "abcd"
}
ra

--<boundary>
s

Content-Type: application/octet-stream
Content-Length: 800

< binary data>


--<boundary>

Response Params ( JSON format in body )


Name Type R/O Description Example
Response Example
{}

Video Analyse APIs 274


9.3 Video Analyse Event

9.3.1 [Event] LeftDetection

Table 9-33

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect some object left, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Object object R The object that left.
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.
DA

[ Example ]
HU

--<boundary>
Content-Type: text/plain
A_

Content-Length: <length>
HT

Event
TP

Code=LeftDetection;action=pulse;index=0;data={
_A

"Object": { "BoundingBox": [2992,1136,4960,5192] }


}
PI

--<boundary>
fo

9.3.2 [Event] TakenAwayDetection


r
In

Table 9-34
te

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


lb

Description When detect some object was taken away, send this event.
ra

[ Event Params ] ( JSON format )


s

Name Type R/O Param Description


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 ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>
Event
Code=TakenAwayDetection;action=pulse;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] }
}

Video Analyse APIs 275


--<boundary>

9.3.3 [Event] WanderDetection

Table 9-35

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
[ Event Params ] ( JSON format )
Name Type R/O Param Description
Objects Array<object> R The objects that was wandering.
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 object wandering tracks, array of polyline, one polyline
Array<Array<
DA

Tracks O for one object, polyline is array of points, point is array of two
Array<int>>>
HU

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
A_

Array<Array<i
DetectRegion R 20, the second array is point, must be two int, means x and y
HT

nt>>
value, coordinate remap to 0 — 8192.
TP

[ Example ]
_A

--<boundary>
Content-Type: text/plain
PI

Content-Length: <length>
fo

Code=WanderDetection;action=start;index=0;data={
r

"Objects": [ { "BoundingBox": [2992,1136,4960,5192] },


In

{ "BoundingBox": [4392,4136,6960,6512] },
Event
te

{…}, … ],
lb

"Tracks": [ [ [1202, 576], [1456, 863], [1921, 1204], [2341, 1823], [3512, 2314] ],
[ [2214, 3412], [3153, 3674], [4512, 4213] ],
ra

[…], … ],
s

"DetectRegion": [ [1292,3469], [6535,3373], … ]


}
--<boundary>

9.3.4 [Event] StayDetection

Table 9-36

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.

Video Analyse APIs 276


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
—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.
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
—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 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.
[ Example ]
--<boundary>
DA

Content-Type: text/plain
HU

Content-Length: <length>
A_

Code=StayDetection;action=start;index=0;data={
HT

"Object": { "BoundingBox": [2992,1136,4960,5192] },


TP

Event "Objects": [ { "BoundingBox": [2992,1136,4960,5192] },


_A

{ "BoundingBox": [4392,4136,6960,6512] },
{…}, … ],
PI

"DetectRegion": [ [1292,3469], [6535,3373], … ],


"AreaID" : 2
fo

}
r

--<boundary>
In
te

9.3.5 [Event] HumanTrait


lb
ra

Table 9-37
s

Usage Refer to "4.4.3 Subscribe to Snapshot "for how to subscribe event


Description When detect a human trait, send this event.
[ Event Params ] ( key=value format )
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.
+HumanAttribute
object O The human attributes.
s

Video Analyse APIs 277


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".
++Age int O Age.
++Angle int O Angle, 0: unknown, 1: front, 2: side, 3: back.
Coat color, can be: "White", "Orange", "Pink", "Black",
"Red", "Yellow", "Gray", "Blue", "Green", "Purple", "Brown",
"Sliver", "Darkviolet", "Maroon", "Dimgray", "Whitesmoke",
++CoatColor string O "Darkorange", "Mistyrose", "Tomato", "Olive", "Gold",
"Darkolivegreen", "Chartreuse", "Greenyellow",
"Forestgreen", "Seagreen", "Chartreuse", "Deepskyblue",
"Cyan", "Other".
++CoatType int O Coat type, 0: unknown, 1: long sleeve, 2: short sleeve.
++TrousersColor string O Trousers color, value can be that of CoatColor.
DA

Trousers type, 0: unknown, 1: long pants, 2: short pants, 3:


++TrousersType int O
HU

skirt.
++HasHat int O Has hat or not, 0: unknown, 1: not has hat, 2: has hat.
A_

++HasBag int O Has bag or not, 0: unknown, 1: not has bag, 2: has bag.
HT

Has umbrella or not, 0: unknown, 1: not has umbrella, 2: has


++HasUmbrella int O
TP

umbrella.
_A

Bag type, 0: unknown, 1: handbag, 2: shoulder bag, 3:


++Bag int O
knapsack, 4: draw-bar box.
PI

Upper clothes pattern, 0: unknown, 1: pure color, 2: stripe,


++UpperPattern int O
fo

3: pattern, 4: gap, 5: grid.


Hair style, 0: unknown, 1: long hair, 2: short hair, 3: ponytail,
r

++HairStyle int O
4: updo, 5: hiddened.
In

++Cap int O Cap style, 0: unknown, 1: normal cap, 2: helmet.


te

+FaceAttributes object O If the human's face can be detected, find it's attributes.
lb

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
ra

++BoundingBox Array<int> O
right-bottom point, y's value of right-bottom point.
s

Coordinate remap to 0 — 8192.


++Sex string O Sex, it can be "Man", "Woman", "Unknown".
++Age int O Age.
Face feature, can be some of the following : "WearGlasses",
"SunGlasses", "NoGlasses", "Smile", "Anger", "Sadness",
++Feature array<string> O
"Disgust", "Fear", "Surprise", "Neutral", "Laugh", "Happy",
"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.
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.

Video Analyse APIs 278


Glasses status, 0: unknown, 1: not wearing, 2: normal
++Glass Int O
Glasses, 3: sun glasses, 4: black frame glasses.
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo .Code=HumanTrait
Events[0].EventBaseInfo .Action=Pulse
Events[0].EventBaseInfo .Index=0
Events[0].HumanAttributes.BoundingBox[0]=1341
Events[0].HumanAttributes.BoundingBox[1]=2451
Events[0].HumanAttributes.BoundingBox[2]=4513
Events[0].HumanAttributes.BoundingBox[3]=4135
Events[0].HumanAttributes.Sex=Man
Events[0].HumanAttributes.Age=30
DA

Events[0].HumanAttributes.CoatColor=White
HU

Events[0].HumanAttributes.CoatType=1
Events[0].HumanAttributes.TrousersColor=Black
A_

Events[0].HumanAttributes.TrousersType=1
HT

Event Events[0].HumanAttributes.HasHat=1
TP

Events[0].HumanAttributes.HasBag=2
Events[0].FaceAttributes.BoundingBox[0]=1341
_A

Events[0].FaceAttributes.BoundingBox[1]=2451
PI

Events[0].FaceAttributes.BoundingBox[2]=4513
Events[0].FaceAttributes.BoundingBox[3]=4135
fo

Events[0].FaceAttributes.Sex=Man
r

Events[0].FaceAttributes.Age=30
In

Events[0].FaceAttributes.Feature[0]=Smile
te

Events[0].FaceAttributes.Eye=2
Events[0].FaceAttributes.Mouth=1
lb

Events[0].FaceAttributes.Glass=1
ra

--<boundary>
s

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

<Jpeg image data>


--<boundary>

9.3.6 [Event] CrossLineDetection

Table 9-38

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect some object cross the line, send this event.
[ Event Params ] ( JSON format )
Name Type R/O Param Description

Video Analyse APIs 279


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
remap to 0 — 8192.
Objects array<object> O If detect several object, store in this array.
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 line, the first array is point list, max item is 20,
Array<Array<i
DetectLine R the second array is point, must be two int, means x and y
nt>>
value, coordinate remap to 0 — 8192.
The crossline direction, can be : “LeftToRight”, “RightToLeft”,
Direction string O
“Any”.
[ Example ]
DA

--<boundary>
HU

Content-Type: text/plain
Content-Length: <length>
A_
HT

Code=CrossLineDetection;action=pulse;index=0;data={
Event
TP

"Object": { "BoundingBox": [2992,1136,4960,5192] },


_A

"DetectLine": [ [1292,3469], [6535,3373], … ],


"Direction" : "LeftToRight"
PI

}
fo

--<boundary>
r

9.3.7 [Event] CrossRegionDetection


In
te

Table 9-39
lb

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


ra

Description When detect some object cross the region, send this event
s

[ Event Params ] ( JSON format )


R/
Name Type Param Description
O
Object object R The object that cross the region.
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.
Objects array<object> O If detect several object, store in this array.
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.

Video Analyse APIs 280


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.
The cross action, can be : "Appear", "Disappear",
Action string R
"Cross","Inside"
The cross direction, valid on if the “Action” is “Cross”, can be :
Direction string O
"Enter", "Leave", "Both".
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=CrossRegionDetection;action=pulse;index=0;data={
Event "Object": { "BoundingBox": [2992,1136,4960,5192] },
"DetectRegion": [ [1292,3469], [6535,3373], … ],
“Action” : “Cross”,
DA

"Direction" : "Enter"
HU

}
--<boundary>
A_
HT

9.3.8 [Event] QueueStayDetection


TP
_A

Table 9-40
PI

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When detect the queue stay time too long, send this event
fo

[ Event Params ] ( JSON format )


r

Name Type R/O Param Description


In

Object object O The object that was stay.


te

The detected object bounding box, 4 interge, refer to x's value


lb

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
ra

remap to 0 — 8192.
s

Objects array<object> O If detect several object, store in this array.


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
—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 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.
The preset id, Valid ID starts from 1; 0 means meaningless,
PresetID int O
not involved. if omit, means preset is unknown.
[ Example ]

Video Analyse APIs 281


--<boundary>
Content-Type: text/plain
Content-Length: <length>

Code=QueueStayDetection;action=start;index=0;data={
"Object": { "BoundingBox": [2992,1136,4960,5192] },
Event "Objects": [ { "BoundingBox": [2992,1136,4960,5192] },
{ "BoundingBox": [4392,4136,6960,6512] },
{…}, … ],
"DetectRegion": [ [1292,3469], [6535,3373], … ],
"AreaID" : 2
}
--<boundary>

9.3.9 [Event] QueueNumDetection


DA

Table 9-41
HU

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


A_

Description When detect the queue people number exceed limit, send this event
HT

[ Event Params ] ( JSON format )


TP

Name Type R/O Param Description


_A

ManList Array<object> R The people info list.


The detected people bounding box, 4 interge, refer to x's
PI

value of left-top point, y's value of left-top point, x's value of


+BoundingBox Array<int> R
right-bottom point, y's value of right-bottom point. Coordinate
fo

remap to 0 — 8192.
r

+Stature int R The people's stature, unit is cm.


In

AreaID int O The area id, begin from 1, if omit, means single area.
te

The preset id, Valid ID starts from 1; 0 means meaningless,


PresetID int O
lb

not involved. if omit, means preset is unknown.


[ Example ]
ra

--<boundary>
s

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

Code=QueueNumDetection;action=pulse;index=0;data={
Event "ManList": [ { "BoundingBox": [2992,1136,4960,5192], "Stature": 170 },
{ "BoundingBox": [4392,4136,6960,6512], "Stature": 175 },
{…}, … ],
"AreaID" : 2
}
--<boundary>

Video Analyse APIs 282


10 Video Analyse Extend APIs
10.1 Video Analyse

10.1.1 Get Video Analyse Capability

Table 10-1

Syntax http://<server>/cgi-bin/devVideoAnalyse.cgi?action=getcaps&channel=<ChannelNo>
Method GET
Description Get video analyse capabilities.
Example http://192.168.1.108/cgi-bin/devVideoAnalyse.cgi?action=getcaps&channel=1
DA

caps.CalibrateBoxs[0]=2
HU

caps.CalibrateBoxs[1]=3
caps.ComplexSizeFilter=false
A_

caps.MaxCelibateAreas=10
HT

caps.MaxExcludeRegions=0
TP

caps.MaxInternalOptions=512
_A

caps.MaxModules=1
caps.SupportGlobalDeviceParam=1
PI

caps.MaxPointOfLine=20
caps.MaxPointOfRegion=20
fo

caps.MaxRules=10
r

caps.MaxStaffs=4
In

caps.SpecifiedObjectFilter=true
te

caps.SupportedRules[0]=CrossLineDetection
caps.SupportedRules[1]=CrossRegionDetection
lb

Success
caps.SupportedRules[2]=LeftDetection
ra

Return
caps.SupportedRules[3]=TakenAwayDetection
s

caps.SupportedScene[0]=Normal
caps.SupportedScene[1]=FaceDetection
caps.SupportedScene[2]=VideoDiagnosis
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.HorizontalSt
affs[0]=0
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.HorizontalSt
affs[1]=0
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.VerticalStaffs
[0]=0
caps.SupportedScenes.FaceDetection.SupportedCalibrateParams.Groud.VerticalStaffs
[1]=0
caps.SupportedScenes.StereoNumber.SupportedRules.ManNumDetection.SupportLoc
alDataStore=false
caps.SupportedScenes.NumberStat.CameraType=1

Video Analyse Extend APIs 283


caps.SupportedScenes.NumberStat.SupportedRules.NumberStat.MaxRules=8
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
event type list in which last ones are supported to
oBehavior.OnlyFindLastEvtLi array<string>
be inquired.
st

10.1.2 Video Analyse Global


 Get video analyse global config
DA
HU

Table 10-2
A_

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseGlob
Syntax
HT

al
Method GET
TP

Description Get video analyse global config.


_A

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

Global
head.Scene.Type=Normal
fo

head.Scene.PtzPresetId=1
r

head.Scene.Depth=Far
In

head.Scene.Detail.CameraAngle=30
head.Scene.Detail.CameraDistance=10.000000
te

Success
head.Scene.Detail.CameraHeight=6.200000
lb

Return
head.TimePeriod.Day[0]=8:00:00
ra

head.TimePeriod.Day[1]=20:00:00
head.TimePeriod.Night[0]=20:00:00
s

head.TimePeriod.Night[1]=8:00:00

Parameters in Response :
head =table.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).
 Set video analyse global config

Table 10-3

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>...]
Method GET
Description Set video analyse global config.

Video Analyse Extend APIs 284


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoAnalyseGlobal[
Example
0].Scene.Type=Normal&VideoAnalyseGlobal[0].Scene.PtzPresetId=1
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).
ParamName start with head.Scene.Detail depends on head.Scene.Type.

Appendix

ParamName ParamValue type Description


Scene class, the range is { "", "Normal", "Indoor",
"ATM", "Traffic", "FaceRecognition",
"FaceDetection", "NumberStat", "HeatMap",
head.Scene.Type string
DA

"VideoDiagnosis", "VehicleAnalyse",
HU

"TrafficPatrol", "CourseRecord", "Vehicle" ,


"ObjectDetect", "VehicleCompare"}
A_

Range is 0 — 255, 0 means that the scene is


HT

head.Scene.PtzPresetId integer
unassociated with PTZ.
TP

Picture distance feature, the range is { "Normal",


head.Scene.Depth string
_A

"Far", "Middle", "Near" }


Detail config of a scene. For example, when
PI

Scene.Type is "Normal", it's detail includes


head.Scene.Detail.Value string
fo

CameraAngle, CameraDistance, CameraHeight,


etc.
r

head.TimePeriod.Day[0] string The start time of Day, it's format is hh:mm:ss


In

head.TimePeriod.Day[1] string The end time of Day


te

head.TimePeriod.Night[0] string The start time of Night, it's format is hh:mm:ss


lb

head.TimePeriod.Night[1] string The end time of Night


ra

10.1.3 Video Analyse Rule


s

 Get video analyse rule

Table 10-4

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyseRule
Method GET
Description Get video analyse rules config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoAnalyse
Example
Rule
head.Name= line1
Success head.Type=CrossLineDetection
Return head.VideoAnalyseRule[0][0].Enable =true
head.VideoAnalyseRule[0][0].EventHandler= (output of EventHandler is described in

Video Analyse Extend APIs 285


GetEventHandler)

Parameters in Response :
head =table.VideoAnalyseRule[ChannelNo] [RuleNo]
Comment 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 10-5

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set video analyse rules config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoAnalyseRule[0]
Example
[0].Name=myAnalyseRule1&VideoAnalyseRule[0][0].Type=CrossLineDetection
DA

Success
HU

OK
Return
A_

Parameters in URL:
HT

paramName and paramValue are as table below.


In table below, head =VideoAnalyseRule[ChannelNo] [RuleNo]
TP

ChannelNo: integer, array index starts from 0, which means video channel (equals to
_A

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

RuleNo =rule index.


ParamName start with head.Config is only effective with {"CrossLineDetection",
fo

"CrossRegionDetection", "LeftDetection", "TakenAwayDetection"}.


r

Appendix
In

ParamName ParamValue type Description


te

head.Name string Rule name, it must be unique.


lb

The range is {"CrossLineDetection",


ra

"CrossRegionDetection", "LeftDetection",
s

"TakenAwayDetection",
"VideoAbnormalDetection", "FaceDetection",
"AudioMutation", "AudioAnomaly",
head.Type string "VideoUnFocus", "WanderDetection",
"RioterDetection", "ParkingDetection",
"MoveDetection", "NumberStat", "HeatMap",
"FaceAttribute", "VehicleDetect",
"NonMotorDetect", "HumanTrait",
"ObjectPlacement", "ObjectRemoval" }.
head.Enable bool Enable/Disable this rule.
Setting of EventHandler is described in
head.EventHandler —
SetEventHandler.
head.Config.DetectLine[0][0] integer The start point of DetectLine 0;
head.Config.DetectLine[0][1] integer The end point of DetectLine 0;

Video Analyse Extend APIs 286


ParamName ParamValue type Description
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"}.
Maximum width. The width of the object must not
be beyond maximum width.
Adapt to {"CrossLineDetection",
head.Config.SizeFilter.MaxSi
integer "CrossRegionDetection", "LeftDetection",
ze[0]
"TakenAwayDetection", "FaceDetection",
"WanderDetection", "RioterDetection",
"ParkingDetection", "MoveDetection"}.
head.Config.SizeFilter.MaxSi Maximum height. The height of the object must
integer
ze[1] not be beyond maximum height.
head.Config.SizeFilter.MinSi Minimum width. The width of the object must not
integer
ze[0] be less than minimum width.
DA

head.Config.SizeFilter.MinSi Minimum height. The height of the object must


integer
HU

ze[1] not be beyond minimum height.


The start point of DetectRegion 0;
A_

Adapt to {"CrossRegionDetection",
HT

head.Config.DetectRegion[0]
integer "LeftDetection", "TakenAwayDetection",
[0]
TP

"WanderDetection", "RioterDetection",
_A

"ParkingDetection", "MoveDetection"}.
PI

head.Config.DetectRegion[0]
integer The end point of DetectRegion 0;
[1]
fo

head.Config.DetectRegion[1]
integer The start point of DetectRegion 1;
[0]
r

head.Config.DetectRegion[1]
In

integer The end point of DetectRegion 1;


[1]
te

head.Config.DetectRegion[2]
integer The start point of DetectRegion 2;
lb

[0]
head.Config.DetectRegion[2]
ra

integer The start point of DetectRegion 2;


[1]
s

Range is 1 — 600, adapt to {"LeftDetection",


"TakenAwayDetection", "WanderDetection"}.
head.Config.MinDuration integer
Range is 10-300, adapt to {"RioterDetection"}.
Range is 6-300, adapt to {"ParkingDetection"}.
Range is 1 — 10, adapt to {"RioterDetection",
head.Config.Sensitivity integer
"MoveDetection"}.
Range is 0 — 100000000, adapt to
head.Config.EnterThreshold integer
{"NumberStat"}.
Range is 0 — 100000000, adapt to
head.Config.ExitThreshold integer
{"NumberStat"}.
Range is 0 — 100000000, adapt to
head.Config.InsideThreshold integer
{"NumberStat"}.

Video Analyse Extend APIs 287


ParamName ParamValue type Description

head.Config.DirectionStats.En bool Enable/Disable objectdetect Direction. Rule range is


able {"VehicleDetect", "NonMotorDetect",
"HumanTrait"}.

head.Config.DirectionStats.Det integer The start point of DetectLine 0, Rule range is


ectLine[0][0] {"VehicleDetect", "NonMotorDetect",
"HumanTrait"}.

head.Config.DirectionStats.Det integer The start point of DetectLine 0, Rule range is


ectLine[0][1] {"VehicleDetect", "NonMotorDetect",
"HumanTrait"}.

head.Config.DirectionStats.Det integer The start point of DetectLine 1, Rule range is


ectLine[1][0] {"VehicleDetect", "NonMotorDetect",
"HumanTrait"}.
DA
HU

head.Config.DirectionStats.Det integer The start point of DetectLine 1, Rule range is


A_

ectLine[1][1] {"VehicleDetect", "NonMotorDetect",


HT

"HumanTrait"}.
TP

head.Config.DirectionStats.Dir string The range is {"LeftToRight", "RightToLeft",


_A

ection "Both"}. Rule range is {"VehicleDetect",


PI

"NonMotorDetect", "HumanTrait"}.
fo

head.Config.FilterUnAliveEn bool Enable the non-living filtering function. It is false by


able default.
r

head.Config.EyesDistThresh uint32 Set filtering threshold of pupillary distance. If the


In

old actual pupillary distance is less than the threshold,


te

it will be filtered. Refer to GB/T 35678-2017: Value


lb

range [50–no upper limit] required for face


recognition application image technology. The
ra

default value 0 indicates no filtering.


s

head.Config.HelmetEnable bool Enable safety helmet detection. With the function


enabled, the face recognition result carries
information related to safety helmet detection. It
is false by default.

head.Config.TempSwitch uint8 Select temperature monitoring status:


0: Disable temperature monitoring
1: Normal temperature monitoring
2: Debug temperature monitoring

head.Config.TempModel uint8 Temperature monitoring mode (valid when


TempSwitch is not 0):
0: Automatical mode

Video Analyse Extend APIs 288


ParamName ParamValue type Description
1: Thermal image detection mode
2: Calibration mode

head.Config.TempStrategy.T double
Maximum value of normal face temperature range
empValueMax
head.Config.TempStrategy.T double
Minimum value of normal face temperature range
empValueMin
head.Config.TempStrategy.T uint8
Strategy type for calculating face temperature:
empType
0: Use the highest temperature
1: Use the average temperature

head.Config.TempStrategy.S uint8 The number of sliding cache frames. 0 means no


lideNum sliding, and the maximum cache is 32 frames.
head.Config.TempStrategy.H uint8
Parameter for maximum temperature strategy (valid
ightTempStrategy.TempDete when tempType is 0).
DA

ctRegion
Calculate the highest temperature area:
HU

0: Forehead
A_
HT

1: Whole face
TP

head.Config.TempStrategy.A uint8
Parameter for maximum temperature strategy (valid
verageTempStrategy.Strateg
_A

when tempType is 1).


yType
PI

Average temperature strategy type:


0: Center point
fo

1: high temperature point


r

head.Config.TempStrategy.A uint8
In

Parameter for average temperature strategy (valid


verageTempStrategy.PointN when tempType is 1).
te

um
The number of points used to find the average value,
lb

and it is the square of the integer, such as 4, 9, and


ra

16.
s

head.Config.TempStrategy.A bool
Parameter for average temperature strategy (valid
verageTempStrategy.Enable when tempType is 1).
Filter
Whether to enable the removal of the highest
temperature and the lowest temperature to take
the average value:
False: Disable
True: Enable

head.Config.FilterMaskUnAli bool Select whether to enable liveness detection for


veEnable person wearing mask. This value is related to
FilterUnAliveEnable. When FilterUnAliveEnable is
true (liveness detection is enabled), this field is
valid.

Video Analyse Extend APIs 289


10.1.4 Get Last Event Info
 Get Last Event Info

Table 10-6

http://<server>/cgi-bin/devVideoAnalyse.cgi?action=getLastEventInfo&channel=<Chan
Syntax
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
Return
EventInfo.Action=Start
Parameters in Response :
DA

ChannelNo: integer, array index starts from 0, which means video channel (equals to
HU

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


ClassNameStr: str, means Class name.
A_

EventNameStr: str, means Event name.


HT
TP

10.1.5 [Config] GlobalDeviceParam


_A

 Get Global Device Param


PI

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=GlobalDevicePara
Syntax
m
fo

Method GET
r

Description Get Global Device Param


In

[ Request Params ] (key=value format at URL )


te

Name Type R/O Param Description


lb

[ Response Params ] (key=value format )


Name Type R/O Param Description
ra

table object R
s

+LocateHeight Float R Device locate Height


[ Example ]
http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=
Request
GlobalDeviceParam
Response table.GlobalDeviceParam.LocateHeight=10.5

 Set Global Device Param


http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<param
Syntax
Value>[&<paramName>=<paramValue>…]
Method GET
Description Set Global Device Param
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description

Video Analyse Extend APIs 290


GlobalDeviceP
object R Global Device Param
aram
+LocateHeight float R Device locate Height
[ Response Params ] (OK at Body )
Name Type R/O Param Description
[ Example ]
http://<server>/cgi-bin/configManager.cgi?action=setConfig&
Request
GlobalDeviceParam.LocateHeight = 10.5
Response Ok

10.1.6 getTemplateRule
 Gets all intelligent rule configuration templates and default values under
the specified category
DA

Request URL http://<server>/cgi-bin/VideoInAnalyse.cgi?action=getTemplateRule


HU

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

Name Type R/O Description Example


HT

Class Char[32] R the same meaning with "Normal"


TP

Type in config
_A

VideoAnalyseGlobal
"Normal"
PI

"Traffic"
fo

"TrafficPatrol"
"FaceDetection"(shared
r

by face detect and face


In

recognition)
te

in added, Web can use


“ALL” for all rules.
lb

Channel integer R video channel, which 1


ra

starts from 1.
s

Example
http://<server>/cgi-bin/VideoInAnalyse.cgi?action=getTemplateRule&Channel=1&Class=Normal

Response Params ( key=value format in body )


Name Type R/O Description Example
Rule object R rule info
+Normal object R business class
++CrossRegio object R cross region templet
nDetection
++CrossLineD object R default config of
etection crossline
format as the same as
each object in the
second dimension of

Video Analyse Extend APIs 291


VideoAnalyseRule
+++Config object R detail of rule config
++++SizeFilter object R
+++++MinSize int[2] R [0, 0]
+++++MaxSiz int[2] R [8191, 8191]
e
++++DetectLin object[] R
e
++++Direction char[] R "Both"
+++PtzPresetI integer R Preset number 0
d
+++ObjectTyp char[][] R type of detect object ["Unknown"]
es
+++Type char[64] R rule type "CrossLineDetection"
+++Class char[16] R business plan class "Normal"
+++Enable bool R enable the rule false
DA

+++Id integer R rule id 0


HU

Example
Rule.Normal.CrossLineDetection.Id=0
A_

Rule.Normal.CrossLineDetection.Enable=false
HT

Rule.Normal.CrossLineDetection.Class=Normal
TP

Rule.Normal.CrossLineDetection.Type=CrossLineDetection
Rule.Normal.CrossLineDetection.ObjectTypes[0]=Unknown
_A

Rule.Normal.CrossLineDetection.PtzPresetId=0
PI

Rule.Normal.Config.Direction=Both
Rule.Normal.Config.SizeFilter.MaxSize[0]=[8191, 8191]
fo

Rule.Normal.Config.SizeFilter.MinSize[0]=[0, 0]
r


In

10.1.7 [Config] IntelliSchemeTourEnableSetting


te
lb

 Request
ra

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig&IntelliSchemeTour.Enable
s

=<enableValue>
Method SET
Request key=value format at URL
Params
Name Type R/O Description Example
IntelliSchemeT object O IntelliSchemeTour Enable
our Setting
+Enable bool R IntelliSchemeTour Enable True
Setting
Example
http://172.27.2.72/cgi-bin/configManager.cgi?action=setConfig&IntelliSchemeTour.Enable=true
 Response
Request Params key=value format at URL
Name Type R/O Description Example

Video Analyse Extend APIs 292


Example
OK

10.1.8 Getting Intelligent Tour Plan


Get intelligent tour plan
 Request
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=I
ntelliSchemeTour
Method GET
Parameter key=value format at URL
Format
Parameter Type Required Description Example
IntelliSchemeTour object Yes Intelligent package
tour plan
Example
DA

http://172.27.2.72/cgi-bin/configManager.cgi?action=getConfig&name=IntelliSchemeTour
HU

 Response
A_

Parameter key=value format at URL


Format
HT

Parameter Type Required Description Example


TP

IntelliSchemeTour object No Intelligent package


_A

tour plan. No
PI

channel sensitive.
+Enable bool No Whether the true
fo

package tour plan is


enabled.
r

+TourPriMode enumchar[ No Tour priority mode "Switch"


In

32]
te

enumchar[32]{
lb

"Switch": Scene
ra

priority, tour in strict


s

accordance with the


defined tour time.

"Detect": Detection
priority, with the
complete set of data
as the condition for
scene switching
upon completion of
scene detection (For
illegal parking
detection cameras.
Multiple images may
be needed in one

Video Analyse Extend APIs 293


scene. In this case,
the camera can
rotate to the next
scene after all
images are
captured).

"Tour": Tour priority,


similar to detection
priority, with a set of
data as the
condition for scene
switching upon
completion of scene
detection (both
close shot and long
DA

shot available. Apply


close shot first and
HU

then long shot


A_

according to the tour


HT

path).
TP

}
_A
PI

For details, refer to


the capability set
fo

IntelliScheme.getCa
r

ps.
In

+IdleWaitingTime uint32 No Idle waiting time, 10


that is, the idle delay
te

time until the tour


lb

plan continues to
ra

take effect after a


s

user stops operating


the device, in
second(s).
+SceneSwitching uint32 No Scene switching 20
Time time. When the tour
plan is enabled and
the priority mode is
either detection
priority or tour
priority, it will
automatically rotate
to the next scene
after an object
cannot be detected

Video Analyse Extend APIs 294


for a certain period
of time.
+TourPlan object[7][1 No Package tour plan
6]
2D array. The first
dimension indicates
the day of a week,
totally 7 weekdays,
and the second
dimension indicates
the tour groups
supported that day.
++TimeSection TimeSectio No Period of time. "1
n 00:00:00 indicates 00:00:00-23:59:59"
the start time and
23:59:59 indicates
DA

the end time.


HU

++TourPath object[] No Tour path null


A_

1D array, to adjust
HT

the order of
TP

packages. Up to 10
_A

packages are
supported. It is null
PI

by default and
added by a user.
fo

Field values are


r

specified by a user.
In

+++SchemeID uint32 No Intelligent package 1


te

ID, value range:


1-300.
lb

+++Duration uint32 No Retention time, 600


ra

value range:
s

30-36,000 s or 0.

It is 0 by default if
this field is
unavailable.
Indicates that the
switching has not
been made during
the period of time.
+++Speed uint32 No The speed of the 7
camera rotating to
the preset when a
package includes a
preset channel of a

Video Analyse Extend APIs 295


PTZ camera, value
range: 1-10 speed
levels.
Example
table.IntelliSchemeTour.Enable=true
table.IntelliSchemeTour.IdleWaitingTime=10
table.IntelliSchemeTour.SceneSwitchingTime=20
table.IntelliSchemeTour.TourPlan[0][0].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][1].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][2].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][3].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][4].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][5].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][6].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][7].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][8].TimeSection=1 00:00:00-00:00:00
DA

table.IntelliSchemeTour.TourPlan[0][9].TimeSection=1 00:00:00-00:00:00
HU

table.IntelliSchemeTour.TourPlan[0][10].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][11].TimeSection=1 00:00:00-00:00:00
A_

table.IntelliSchemeTour.TourPlan[0][12].TimeSection=1 00:00:00-00:00:00
HT

table.IntelliSchemeTour.TourPlan[0][13].TimeSection=1 00:00:00-00:00:00
TP

table.IntelliSchemeTour.TourPlan[0][14].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[0][15].TimeSection=1 00:00:00-00:00:00
_A

table.IntelliSchemeTour.TourPlan[1][0].TimeSection=1 00:00:00-00:00:00
PI

table.IntelliSchemeTour.TourPlan[1][1].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][2].TimeSection=1 00:00:00-00:00:00
fo

table.IntelliSchemeTour.TourPlan[1][3].TimeSection=1 00:00:00-00:00:00
r

table.IntelliSchemeTour.TourPlan[1][4].TimeSection=1 00:00:00-00:00:00
In

table.IntelliSchemeTour.TourPlan[1][5].TimeSection=1 00:00:00-23:00:00
te

table.IntelliSchemeTour.TourPlan[1][6].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][7].TimeSection=1 00:00:00-00:00:00
lb

table.IntelliSchemeTour.TourPlan[1][8].TimeSection=1 00:00:00-00:00:00
ra

table.IntelliSchemeTour.TourPlan[1][9].TimeSection=1 00:00:00-00:00:00
s

table.IntelliSchemeTour.TourPlan[1][10].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][11].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][12].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][13].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][14].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[1][15].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][0].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][1].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][2].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][3].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][4].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][5].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][6].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][7].TimeSection=1 00:00:00-00:00:00

Video Analyse Extend APIs 296


table.IntelliSchemeTour.TourPlan[2][8].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][9].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][10].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][11].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][12].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][13].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][14].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[2][15].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][0].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][1].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][2].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][3].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][4].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][5].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][6].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][7].TimeSection=1 00:00:00-00:00:00
DA

table.IntelliSchemeTour.TourPlan[3][8].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][9].TimeSection=1 00:00:00-00:00:00
HU

table.IntelliSchemeTour.TourPlan[3][10].TimeSection=1 00:00:00-00:00:00
A_

table.IntelliSchemeTour.TourPlan[3][11].TimeSection=1 00:00:00-00:00:00
HT

table.IntelliSchemeTour.TourPlan[3][12].TimeSection=1 00:00:00-00:00:00
TP

table.IntelliSchemeTour.TourPlan[3][13].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[3][14].TimeSection=1 00:00:00-00:00:00
_A

table.IntelliSchemeTour.TourPlan[3][15].TimeSection=1 00:00:00-00:00:00
PI

table.IntelliSchemeTour.TourPlan[4][0].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][1].TimeSection=1 00:00:00-00:00:00
fo

table.IntelliSchemeTour.TourPlan[4][2].TimeSection=1 00:00:00-00:00:00
r

table.IntelliSchemeTour.TourPlan[4][3].TimeSection=1 00:00:00-00:00:00
In

table.IntelliSchemeTour.TourPlan[4][4].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][5].TimeSection=1 00:00:00-00:00:00
te

table.IntelliSchemeTour.TourPlan[4][6].TimeSection=1 00:00:00-00:00:00
lb

table.IntelliSchemeTour.TourPlan[4][7].TimeSection=1 00:00:00-00:00:00
ra

table.IntelliSchemeTour.TourPlan[4][8].TimeSection=1 00:00:00-00:00:00
s

table.IntelliSchemeTour.TourPlan[4][9].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][10].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][11].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][12].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][13].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][14].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[4][15].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][0].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][1].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][2].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][3].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][4].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][5].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][6].TimeSection=1 00:00:00-00:00:00

Video Analyse Extend APIs 297


table.IntelliSchemeTour.TourPlan[5][7].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][8].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][9].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][10].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][11].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][12].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][13].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][14].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[5][15].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][0].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][1].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][2].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][3].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][4].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][5].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][6].TimeSection=1 00:00:00-00:00:00
DA

table.IntelliSchemeTour.TourPlan[6][7].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][8].TimeSection=1 00:00:00-00:00:00
HU

table.IntelliSchemeTour.TourPlan[6][9].TimeSection=1 00:00:00-00:00:00
A_

table.IntelliSchemeTour.TourPlan[6][10].TimeSection=1 00:00:00-00:00:00
HT

table.IntelliSchemeTour.TourPlan[6][11].TimeSection=1 00:00:00-00:00:00
TP

table.IntelliSchemeTour.TourPlan[6][12].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPlan[6][13].TimeSection=1 00:00:00-00:00:00
_A

table.IntelliSchemeTour.TourPlan[6][14].TimeSection=1 00:00:00-00:00:00
PI

table.IntelliSchemeTour.TourPlan[6][15].TimeSection=1 00:00:00-00:00:00
table.IntelliSchemeTour.TourPriMode=Switch
fo
r
In

10.1.9 Exporting Intelligent Diagnosis, Allowlist, and Blocklist


te

Information
lb
ra

Export information, such as intelligent diagnosis, allowlist, and blocklist information.


s

Request URL http://<server>/cgi-bin/api/ImExport/exportData


Method POST
Request Params (JSON format in body)
Name Type R/O Description Example
type enumint O Exported data type. 0
enumint{
0 : License plate allowlist
1 : License plate blocklist
2 : License plate blocklist
and allowlist
3: Voice talk contacts
4: Custom password
5: Card recordset

Video Analyse Extend APIs 298


6: Face information for
access control
7: Fingerprints for access
control
8: IPC information of
voice talk
9: Calling person
information
10: Public password
recordset
11: Operation and
maintenance information
}
Request Example
{
"type": 1
DA

}
HU

Response Params (binary in body)


A_

Name Type R/O Description Example


HT

Response Example
TP

HTTP/1.1 200 OK
_A

Server: Device/1.0
Content-Type: application/octet-stream
PI

Content-Length: <length>
fo

< binary data>


r
In

10.1.10 Importing Intelligent O&M, Allowlist, and Blocklist


te

Information
lb
ra

Import intelligent O&M, allowlist, and blocklist information.


s

Request URL http://<server>/cgi-bin/api/ImExport/importData


Method POST
Request Params (multipart in body)
Name Type R/O Description Example
type uint32 R Imported data type 0
enumint{
0 : License plate allowlist
1 : License plate blocklist
2 : License plate blocklist
and allowlist
3: Voice talk contacts
4: Custom password
5: Card recordset

Video Analyse Extend APIs 299


6: Face information for
access control
7: Fingerprint for access
control
8: IPC information of
voice talk
9: Calling person
information
10: Public password
recordset
11: Operation and
maintenance information
}
Request Example
POST http://<server>/cgi-bin/api/ImExport/importData HTTP/1.1
User-Agent: client/1.0
DA

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


HU

--<boundary>
A_

Content-Type: application/json
HT

Content-Length: 12
TP

{
_A

"type": 0
PI

}
--<boundary>
fo

Content-Type: application/octet-stream
r

Content-Length: 800
In
te

< binary data>


--<boundary>
lb
ra

Response Params ( JSON format in body )


s

Name Type R/O Description Example


Response Example
{}

10.1.11 Get Intelligent Caps


URL http://<server>/cgi-bin/intelli.cgi?action=getCaps
Method GET
Description Get video analyse intelligent capabilities.
[ Request Params ] ( key=value )

Video Analyse Extend APIs 300


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
[ Response Params ] ( key=value )
caps object R The video service capabilities.
Analyse mode, can be : RealStream, RecordFileStream,
+AnalyseMode string O
PicFileStream
+MultiChannelM
object O Multi channel description
ode
Array<Arra
++IndepMode O Multi channel open at one time separately
y<object>>
+++Channel int R Video channel number, start from 0
DA

+++Type string R Business class


HU

Array<Arra
++CompMode O Multi channel combined mode
y<object>>
A_

+++Channel int R Video channel number, start from 0


HT

+++Type string R Business class


TP

+MultiVideoAnal Array<obje
O List of channel capabilities
_A

yse ct>
PI

++caps object R Video analyse capabilities


Array<obje
+Algorithm O Algorithm version information
fo

ct>
++Class string R Intelligent analyse class, ex : ObjectDetect
r

++AlgorithmVers
In

string R Algorithm version


ion
te

++AlgorithmVen
sting R Algorithm Vendor name
lb

dor
Array<obje
ra

+TotalCapacity O Intelligent analyse total capacity


ct>
s

++Class string R Intelligent analyse class, ex : ObjectDetect


Array<strin
++Type R Intelligent analyse rules, ex : FaceDetection
g>
The maximum number of video channels that can be analysed
++Number int R
at same time
[ Example ]
Request GET http://192.168.1.108/cgi-bin/intelli.cgi?action=getCaps
caps.AnalyseMode=RealStream
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 Extend APIs 301


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
caps.Algorithm[0].AlgorithmVendor=Dahua
caps.Algorithm[1].Class=ObjectDetect
caps.Algorithm[1].AlgorithmVersion=V2.8
caps.Algorithm[1].AlgorithmVendor=Dahua

caps.TotalCapacity[0].Class=Normal
caps.TotalCapacity[0].Type[0]=FaceDetection
caps.TotalCapacity[0].Number=3
caps.TotalCapacity[1].Class=ObjectDetect
DA

caps.TotalCapacity[1].Type[0]=FaceDetection
caps.TotalCapacity[1].Number=3
HU


A_
HT

10.1.12 Subscribe Resource Usage Info


TP

URL http://<server>/cgi-bin/intelli.cgi?action=attachResource
_A

Method GET
PI

Description Subscribe the intelligent analyse resource


[ Request Params ] ( key=value format in URL )
fo

Send heartbeat interval, range is [1, 60],unit is second. If the


r

URL contains this parameter, and the value is 5, it means every


In

heartbeat int O 5 seconds the device should send the heartbeat message to
te

the client, the heartbeat meaage are "Heartbeat". If this


lb

parameter is not present, its default value is 60.


[ Response Params ] (key=value format)
ra

Name Type R/O Param Description


s

Array<obj
RemainCapacity R Remain capacity of intelligent analyse
ect>
+Class string R Intelligent analyse class, ex : ObjectDetect
+Number int O Remain number of video channels that can be analysed
[ Example ]
Request GET http://192.168.1.108/cgi-bin/intelli.cgi?action=attachResource&heartbeat=5
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed
Response

--<boundary>
Content-Type: text/plain
Content-Length: <length>

Video Analyse Extend APIs 302


RemainCapacity[0].Class=Normal
RemainCapacity[0].Number=1
RemainCapacity[1].Class=ObjectDetect
RemainCapacity[1].Number=2

--<boundary>
Content-Type: text/plain
Content-Length: 11

Heartbeat
--<boundary>
Content-Type: text/plain
Content-Length: <length>

RemainCapacity[0].Class=Normal
DA

RemainCapacity[0].Number=1
RemainCapacity[1].Class=ObjectDetect
HU

RemainCapacity[1].Number=1
A_


HT
TP

10.1.13 Exporting Encrypted Files


_A
PI

Request URL http://<server>/cgi-bin/api/SecurityImExport/exportData


Method POST
fo

Request Params ( JSON format in body )


r

Name Type R/O Description Example


In

key char[1024] NA Password string "1BBzdSS***"


te

encrypted with public


key and encoded by
lb

Base64
ra

type enumint NA Exported types 0


s

enumint{
0: License plate allowlist
1: License plate blocklist
2: License plate
allowlist/blocklist
3: Voice talk contacts
4: Custom password
5: Card recordset
6: Face information for
access control
7: Fingerprint for access
control
8: Network camera
information of voice talk

Video Analyse Extend APIs 303


9: Calling person
information
10: Public password
recordset
11: Operation and
maintenance
information
12: Face data
13: Face images
}
Request Example
{
"key": "1BBzdSS***",
"type": 0
}
DA

Response Params ( binary in body )


Name Type R/O Description Example
HU

Response Example
A_

HTTP/1.1 200 OK
HT

Server: Device/1.0
TP

Content-Type: application/octet-stream
Content-Length: <length>
_A
PI

< binary data>


//Before the device returns the actual data, use AES symmetric encryption (the key is
fo

generated according to the plaintext conversion after key decryption).


r

//AES-256bit-CBC. Filling mode: PKCS7.


In
te

10.2 Number of People


lb
ra

10.2.1 [Config] Video Widget Number Status


s

People Counting Overlay OSD Configuration Parameters


Config Data Params
Name Type R/O Description Example
Array, one element for each
VideoWidgetNumber
object[] R channel, and the array index is the
Stat
channel number, starting from 0.
Whether to overlay it to the main true
+EncodeBlend bool R
stream video encoding
Whether to display the number of true
+ShowEnterNum bool R
people entering
Whether to display the number of true
+ShowExitNum bool R
people leaving

Video Analyse Extend APIs 304


Text alignment mode: 0
+TextAlign int R 0: Left alignment
2: Right alignment

Please refer to "4.2.1 Obtaining and Setting Configuration" to obtain and set the configuration. The
specific examples are as follows:
Get Config Request Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=VideoWidgetNumberStat
Get Config Response Example
table.VideoWidgetNumberStat[0].EncodeBlend=true
table.VideoWidgetNumberStat[0].ShowEnterNum=true
table.VideoWidgetNumberStat[0].ShowExitNum=true
table.VideoWidgetNumberStat[0].TextAlign=0

Set Config Request Example


DA

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidgetNumberStat[0].EncodeBl
HU

end=true&VideoWidgetNumberStat[0].ShowEnterNum=true&VideoWidgetNumberStat[0].ShowExitNum
A_

=true&VideoWidgetNumberStat[0].TextAlign=0
HT

Set Config Response Example


OK
TP
_A

10.2.2 Get Heat Map Information


PI

Get heat map statistics by time


fo

Request URL http://<server>/cgi-bin/heatMap.cgi?action=getPicByTime


r

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

Name Type R/O Description Example


te

channel int R Video channel number, starting from 1, 1


lb

StartTime char[32] R Heat Map Start time, 24 h: yyyy-MM-dd "2015-08-20


ra

HH:mm:ss. 00:00:00"
EndTime char[32] R Heat Map End time, 24 h: yyyy-MM-dd "2015-08-21
s

HH:mm:ss. 23:59:59"
PtzPresetId int O Preset, starting from 1 1
Request Example
http://192.168.1.108/cgi-bin/heatMap.cgi?action=getPicByTime&channel=1&StartTime=2015-08-20%20
00:00:00&EndTime=2015-08-21%2023:59:59&PtzPresetId=1

Response Params ( binary data in body )


Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: application/octet-stream
Content-Length: <length>

Video Analyse Extend APIs 305


<heatmap data>
Appendix: Format of the heat map
0 1 2 3 4 … 15 16 17 18 …
Width Height Reserved Data: every byte symbolize a pixel

10.2.3 Get People Heat Map Information

Table 10-7

URL http://<server>/cgi-bin/videoStatServer.cgi?action=getHeatMap
Method GET
Description Get People Heat Map Information
[ 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.
PlanID int O The plan id, only valid for dome camera.
DA

StartTime string R The start time, ex: "2010-05-12 20:00:00"


HU

EndTime string R The end time, ex: "2010-05-12 22:00:00"


A_

The heat map type, it can be:


“AverageStayTime” : average stay time heat map
HT

HeatMapType string R
“HumanStatistics” : human statistics heat map
TP

“HumanTrack” : human track heat map


_A

[ Response Params ] ( binary data )


PI

[ Example ]
GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getHeatMap&channel=1&
fo

Request PlanID=2&StartTime=2010-05-12%2020:00:00&EndTime=2010-05-12%2022:00:00&He
r

atMapType=AverageStayTime
HTTP/1.1 200 OK
In

Server: Device/1.0
te

Content-Type: application/octet-stream
Response
lb

Content-Length: <length>
ra

<heat map binary data>


s

Appendix A: The heat map binary data format when HeatMapType is AverageStayTime.
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
ion nnel et ed
16~31
octet

reserved
value

octet 32~35 36~39 40~43 44~44+4*(N-1)

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 Extend APIs 306


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

octet 16~31

value reserved

octet 32~35 36~39 40~43 44~44+4*(N-1)

value line number data num in this line data 1 data N

44+4*(N-1)+1~
octet …… …… ……
44+4*(N-1)+4
DA

value next line number data num in next line data 1 data N
HU

Note: If “lines in this packet” is 0, then all data has been sent, and connection will be closed.
A_

Appendix C: The heat map binary data format when HeatMapType is HumanTrack.
octet 0 1 2 3 4~7 8~11 12~15
HT

versi chann pres reser


TP

value total data length total tracks tracks in this packet


on el et ved
_A

octet 16~31
PI

value reserved
fo

octet 32~35 36~39 40~43 44~44+4*(N-1)


r

track point num in


In

value Object ID track point 1 track point N


this object
te

44+4*(N-1)+1~
octet …… …… ……
lb

44+4*(N-1)+4
track point num in
ra

value next object ID track point 1 track point N


next object
s

Note: If “tracks in this packet” is 0, then all data has been sent, and connection will be closed.

10.2.4 Subscribe People Realtime Trace Information

Table 10-8

URL http://<server>/cgi-bin/videoStatServer.cgi?action=attachRealTraceProc
Method GET
Description Subscribe the people realtime trace information.
[ 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 Extend APIs 307


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 ]
GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=attachRealTraceProc&cha
Request
nnel=1&heartbeat=5
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/octet-stream
DA

Content-Length: <length>
HU

<realtime trace binary data>


A_

--<boundary>
HT

Response
Content-Type: text/plain
TP

Content-Length: 11
_A

Heartbeat
PI

-<boundary>
Content-Type: application/octet-stream
fo

Content-Length: <length>
r
In

<realtime trace binary data>


te

--<boundary>

lb

Appendix A: The realtime trace binary data format.


ra

octet 0 1 2 3 4~7 8~11 12~15


s

chan pres reser object num in this


value version total data length reserved
nel et ved packet

octet 16~31

value reserved

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 Extend APIs 308


10.2.5 Get People Histroy Trace Information

Table 10-9

URL http://<server>/cgi-bin/videoStatServer.cgi?action=getHistoryTrace
Method GET
Description Get people history trace information.
[ 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.
PlanID int O The plan id, only valid for dome camera.
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"
[ Response Params ] ( multipart binary data )
[ Example ]
DA

GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=getHistoryTrace&channel=
Request
1&PlanID=2&StartTime=2010-05-12%2020:00:00&EndTime=2010-05-12%2022:00:00
HU

HTTP/1.1 200 OK
A_

Server: Device/1.0
HT

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


TP

Connection: closed
_A

--<boundary>
PI

Content-Type: application/octet-stream
Content-Length: <length>
fo

Response
r

<history trace binary data>


In

--<boundary>
Content-Type: application/octet-stream
te

Content-Length: <length>
lb
ra

<history trace binary data>


s

--<boundary>

Appendix A: The history trace binary data format.
octet 0 1 2 3 4~7 8~11 12~15
versi chann pres reserv total object object num in this
value total data length
on el et ed num packet
octet 16~31

value reserved

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

Video Analyse Extend APIs 309


object object current
value object ID 2 reserved
coord x coord y time in utc
Note: If “object num in this packet” is 0, then all data has been sent, and connection will be closed.

10.2.6 Subscribe Heat Map Raw Data

Table 10-10

URL http://<server>/cgi-bin/HeatMapManager.cgi?action=attachRaw
Method GET
Description Subscribe the heap map raw data.
[ 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.
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
HU

the client, the heartbeat meaage are "Heartbeat". If this


A_

parameter is not present, its default value is 60.


[ Response Params ] (multipart binary data)
HT

[ Example ]
TP

GET http://192.168.1.108/cgi-bin/HeatMapManager.cgi?action=attachRaw&channel=1&
Request
_A

heartbeat=5
PI

HTTP/1.1 200 OK
Server: Device/1.0
fo

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


Connection: closed
r
In

--<boundary>
te

Content-Type: application/octet-stream
lb

Content-Length: <length>
ra

<heap map raw data>


s

--<boundary>
Response
Content-Type: text/plain
Content-Length: 11

Heartbeat
-<boundary>
Content-Type: application/octet-stream
Content-Length: <length>

<heap map raw data>


--<boundary>

Appendix A: The heap map raw data format.
octet 0 1 2 3 4 ~ 23

Video Analyse Extend APIs 310


value width height StartTime, ex: “2012-01-04 00:00:00”
octet 24~43 44 ~ 47
value EndTime, ex: “2012-01-04 01:00:00” reserved

octet 48 49 …

value Data: every byte symbolize a pixel

10.2.7 Clear statistics in time section

Table 10-11

http://<server>/cgi-bin/videoStatServer.cgi?action=clearSectionStat[&AreaID=<AreaID>][
URL
&PtzPresetId=<PtzPresetId>]
Method GET
Description Clear statistics in time section
DA

[ Request Params ] ( key=value format in URL )


HU

Name Type R/O Param Description


A_

channel int O Video channel index which starts from 1, default is 1.


HT

The area index which starts from 1, valid for multiple area
AreaID int O
device, if omit means clear all area statistics.
TP

PtzPresetId int O The ptz preset index which starts from 1.


_A

[ Response Params ] ( OK )
PI

[ Example ]
Request GET http://192.168.1.108/cgi-bin/videoStatServer.cgi?action=clearSectionStat&AreaID=2
fo

Response OK
r

10.3 CrowdDistriMap
In
te

10.3.1 Get Channel Caps


lb
ra
s

Table 10-12

Syntax http://<server>/cgi-bin/crowdDistriMap.cgi?action=getCaps
Method GET
Description Get Channel CrowdistriMap Caps.
Example http://192.168.1.108/cgi-bin/crowdDistriMap.cgi?action=getCaps
CrowdCapsList[0].channel=<ChannelNo>
CrowdCapsList[0].Support=<Support>
Success
CrowdCapsList[1].channel=<ChannelNo>
Return
CrowdCapsList[1].Support=<Support>

Parameters in URL and Response:
Comment ChannelNo : video channel index
Support : true or false, support or not

Video Analyse Extend APIs 311


10.3.2 Subscribe to Realtime Crowd Stat

Table 10-13

http://<server>/cgi-bin/crowdDistriMap.cgi?action=attach&channel=<ChannelNo>[&he
Syntax
artbeat=<Heartbeat>]
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
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: close

--<boundary>
Content-Type: text/plain
Content-Length: <data length>
DA
HU

CrowdStatData[0].Channel=1
A_

CrowdStatData[0].GloabalPeopleNum =10
HT

CrowdStatData[0].RegionNum =1
CrowdStatData[0].RegionPeopleList[0].RegionID=0
TP

CrowdStatData[0].RegionPeopleList[0].Region[0][0]=10
_A

CrowdStatData[0].RegionPeopleList[0].Region[0][1]=10
PI

CrowdStatData[0].RegionPeopleList[0].Region[1][0]=10
CrowdStatData[0].RegionPeopleList[0].Region[1][1]=100
fo


r

CrowdStatData[0].RegionPeopleList[0].RegionPeopleNum=100
Success
CrowdStatData[0].CrowdEventNum =2
In

Return
CrowdStatData[0].CrowdList[0].Center=2
te

CrowdStatData[0].CrowdList[0].Radius=2
lb

CrowdStatData[0].RegionEventNum =2
ra

CrowdStatData[0].RegionList[0].Region[0][0]=10
CrowdStatData[0].RegionList[0].Region[0][1]=10
s

CrowdStatData[0].RegionList[0].Region[1][0]=10
CrowdStatData[0].RegionList[0].Region[1][0]=100

CrowdStatData[0].RegionList[0].RegionID=0
CrowdStatData[0].RegionList[0].PeopleNum=100
--<boundary>
Content-Type: text/plain
Content-Length: 11

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

Video Analyse Extend APIs 312


CrowdStatData[0].Channel=1

Parameters in URL and Response
ChannelNo: integer, video channel index to subscribe

Region is Polygon, has a list of points, every point has x and y , so Region[0][0] is first
point's x, Region[0][1] is first point's y, Region[1][0] is second point's x, Region[1][1] is
Comment
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
message to the client,the heartbeat meaage are "Heartbeat".

10.3.3 Get Current Crowd Stat


DA

Table 10-14
HU

http://<server>/cgi-bin/crowdDistriMap.cgi?action=getSummary&channel=<ChannelNo
A_

Syntax
>
HT

Method GET
TP

Description Get crowd distribuite map information, return info only once.
_A

Example http://<server>/cgi-bin/crowdDistriMap.cgi?action=getSummary&channel=1
CrowdStatData[0].Channel=1
PI

CrowdStatData[0].GloabalPeopleNum =10
CrowdStatData[0].RegionNum =1
fo

CrowdStatData[0].RegionPeopleList[0].RegionID=0
r

CrowdStatData[0].RegionPeopleList[0].Region[0][0]=10
In

CrowdStatData[0].RegionPeopleList[0].Region[0][1]=10
te

CrowdStatData[0].RegionPeopleList[0].Region[1][0]=10
CrowdStatData[0].RegionPeopleList[0].Region[1][1]=100
lb


ra

CrowdStatData[0].RegionPeopleList[0].RegionPeopleNum=100
Success
s

CrowdStatData[0].CrowdEventNum =2
Return
CrowdStatData[0].CrowdList[0].Center=2
CrowdStatData[0].CrowdList[0].Radius=2
CrowdStatData[0].RegionEventNum =2
CrowdStatData[0].RegionList[0].Region[0][0]=10
CrowdStatData[0].RegionList[0].Region[0][1]=10
CrowdStatData[0].RegionList[0].Region[1][0]=10
CrowdStatData[0].RegionList[0].Region[1][0]=100

CrowdStatData[0].RegionList[0].RegionID=0
CrowdStatData[0].RegionList[0].PeopleNum=100
Similar to above "Subscribe to Realtime Crowd Stat", but reply stat only once, not at
Comment regular time.
ChannelNo: integer, video channel index which starts from 1.

Video Analyse Extend APIs 313


10.4 WorkSuitCompareServer

10.4.1 Creating Compliance Library


Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=createGroup
Method GET
Description Create compliance library
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
GroupName string R Compliance library group name, up to 127 characters.
Preferred solution
CutoutPolicy uint32 R 0: Full body
1: Upper body
GroupDetail string O Remarks of compliance group, up to 255 characters.
[ Response Params ] (key=value format )
DA

Name Type R/O Param Description


HU

GroupID string R Compliance library group ID, up to 63 bytes.


A_

[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=createGroup&GroupName
HT

Request
=Test1&CutoutPolicy=0&GroupDetail=ForTest1
TP

Response groupID=12
_A
PI

10.4.2 Deleting Compliance Library


fo
r

Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=deleteGroup
Method GET
In

Description Delete compliance library


te

[ Request Params ] (key=value format at URL )


lb

Name Type R/O Param Description


ra

GroupID string R Compliance library group ID, up to 63 characters.


[ Response Params ] (key=value format )
s

Name Type R/O Param Description


[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=deleteGroup&groupID=100
Request
00
Response OK

10.4.3 Searching for Compliance Library


Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=findGroup
Method GET
Description Searching for compliance library
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description

Video Analyse Extend APIs 314


GroupID string O Compliance library group ID, up to 63 characters.
[ Response Params ] (key=value format )
Name Type R/O Param Description
GroupList Array<objec O List of compliance group information found.
t>
+GroupID string O Compliance group ID, up to 63 characters.
+GroupName string O Compliance group name, up to 127 characters.
Preferred solution
+CutoutPolicy int O 0: Full body
1: Upper body
+GroupDetail string O Remarks of compliance group, up to 255 characters.
+GroupSize integer O Number of workwears in the current group.
+Channels Array<integ O Video channel No., starting from 0.
er>
+Similarity Array<integ O Similarity threshold; value range: 0–100. Binding video channel No.
er>
DA

+GroupType string O Group type.


HU

[ Example ]
A_

Request http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=findGroup
GroupList[0].GroupID=00001
HT

GroupList[0].GroupName=Test1
TP

GroupList[0].CutoutPolicy=0
_A

GroupList[0].GroupDetail=ForTest1
PI

GroupList[0].GroupSize=30
Response
GroupList[0].Channels[0]=1
fo

GroupList[0].Channels[1]=2
r

GroupList[0].Similarity[0]=80
GroupList[0].Similarity[1]=80
In

GroupList[0].GroupType=BlockListDB
te

10.4.4 Getting Compliance Library Arming Information of


lb
ra

Channels
s

Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=getGroup
Method GET
Get compliance library arming information of channels
Description Note: If the video channel has not been armed with any compliance library, the response will
be returned successfully while body is null.
[ Request Params ] (key=value format at URL)
Name Type R/O Param Description
Channel int R Video channel number. Starting from 1.
[ Response Params ] (key=value format )
Name Type R/O Param Description
GroupList Array<objec O List of armed group information.
t>

Video Analyse Extend APIs 315


+GroupID string O Compliance group ID, up to 63 characters.
+Similarity int O Similarity threshold; value range: 0–100.
[ Example ]
Request http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=getGroup
GroupList[0].GroupID=00001
Response
GroupList[0].Similarity=80

10.4.5 Modifying Compliance Group Information


Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=modifyGroup
Method GET
Description Modify compliance group information
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
GroupID string R Compliance group ID, up to 63 characters.
GroupName string O Compliance library group name, up to 127 characters.
DA

GroupDetail string O Remarks of compliance group, up to 255 characters.


HU

[ Response Params ] (key=value format )


A_

Name Type R/O Param Description


HT

[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=modifyGroup&GroupName
TP

Request
=Test1&GroupDetail=ForTest1
_A

Response OK
PI
fo

10.4.6 Arming Compliance Library by Video Channel


r

Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=setGroup
In

Method GET
te

Arm some compliance libraries to the specified video channels. If the compliance libraries
lb

Description have been armed, update the similarity.


ra

Note: This method is the overall overwriting of arming information.


s

[ Request Params ] (key=value format at URL )


Name Type R/O Param Description
Channel int R Video channel number
GroupList Array<objec O Arming information list: If the list does not exist, the arming of all
t> compliance libraries for the channels are deleted.
+GroupID string O Compliance group ID, up to 63 characters.
+Similarity int O Similarity threshold; value range: 0–100.
[ Response Params ] (key=value format )
Name Type R/O Param Description
[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=setGroup&Channel=0&Gro
Request
upList[0].GroupID=10000&GroupList[0].Similarity=80
Response OK

Video Analyse Extend APIs 316


10.4.7 Searching for Workwear Information in Compliance
Library
Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=startFind
Method GET
Start to search for workwear information in the compliance library.
Description
Note: If doFind is not executed within 60 s, the returned token will expire.
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
Condition Object R Search condition.
Array<strin Array list of compliance library IDs. Each compliance library ID is up
+GroupID R
g> to 63 characters.
WorkSuit object O Search condition of workwear information
+FeatureState int O Feature value status: 0: Unknown; 1: Extraction failed; 2: Extracted
DA

successfully; 3: Modeled but algorithm upgrade causes data


unavailability and remodeling is required.
HU

[ Response Params ] (key=value format )


A_

Name Type R/O Param Description


HT

Token for search task, which is used to get search results and stop
Token uint R
TP

the search.
TotalCount int R Total number of results returned.
_A

[ Example ]
PI

http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=startFind&Condition.Group
Request
ID[0]=10000&Condition.GroupID[1]=10003&WorkSuit.FeatureState=1
fo

Token=123456789
r

Response
TotalCount=24
In

10.4.8 Getting Search Result


te
lb

Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=doFind
ra

Method GET
s

Get a piece of workwear information from the search results.


Description
Note: If doFind is not executed within 60 s, the returned token will expire.
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
Token for search task, which is used to get search results and stop
Token int R
the search.
The starting position of the search result set should be between 0
BeginNumber int R
and totalCount -1.
Count int R The number of the search result.
[ Response Params ] (key=value format )
Name Type R/O Param Description
Found int R The actual number returned by this search.
WorkSuitList array<objec
R List of workwear information found.
t>

Video Analyse Extend APIs 317


+UID string R Workwear identifier, up to 31 characters.
+GroupID string R Compliance library ID, up to 63 characters.
Feature value status: 0: Unknown; 1: Extraction failed; 2: Extracted
+FeatureState int O successfully; 3: Modeled but algorithm upgrade causes data
unavailability and remodeling is required.
[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=doFind&Token=123456789
Request
&BeginNumber=0&Count=1
Found=1
WorkSuitList[0].UID=0005
Response
WorkSuitList[0].GroupID=10000
WorkSuitList[0].FeatureState=0

10.4.9 Stopping Search


Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=stopFind
DA

Method GET
HU

Description Stop search


A_

[ Request Params ] (key=value format at URL )


Name Type R/O Param Description
HT

Token uint R Token for search task, which is used to get search results and stop
TP

the search.
_A

[ Response Params ] (key=value format )


PI

Name Type R/O Param Description


[ Example ]
fo

http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=stopFind&Token=12345678
Request
r

9
Response OK
In

Response OK
te
lb

10.4.10 Deleting Workwear Information


ra

Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=deleteByUID
s

Method GET
Description Delete workwear information
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
UID Array<strin R Workwear identifier list, up to 31 characters.
g>
[ Response Params ] (key=value format )
Name Type R/O Param Description
Error code list, indicating error messages when deleting
information.
ErrCode Array<uint> R 0: Success.
1: The workwear does not exist.
2: Database operation failed.

Video Analyse Extend APIs 318


[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=deletebyUID&UID[0]=10&
Request
UID[1]=11
ErrCode[0]=0
Response
ErrCode[1]=0

10.4.11 Re-extracting Features by Workwear


Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=reAbstract
Method GET
Extract workwear features again. The re-extraction progress is reported through the
Description
"WorkSuitFeatureAbstract" event.
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
UID Array<strin O Workwear identifier list; each UID is up to 31 characters.
g>
DA

[ Response Params ] (key=value format )


HU

Name Type R/O Param Description


A_

[ Example ]
http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=reAbstract&uid[0]=001&ui
HT

Request
d[1]=002
TP
_A

10.4.12 Stopping Re-extracting Workwear Features


PI

Syntax http://<server>/cgi-bin/WorkSuitCompareServer.cgi?action=stopReAbstract
fo

Method GET
r

Description Stop re-extracting workwear features


[ Request Params ] (key=value format at URL )
In

Name Type R/O Param Description


te

[ Response Params ] (key=value format )


lb

Name Type R/O Param Description


ra

[ Example ]
s

Request http://192.168.1.108/cgi-bin/WorkSuitCompareServer.cgi?action=stopReAbstract

10.5 SMD Query

10.5.1 Start SMD Query


Request URL http://<server>/cgi-bin/api/SmdDataFinder.cgi?action=startFind
Method POST
Request Params (JSON format in body)
Name Type R/O Description Example

Video Analyse Extend APIs 319


Condition object R Search conditions
+Channel int32 O Channel number. -1 0
means searching for
all channels
+Channels int[] O Channel number
array (starting from
0). There should be at
least one field,
Channel or Channels.
Generally, If both
Channel and
Channels fields exist,
Channels should
prevail.
+SmdType char[8][ O Video type. Array ["smdTypeHuman", "smdTypeVehicle",
32] "smdTypeHuman": "smdTypeHumanAndVehicle"]
DA

Human.
HU

"smdTypeVehicle":
Vehicle.
A_

"smdTypeHumanAnd
HT

Vehicle": Human and


TP

vehicle.
_A

+StartTime char[32] O Start time "2017-08-01 00:00:00"


+EndTime char[32] O End time "2017-08-02 00:00:00"
PI

+Order char[16] O Search for ordering "ascOrder"


method.
fo

"ascOrder":
r

Ascending order
In

(default value).
te

"descOrder":
Descending order.
lb

Request Example
ra

{
s

"Condition": {
"Channel": 0,
"Channels": [0,1,2,5],
"SmdType": ["smdTypeHuman", "smdTypeVehicle", "smdTypeHumanAndVehicle" ],
"StartTime": "2017-08-01 00:00:00",
"EndTime": "2017-08-02 00:00:00",
"Order": "ascOrder"
}
}

Response Params ( JSON format in body )


Name Type R/O Description Example
Token int O Return searched ID 1
Count int O Total number of 100

Video Analyse Extend APIs 320


searched entries
Response Example
{
"Token": 1,
"Count": 100
}

10.5.2 Searching for SMD Data


Request URL http://<server>/cgi-bin/api/SmdDataFinder/doFind
Method POST
Request Params (JSON format in body)
Name Type R/O Description Example
Token int R Search ID 1
Offset int32 R Location offset 0
DA

Count int R Number of searched 100


HU

items
A_

Request Example
{
HT

"Token": 1,
TP

"Offset": 0,
_A

"Count": 100
PI

}
fo

Response Params ( JSON format in body )


Name Type R/O Description Example
r

SmdInfo object[] R It is an array. Each element


In

represents the historical data


te

of a record data at a certain


lb

time.
+Channel int32 O Channel number, starting from 1
ra

0
s

+EndTime char[32] O End time. "201 "2017-08-02 00:00:00"


+Type char[32] O Video type. "smdTypeHuman"
"smdTypeHuman": Human.
"smdTypeVehicle": Vehicle.
"smdTypeHumanAndVehicle":
Human and vehicle.
+StartTime char[32] O Start time 2017-01-01 10:00:
Response Example
{
"SmdInfo": [{
"Channel": 1,
"StartTime": "2017-08-01 00:00:00",
"EndTime": "2017-08-02 00:00:00",

Video Analyse Extend APIs 321


"Type": "smdTypeHuman"
},…{}]
}

10.5.3 End SMD Search

Request URL http://<server>/cgi-bin/api/SmdDataFinder/stopFind


Method POST
Request Params (JSON format in body)
Name Type R/O Description Example
Token int O Search ID 1
Request Example
{
"Token": 1
DA

}
HU
A_

Response Params ( JSON format in body )


Name Type R/O Description Example
HT

Response Example
TP

{}
_A
PI
fo
r
In
te
lb
ra
s

Video Analyse Extend APIs 322


11 Intelligent Traffic APIs
11.1 Traffic Record

11.1.1 Insert Traffic BlackList/RedList Record

Table 11-1

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=<RecordName>
Method GET
Description Insert traffic BlackList/Red record.
[ Request Params ] ( key=value format in URL )
DA

Name Type R/O Param Description


HU

The record table name, "TrafficBlackList" for BlackList and


name string R
"TrafficRedList" for RedList.
A_

The number of car plate, max string length is 31. It must be


HT

PlateNumber string R
unique.
TP

MasterOfCar string O The car owner, max string length is 15


_A

PlateColor string O Plate color, max string length is 31, ex: "Yellow", "Blue", … etc.
PlateType string O Plate type, max string length is 31.
PI

VehicleType string O Vehicle type, max string length is 31.


fo

Vehicle color, max string length is 31. ex: "Yellow", "Blue", …


VehicleColor string O
etc.
r

BeginTime string O Begin time, ex: "2010-05-25 00:00:00".


In

CancelTime string O Cancel time, ex: "2010-06-25 00:00:00".


te

AuthorityList object O Authority list, only valid for "TrafficRedList" table.


lb

+OpenGate bool O Authority to open the gate.


[ Response Params ] (key=value format)
ra

Name Type R/O Param Description


s

The new record’s id, return -1 if the device handles


RecNo int R
asynchronously.
[ Example ]
GET
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=TrafficBlackList&Pla
Request
teNumber=AC00001&MasterOfCar=ZhangSan&PlateColor=Yellow&VehicleColor=Blue&
BeginTime=2011-01-01%2012:00:00&CancelTime=2011-01-10%2012:00:00
Response RecNo=12345

11.1.2 Update Traffic BlackList/RedList Record

Table 11-2

Intelligent Traffic APIs 323


URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=<RecordName>
Method GET
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.
recno int R record id
The number of car plate, max string length is 31. It must be
PlateNumber string R
unique.
MasterOfCar string O The car owner, max string length is 15
…<See above insert command for other params of the record.
…<other param> - -
They are all optional.>
[ Response Params ] ( OK )
DA

[ Example ]
HU

GET
A_

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=TrafficBlackList&re
Request cno=12345&PlateNumber=AC00001&MasterOfCar=ZhangSan&PlateColor=Yellow&Vehi
HT

cleColor=Blue&BeginTime=2011-01-01%2012:00:00&CancelTime=2011-01-10%2012:00
TP

:00
_A

Response OK
PI

11.1.3 Remove Traffic BlackList/RedList Record


fo
r

Table 11-3
In

URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=<RecordName>
te

Method GET
lb

Descripti
Remove Traffic BlackList/Red record.
on
ra

[ Request Params ] ( key=value format in URL )


s

Name Type R/O Param Description


The record table name, "TrafficBlackList"for BlackList and
name string R
"TrafficRedList"for RedList.
recno int R The record id.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=TrafficBlackList&r
ecno=12345
Response OK

Intelligent Traffic APIs 324


11.1.4 Find Traffic BlackList/RedList Record

Table 11-4

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=<RecordName>
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.
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.
DA

+PlateNumber string O Car plate number, max string length is 47.


+PlateNumberV Car plate number substring, match any car plate number that
HU

string O
ague contain this substring, max string length is 47.
A_

+PlateNumberV array<string
O Car plate number substring array, max string length is 47.
HT

agueGroup >
TP

+QueryCount int O Query count, default is 1000.


+QueryResultBe
_A

int O Begin number in the result set, default is 0.


gin
PI

[ Response Params ] (key=value format)


Name Type R/O Param Description
fo

totalCount int O Total record num that find.


r

found int O Record num that returned.


In

array<object
records R The records that returned.
te

>
+RecNo int R Record id.
lb

+CreateTime int R The create time of record.


ra

+PlateNumber string R Car plate number.


s

+MasterOfCar string O Car owner.


+…<other …<see above insert command for other params of the
- -
param> record>
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=TrafficBlackList&condition.
PlateNumber=AC00001&StartTime=123456700&EndTime=123456800&count=100
totalCount=1000
found=100
records[0].RecNo=12345
Respons
records[0].CreateTime=123456789
e
records[0].PlateNumber=AC00001
records[0].MasterOfCar=ZhangSan

Intelligent Traffic APIs 325


records[1].RecNo=13579
records[1].CreateTime=123456799
records[1].PlateNumber=AC00001
records[1].MasterOfCar=LiSi

11.1.5 RemoveEx Traffic BlackList/RedList Record

Table 11-5

URL http://<server>/cgi-bin/recordUpdater.cgi?action=removeEx&name=<RecordName>
Method GET
Descripti
RemoveEx Traffic BlackList/Red record.
on
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
DA

The record table name, "TrafficBlackList"for BlackList and


name string R
HU

"TrafficRedList"for RedList.
RecNo int O The record id.
A_

PlateNumber string O The number of car plate, max string length is 31. It must be
HT

unique.
TP

[ Response Params ] ( OK )
_A

[ Example ]
PI

GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=removeEx&name=TrafficBlackList
fo

&PlateNumber=AC00001
Response OK
r
In
te

11.2 Intelligent Traffic Event


lb
ra

11.2.1 [Event] TrafficJunction


s

Table 11-6

Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event


Description When detects vehicle passing, 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.
++Code String R Event Code. It should be TrafficJunction.
++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.

Intelligent Traffic APIs 326


+IndexInGroup int O The index of this event in the event group, start from 1.
+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.
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
++BoundingBox Array<int> R
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.
+TrafficCar object O Traffic Car info.
++RecNo int R The record id.
DA

++PlateNumber string R Car plate number.


HU

++PlateType string O Plate type.


A_

++PlateColor string O Plate color, ex: "Yellow", "Blue", … etc.


++VehicleColor string O Vehicle color, ex: "Yellow", "Blue", … etc.
HT

The detected plate bounding box, 4 interge, refer to x's


TP

value of left-top point, y's value of left-top point, x's value


++BoundingBox Array<int> R
_A

of right-bottom point, y's value of right-bottom point.


PI

Coordinate remap to 0 — 8192.


++Country string O Country info. Max string length is 19.
fo

++Speed int O Vehicle speed, unit is km/hour.


r

++Event string O The event info, ex: "TrafficJunction".


+CommInfo object O Traffic event common info.
In

++Seat array<object> O Vehicle front seat info.


te

+++Type string O Front seat type. It can be: "Main""Slave".


lb

Some driver status. It can be some of the following:


+++Status array<string> O
ra

"Smoking", "Calling".
Sunshade status. It can be: "Unknow", "WithSunShade",
s

+++SunShade string O
"WithoutSunShade".
The detected sun shade bounding box, 4 interge, refer to
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.
Coordinate remap to 0 — 8192.
SafeBelt status. It can be: "Unknow", "WithSafeBelt",
+++SafeBelt string O
"WithoutSafeBelt".
[ Example ]
--<boundary>
Content-Type: text/plain
Event Content-Length: <length>

Events[0].EventBaseInfo.Code=TrafficJunction

Intelligent Traffic APIs 327


Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].GroupID=123
Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Events[0].Lane=0
Events[0].Vehicle.BoundingBox[0]=1341
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
Events[0].TrafficCar.RecNo=123
Events[0].TrafficCar.PlateNumber=AC00003
DA

Events[0].TrafficCar.PlateColor=Yellow
Events[0].TrafficCar.VehicleColor=Blue
HU

Events[0].TrafficCar.BoundingBox[0]=1341
A_

Events[0].TrafficCar.BoundingBox[1]=2451
HT

Events[0].TrafficCar.BoundingBox[2]=4513
TP

Events[0].TrafficCar.BoundingBox[3]=4135
Events[0].TrafficCar.Country=China
_A

Events[0].CommInfo.Seat[0].Type=Main
PI

Events[0].CommInfo.Seat[0].Status[0]=Smoking
Events[0].CommInfo.Seat[0].SunShade=WithSunShade
fo

Events[0].CommInfo.Seat[0].ShadePos[0]=2021
r

Events[0].CommInfo.Seat[0].ShadePos[1]=3041
In

Events[0].CommInfo.Seat[0].ShadePos[2]=2151
Events[0].CommInfo.Seat[0].ShadePos[3]=3661
te

Events[0].CommInfo.Seat[0].SafeBelt=WithoutSafeBelt
lb


ra

--<boundary>
s

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

<Jpeg image data>


--<boundary>

11.2.2 [Event] TrafficRetrograde


When detects vehicle retrograde, send this event.
Event params is the same as TrafficJunction, except for event Code is TrafficRetrograde.

Intelligent Traffic APIs 328


11.2.3 [Event] TrafficJam

Table 11-7

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.
++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.
DA

+IndexInGroup int O The index of this event in the event group, start from 1.
+Lane int O Lane number, start from 0.
HU

+StartJaming int O Start jam time, UTC seconds.


A_

+AlarmInterval int O Alarm interval, unit is second.


HT

+JamLenght int O Jam length, percentage of the lane.


TP

+JamRealLengt
int O Jam real length, unit is metre.
h
_A

[ Example ]
PI

--<boundary>
Content-Type: text/plain
fo

Content-Length: <length>
r
In

Events[0].EventBaseInfo.Code=TrafficJam
te

Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
lb

Events[0].GroupID=123
ra

Events[0].CountInGroup=3
s

Events[0].IndexInGroup=1
Events[0].Lane=0
Event
Events[0].StartJaming=123456789
Events[0].AlarmInterval=180
Events[0].JamLenght=70
Events[0].JamRealLength=120

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

<Jpeg image data>


--<boundary>

Intelligent Traffic APIs 329


11.2.4 [Event] TrafficUnderSpeed
When detects vehicle under speed, send this event.
Event params is the same as TrafficJunction, except for event Code is TrafficUnderSpeed, and
add following params:

Table 11-8

[ 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.
Percentage

11.2.5 [Event] TrafficOverSpeed


DA

When detects vehicle over speed, send this event.


HU

Event params is the same as TrafficJunction, except for event Code is TrafficOverSpeed, and add
A_

following params:
HT

Table 11-9
TP

[ Extra Event Params ] ( key=value format )


_A

Name Type R/O Param Description


PI

+SpeedLimit array<int> O Speed limit, 2 integer, min speed and max speed.
+SpeedingPerce
fo

int O Percentage of over speed.


ntage
r
In

11.2.6 [Event] TrafficPedestrain


te
lb

Table 11-10
ra

Usage Refer to "4.4.3 Subscribe to Snapshot"for how to subscribe event


s

Description When detects human in the lane, 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.
++Code String R Event Code. It should be TrafficPedestrain.
++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.
+Vehicle object O Actually this is the human that detected, not vehicle.
++Category string R Must be "Passerby", means this actually is a human.

Intelligent Traffic APIs 330


++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
right-bottom point, y's value of right-bottom point.
Coordinate remap to 0 — 8192.
[ Example ]
Event --<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo.Code=TrafficPedestrain
Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].GroupID=123
Events[0].CountInGroup=3
Events[0].IndexInGroup=1
Events[0].Lane=0
DA

Events[0].Vehicle.Category=Passerby
HU

Events[0].Vehicle.BoundingBox[0]=1341
Events[0].Vehicle.BoundingBox[1]=2451
A_

Events[0].Vehicle.BoundingBox[2]=4513
HT

Events[0].Vehicle.BoundingBox[3]=4135
TP


_A

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

Content-Length: <image size>


fo

<Jpeg image data>


r

--<boundary>
In

11.2.7 [Event] TrafficParking


te
lb

When detects vehicle illegal parking, send this event.


ra

Event params is the same as TrafficJunction, except for event Code is TrafficParking, and
s

remove param "speed", add following params:

Table 11-11

[ Extra Event Params ] ( key=value format )


Name Type R/O Param Description
+StartParking int O The start time of parking, UTC seconds.
+AlarmInterval int O The alarm interval.
+ParkingAllowed
int O The allowed time of parking.
Time

Intelligent Traffic APIs 331


11.3 Traffic Flow

11.3.1 [Event] TrafficFlowStat

Table 11-12

Usage Refer to "4.9.17 Subscribe to Event Message"for how to subscribe event


Description When traffic flow trigger the rule, send this event
[ Event Params ] ( JSON format )
Name Type R/O Param Description
FlowStates array<object> R Traffic flow info, each object in list is traffic flow info about
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.
DA

+PeriodByMili int O Traffic stat time, unit is millisecond, value should


HU

between 0 and 59999.


+DrivingDirectio array<string> O Driving direction, should be an array of three strings:
A_

n  1st string: direction, can be: "Approach", "Leave"


HT

 2nd string: Approach position name


TP

 3rd string: Leave position name


_A

[ Example ]
Event
PI

--<boundary>
Content-Type: text/plain
fo

Content-Length: xxxx
r

Code=TrafficFlowStat;action=Pulse;index=0;data={
In

"FlowStates": [ { "Lane": 0,
te

"Flow": 50,
lb

"Period": 5,
"DrivingDirection": [ "Approach", "Hangzhou", "Shanghai"]
ra

}, {…}, … ]
s

}
--<boundary>

11.3.2 Find Traffic Flow History

Table 11-13

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=TrafficFlow
Method GET
Description Find traffic flow history record.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R The name of record table. It should be "TrafficFlow".

Intelligent Traffic APIs 332


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.
+Channel int O Video channel index which starts from 0.
+Lane int O Lane index, starts from 0.
[ Response Params ] (key=value format)
Name Type R/O Param Description
totalCount int O Total record num that find.
found int O Record num that returned.
records array<object> R The records that returned.
+RecNo int R Record id.
+CreateTime int R The create time of record.
+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.
DA

+Lane int R Lane index, starts from 0.


HU

+Vehicles int R Total vehicle num.


A_

+AverageSpeed float O Average speed of the vehicle, -1 means no vehicle, 0


HT

means congestion.
[ Example ]
TP

Request GET
_A

http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=TrafficFlow&condition.Cha
PI

nnel=0&condition.Lane=0&StartTime=123456700&EndTime=123456800&count=100
Respons totalCount=1000
fo

e found=100
r

records[0].RecNo=12345
records[0].CreateTime=123456789
In

records[0].StaticsticsTime=123456789
te

records[0].Period=300
lb

records[0].Channel=0
ra

records[0].Lane=0
records[0].Vehicles=250
s

records[0].AverageSpeed=25.4

records[1].RecNo=13579
records[1].CreateTime=123456799
records[1].StaticsticsTime=123456799
records[1].Period=300
records[1].Channel=0
records[1].Lane=0
records[1].Vehicles=220
records[1].AverageSpeed=21.8

Intelligent Traffic APIs 333


11.3.3 Start Traffic Statistics Search
Start Traffic Statistics Search
Request
Syntax http://<server>/cgi-bin/trafficFlowStat.cgi?action=startFind
Method POST
Parameter Format key=value format at URL
Parameter Type Required Description Example
StartTime string Yes Start time, accurate to "2010-05-25 00:00:00"
hour
EndTime string Yes End time, accurate to "2010-05-25 23:59:59"
hour
Channel int No Channel number 0
Lane int No Lane number 0
Lanes int[] No Lane number array, [0]
DA

supports data search by


HU

multiple lanes
ClassType int No As video metadata and 0
A_

road monitoring use the


HT

same database table, they


TP

need to be distinguished
according to their types (0
_A

represents video
PI

metadata and 1
represents road
fo

monitoring).
r

Granularity enumchar[8] No The granularity of Hour


In

statistical information
te

that needs to be returned


in the searching process.
lb

This needs to be
ra

supported by getCaps.
s

Enumchar[8]{
"Minute": By 5 minutes
(hourly report)
"Hour": By hour (daily
report)
"Day": By day (monthly
report)
"Month": By month
(yearly report)
}
The default value is Hour.
PresetID int[] No Preset [1]
Direction enumchar[16] No Search by statistical Both
direction enumchar[16]{

Intelligent Traffic APIs 334


"Both"
"LeftToRight"
"RightToLeft"
}
Example
POST /cgi-bin/trafficFlowStat.cgi?action=startFind HTTP/1.1

{
"StartTime" : "2010-05-25 00:00:00",
"EndTime" : "2010-05-25 23:59:59",
"Channel" : 0,
"Lane" : 0,
"Lanes" : [0],
“ClassType”: 1,
"Granularity" : "Hour"
"PresetID":[1],
DA

"Direction" : "Both"
HU

}
Response
A_

Parameter Format key=value format at URL


HT

Parameter Type Required Description Example


TP

token int Yes Fetched search token 2342343


_A

totalCount int Yes Total count of results that 100


PI

meet the search criteria


Example
fo

token=2342343
r

totalCount=100
In
te

11.3.4 Get Traffic Statistics


lb
ra

Get Traffic Statistics


Request
s

Syntax http://<server>/cgi-bin/trafficFlowStat.cgi?action=doFind
Method GET
Parameter Format key=value format at URL
Parameter Type Required Description Example
token int Yes Search token. 46878
beginNumber int Yes Search begin number. 0
That is to start from the beginNumber
records, fetch the count records, and
return.
0<=beginNumber<=totalCount-1
count int Yes Number of traffic statistic entries per 24
search
Example

Intelligent Traffic APIs 335


http://192.168.1.108/cgi-bin/trafficFlowStat.cgi?action=doFind&token=46878&beginNumber=0&count=24
Response
Parameter Format key=value format at URL
Parameter Type Required Description Example
found int Yes Number of entries that are 100
searched
info int Yes Traffic statistics (For details, [, … ]
see traffic-flow statistics
status information structure
in wiki)
Example
found=100
info=<info>

11.3.5 End Traffic Statistics Search


DA
HU

End Traffic Statistics Search


A_

Request
HT

Syntax http://<server>/cgi-bin/trafficFlowStat.cgi?action=stopFind
Method GET
TP

Parameter Format key=value format at URL


_A

Parameter Type Required Description Example


PI

token uint Yes Search token. 46878


Example
fo

http://192.168.1.108/cgi-bin/trafficFlowStat.cgi?action=stopFind&token=46878
r

Response
In

Parameter Format key=value format at URL


te

Parameter Type Required Description Example


int Yes
lb

Example
ra

ok
s

Intelligent Traffic APIs 336


12 Intelligent Traffic Extend APIs
12.1 Traffic Snap

12.1.1 Get the Specific Parking Space Status

Table 12-1

http://<server>/cgi-bin/trafficSnap.cgi?action=getParkingSpaceStatus&channel=<Chan
Syntax
nelNo>&<paramName>=<paramValue>[&<paramName>=<paramValue>…]
Method GET
Description Get specific parking space(s) status.
DA

http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=getParkingSpaceStatus&condition.L
Example
HU

ane[0]=0&condition.Lane[1]=255
A list of parking space status
A_

status[0].Lane=0
HT

status[0].PictureId=5
TP

status[0].TrafficCar.CountInGroup=1
Success
_A


Return
status[1].Lane=1
PI

status[1].PictureId=4
status[1].TrafficCar.CountInGroup=1
fo


r

Parameters in URL:
In

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


te

paramName and paramValue: detail in table below.


lb

Comment In table below,


ra

index: The index of type array, start from 0


s

Parameters in Response :
TrafficCar: the members refer to TrafficCar

Appendix

ParamName ParamValue type Description


condition.Lane[index] int The Lane value
condition.ResponseLevel int The Level value , refer to condition

12.1.2 Open Strobe

Table 12-2

Syntax http://<server>/cgi-bin/trafficSnap.cgi?action=openStrobe&channel=<ChannelNo>&inf

Intelligent Traffic Extend APIs 337


o.openType=<OpenType>&info.plateNumber=<PlateNumber>
Method GET
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.
Comment
OpenType: string, For now, the value is fixed to "Normal"
PlateNumber: string, the plateNumber of the TrafficCar.

12.1.3 Open/Close Unlicensed Vehicle Detection

Table 12-3
DA

http://<server>/cgi-bin/trafficSnap.cgi?action=<Action>&channel=<ChannelNo>&nam
Syntax
HU

e=UnlicensedVehicle
Method GET
A_

Description Open or Close the unlicensed vehicle detection.


HT

http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=open&channel=1&name=Unlicense
Example
TP

dVehicle
_A

Success
OK
Return
PI

Parameters in URL:
fo

Comment Action: string, this value can be open and close.


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

12.1.4 Snap
te
lb

Table 12-4
ra

Syntax http://<server>/cgi-bin/trafficSnap.cgi?action=manSnap&channel=<ChannelNo>
s

Method GET
Take a snapshot manually. For intelligent traffic device, it should use this method to take
a snapshot.
But, the response is not image data.If you want to get the image data, please follow
these steps:
Description
1. Use the method mentioned chapter (4.4.3 Subscribe to snapshot) to subscribe the
image data, and the eventcode is "TrafficManualSnap".
2. Use the "manSnap"to take a snapshot manually.
3. In the connection which built in the Step 1, the device will send the image data.
Example http://192.168.1.108/cgi-bin/trafficSnap.cgi?action=manSnap&channel=1
Success
OK
Return
Comment Parameters in URL:

Intelligent Traffic Extend APIs 338


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

12.2 Traffic Parking

12.2.1 Get All Status of Parking Spaces

Table 12-5

Syntax http://<server>/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
Method GET
Description Get all valid parking spaces status of one device.
Example http://192.168.1.108/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
status[0].Lane=0
status[0].CustomParkNo = A2701
status[0].Status = Park
status[0].SpaceType = 0
DA


HU

status[1].Lane=1
A_

status[1]. Status = NoPark


HT


Success sceneType = ParkingStatistics
TP

Return statisticsMode = AreaMode


_A

areaStatus[0].Name = A01
PI

areaStatus[0].Count = 10
areaStatus[0].SpaceType = 0
fo

areaStatus[0].RemainCnt = 5
r


areaStatus[1].Name = A02
In

areaStauts[1].Count = 20
te


lb

Parameters in Response :
ra

Status : Park or NoPark


CustomParkNo: customized parking space number
s

SpaceType:0: trolley parking space, 1: Crane parking space


sceneType : scene type; "parkingspace": parking space detection type; and
Comment "parkingstatistics": parking space statistics type
statisticsMode:Statistical mode, valid when the sceneType is "parkingstatistics".
"areamode": area mode, "spacemode": parking space mode
areaStatus:area status. It is an array. It is valid when scenetype is "parkingstatistics"
and statisticsmode is "areamode"
SpaceType:parking space type: 0: trolley parking space, 1: Crane parking space

12.2.2 Parking Space Light State


 Get parking space light state

Intelligent Traffic Extend APIs 339


Table 12-6

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ParkingSpaceLight
Syntax
State
Method GET
Use this method. It can get the light state config. For example, it can know that when the
Description space is free, then the light should be green, and the space is full, the light should be
red.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=ParkingSpac
Example
eLightState
table.ParkingSpaceLightState.SpaceFree.Blue=0
table.ParkingSpaceLightState.SpaceFree.Green=1
table.ParkingSpaceLightState.SpaceFree.Pink=0
table.ParkingSpaceLightState.SpaceFree.Purple=0
table.ParkingSpaceLightState.SpaceFree.Red=0
table.ParkingSpaceLightState.SpaceFree.White=0
DA

table.ParkingSpaceLightState.SpaceFree.Yellow=0
HU

table.ParkingSpaceLightState.SpaceFull.Blue=0
table.ParkingSpaceLightState.SpaceFull.Green=0
A_

table.ParkingSpaceLightState.SpaceFull.Pink=0
HT

table.ParkingSpaceLightState.SpaceFull.Purple=0
TP

table.ParkingSpaceLightState.SpaceFull.Red=1
_A

table.ParkingSpaceLightState.SpaceFull.White=0
table.ParkingSpaceLightState.SpaceFull.Yellow=0
PI

table.ParkingSpaceLightState.SpaceOrder.Blue=0
table.ParkingSpaceLightState.SpaceOrder.Green=0
fo

table.ParkingSpaceLightState.SpaceOrder.Pink=0
r

Success
table.ParkingSpaceLightState.SpaceOrder.Purple=0
Return
In

table.ParkingSpaceLightState.SpaceOrder.Red=0
te

table.ParkingSpaceLightState.SpaceOrder.White=0
table.ParkingSpaceLightState.SpaceOrder.Yellow=1
lb

table.ParkingSpaceLightState.SpaceOverLine.Blue=0
ra

table.ParkingSpaceLightState.SpaceOverLine.Green=0
s

table.ParkingSpaceLightState.SpaceOverLine.Pink=0
table.ParkingSpaceLightState.SpaceOverLine.Purple=0
table.ParkingSpaceLightState.SpaceOverLine.Red=0
table.ParkingSpaceLightState.SpaceOverLine.White=0
table.ParkingSpaceLightState.SpaceOverLine.Yellow=1
table.ParkingSpaceLightState.SpaceSpecial.Blue=0
table.ParkingSpaceLightState.SpaceSpecial.Green=0
table.ParkingSpaceLightState.SpaceSpecial.Pink=0
table.ParkingSpaceLightState.SpaceSpecial.Purple=0
table.ParkingSpaceLightState.SpaceSpecial.Red=0
table.ParkingSpaceLightState.SpaceSpecial.White=0
table.ParkingSpaceLightState.SpaceSpecial.Yellow=1
Parameters in Response :
Comment
There are five conditions about the space light state: SpaceFree, SpaceFull,

Intelligent Traffic Extend APIs 340


SpaceOrder, SpaceOverLine, and SpaceSpecial. For each condition, you can choose
the light state.
The state value is integer. It can be 0, 1, 2.
0 means close;
1 means open;
2 means twinkle.
 Set parking space light state

Table 12-7

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set the light state config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ParkingSpaceLightSt
ate.SpaceFree.Blue=1&ParkingSpaceLightState.SpaceFree.Green=0&ParkingSpaceLi
Example ghtState.SpaceFree.Pink=0&ParkingSpaceLightState.SpaceFree.Purple=0&ParkingSp
DA

aceLightState.SpaceFree.Red=0&ParkingSpaceLightState.SpaceFree.White=0&Parki
HU

ngSpaceLightState.SpaceFree.Yellow=0
A_

Success
OK
HT

Return
Comment —
TP
_A

12.2.3 Set Order State


PI

Table 12-8
fo
r

http://<server>/cgi-bin/trafficParking.cgi?action=setOrderState&state[0].Lane=<LaneN
Syntax
In

umber>&state[0].State=<State>
Method GET
te

Description Set the light order state, order or not


lb

http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setOrderState&state[0].Lane=0&s
Example
ra

tate[0].State=Ordered
s

Success
OK
Return
Parameters in URL:
Comment LaneNumber: integer, for now, fixed to 0.
State: string, the value can be "Ordered"or "Free".

12.2.4 Set Light State

Table 12-9

http://<server>/cgi-bin/trafficParking.cgi?action=setLightState&state[Index].LightNo=<L
Syntax aneNumber>&state[Index].Color=<Color>&state[Index].State=<State>&state[Index].
Enable=<Enable>
Method GET

Intelligent Traffic Extend APIs 341


Description Set the light state.
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
Success
OK
Return
Parameters in URL:
Index: integer, start with 0.
LaneNumber: integer, the No. of the Lane.
Comment
Color: string, it can be Red, Yellow, Blue, Green, Purple, White, Pink.
State: integer, it can be 0, 1, 2.0 means close;1 means open;2 means twinkle;
Enable: true or false, enable or not.

12.2.5 [Config] Parking Space Access Filter Setting


 Get parking space access filter setting
DA

Table 12-10
HU

http://<server>/cgi-bin/ConfigManager.cgi?action=getConfig&name=ParkingSpaceAcces
URL
A_

sFilter
HT

Method GET
Get Parking Space Access Filter config. Using this method, we can get the accessible
TP

Description
address of the device.
_A

[ Request Params ] ( None )


PI

[ Response Params ] ( key=value format )


Name Type R/O Param Description
fo

table object R config table object


r

+ParkingSpaceA
object R ParkingSpaceAccessFilter config object
In

ccessFilter
++Enable bool R Enable filter or not
te

++Type string R Filter type, can be: "BannedList", "TrustList".


lb

++TrustList Array<string> O IP address list that trust


ra

++BannedList Array<string> O IP address list that banned.


s

[ Example ]
GET
Request http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=getConfig&name=ParkingSpaceAccessFil
ter
table.ParkingSpaceAccessFilter.Enable=false
Respons table.ParkingSpaceAccessFilter.Type=TrustList
e table.ParkingSpaceAccessFilter.TrustList[0]=172.24.2.14
table.ParkingSpaceAccessFilter.BannedList[0]=172.24.2.15
 Set parking space access filter setting

Table 12-11

URL http://<server>/cgi-bin/ConfigManager.cgi?action=setConfig
Method GET

Intelligent Traffic Extend APIs 342


Descripti
Set Parking Space Access Filter config.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
ParkingSpaceAc
object R ParkingSpaceAccessFilter config object
cessFilter
+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
+BannedList Array<string> O IP address list that banned.
[ Response Params ] ( OK )
[ Example ]
GET
http://10.0.0.8/cgi-bin/ConfigManager.cgi?action=setConfig&ParkingSpaceAccessFilter.Ena
Request
ble=true&ParkingSpaceAccessFilter.Type=TrustList&ParkingSpaceAccessFilter.TrustList[0]
=172.24.2.14&ParkingSpaceAccessFilter.BannedList[0]=172.24.2.15
DA

Respons
OK
HU

e
A_

12.2.6 Set OverLine State


HT
TP

Table 12-12
_A
PI

http://<server>/cgi-bin/trafficParking.cgi?action=setOverLineState&state[0].Lane=<Lan
Syntax
eNumber>&state[0].State=<State>
fo

Method GET
Description Set the spaceState overLine state or StopOverLine state
r

http://192.168.1.108/cgi-bin/trafficParking.cgi?action=setOverLineState&state[0].Lane=
In

Example
0&state[0].State=OverLine
te

Success
OK
lb

Return
ra

Parameters in URL:
Comment LaneNumber: integer, for now, fixed to 0.
s

State: string, the value can be “OverLine” or “StopOverLine”.

12.3 Traffic Record Import Export

12.3.1 Traffic BlackList / RedList


Import the traffic blocklist and allowlist
Upload a blocklist or allowlist file to the device, and then import the data into the device. This
operation might take a long time.
Request URL http://<server>/cgi-bin/trafficRecord.cgi?action=uploadFile&Type=<Type>
Method POST
Request Params ( key=value format in URL ; binary data in body )
Name Type R/O Description Example

Intelligent Traffic Extend APIs 343


Type char[16] R File type, value: "TrafficBlackList"
"TrafficBlackList” Traffic blocklist
"TrafficRedList" Traffic allowlist
format char[16] R File format, fixed to "CSV” "CSV”
code char[16] R Encoding format, the value is "utf-8" or "utf-8"
"GB2312”
Request Example
POST http://192.168.1.108/cgi-bin/trafficRecord.cgi?action=uploadFile&Type=TrafficBlackList&format=
CSV&code=utf-8 HTTP/1.1
User-Agent: Client/1.0
Content-Type: multipart/form-data; boundary=<boundary>
Content-Length:XXXX

--<boundary>
Content-Disposition: form-data; name="blackfile"; filename="TrafficBlackList.CSV"
Content-Type: application/vnd.ms-excel
DA

<File data….>
HU

--<boundary>--
A_
HT

Response Params ( OK in body )


TP

Response Example
_A

OK
PI

 Asynchronously export traffic blocklist and allowlist


Notify the device to export the traffic blocklist and allowlist to the file. This operation is non-blocking.
fo

To obtain the export result, please run the“getFileExportState” command.


r

Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=<Name>


In

Method GET
te

Request Params ( key=value format in URL )


Name Type R/O Description Example
lb

name char[16] R File type, value: "TrafficBlackList"


ra

"TrafficBlackList” Traffic blocklist


s

"TrafficRedList" Traffic allowlist


filename char[256] O Export Filename "RecordFile01"
format char[16] R File format, fixed to "CSV” CSV
code char[16] R Encoding format, the value is "utf-8" or "utf-8"
"GB2312”
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficBlackList&filename=Re
cordFile01&format=CSV&code=utf-8

Response Params ( OK in body )


Response Example
OK

 Get the status of the exported traffic blocklist and allowlist

Intelligent Traffic Extend APIs 344


Get the result of the exported traffic blocklist and allowlist
Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=<Name>
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
name char[16] R File type, value: "TrafficBlackList"
"TrafficBlackList” Traffic blocklist
"TrafficRedList" Traffic allowlist
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficBlackList

Response Params ( key=value format in body )


Name Type R/O Description Example
state int R Exporting status: 1
0: Success
1: Failure
DA

2: running
HU

3: the file is invalid


4: the file is too large
A_

5: the file has duplicate data


HT

Response Example
TP

state=0
_A

Download the exported traffic blocklist and allowlist file


PI


Download the exported traffic blocklist and allowlist file
fo

Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=downloadFile&Type=<Type>


Method GET
r

Request Params ( key=value format in URL )


In

Name Type R/O Description Example


te

Type char[16] R File type, value: "TrafficBlackList"


"TrafficBlackList”: Traffic blocklist
lb

"TrafficRedList": Traffic allowlist


ra

filename char[256] O The exported file name must be the "RecordFile01"


s

same as the file name used in the


export command.
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=downloadFile&Type=TrafficBlackList&filename=Recor
dFile01

Response Params ( binary in body )


Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: application/octet-stream
Content-Length: xxx

<File Data…>

Intelligent Traffic Extend APIs 345


12.3.2 Traffic Flow
 Export traffic flow records
Notify the device to export the traffic flow records to the file. This operation is non-blocking. To
obtain the export result, please run the“getFileExportState” command.
Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficFlow
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
name char[16] R File type, fixed value: "TrafficFlow” "TrafficFlow"
filename char[256] O Name of the exported file "RecordFile01"
format char[16] R Format of the exported file, fixed to CSV
"CSV”
code char[16] R Encoding format of the exported file, "utf-8"
the value is "utf-8" or "GB2312”
Request Example
DA

http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFile&name=TrafficFlow&filename=Record
HU

File01&format=CSV&code=utf-8
A_
HT

Response Params ( OK in body )


TP

Response Example
OK
_A
PI

Get the exported traffic flow record results


Get the exported traffic flow record results
fo

Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficFlo


r

w
In

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

Name Type R/O Description Example


lb

name char[16] R File type, fixed value: "TrafficFlow” "TrafficFlow"


ra

Request Example
s

http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficFlow

Response Params ( key=value format in body )


Name Type R/O Description Example
state int R Export status, the value is 0: success, 1: failure, 2: 1
running, 3: the file is invalid, 4: the file is too large,
5: the file has duplicate data
Response Example
state=0

Download Export 0 traffic flow records File



Download the exported traffic flow log file
Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=downloadFile&Type=TrafficFlow
Method GET

Intelligent Traffic Extend APIs 346


Request Params ( key=value format in URL )
Name Type R/O Description Example
Type char[16] R File type, fixed value: "TrafficFlow” "TrafficFlow"
filename char[256] O The exported file name must be the "RecordFile01"
same as the file name used in the
export command.
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=downloadFile&Type=TrafficFlow&filename=RecordFile
01

Response Params ( binary in body )


Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: application/octet-stream
Content-Length: xxx
DA
HU

<File Data…>
A_
HT

12.3.3 Traffic Snap Event Info


TP
_A

 Export traffic snapshot event records


PI

Notify the device to export the traffic snapshot event records to the file. This operation is
non-blocking. To obtain the export result, please run the “getFileExportState” command.
fo

Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFileByConditon&name=


TrafficSnapEventInfo
r

Method GET
In

Request Params ( key=value format in URL )


te

Name Type R/O Description Example


lb

name char[16] R File type, fixed value: "TrafficSnapEventInfo"


"TrafficSnapEventInfo”
ra

filename char[256] O Export Filename "RecordFile01"


s

format char[16] R File format, fixed to "CSV” CSV


code char[16] R Encoding format, the value is "utf-8" or "utf-8"
"GB2312”
condition object R Data Conditions "utf-8"
+startTime char[16] R Export the Start time, format: "2010-04-08 16:12:46"
yyyy-MM-dd HH:mm:ss
+endTime char[16] R Export the End time, format: "2010-04-08 18:12:46"
yyyy-MM-dd HH:mm:ss
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=exportAsyncFileByConditon&name=TrafficSnapEventI
nfo&filename=RecordFile01&format=CSV&code=utf-8&condition.startTime=2010-04-08%2016:12:46&c
ondition.endTime=2010-04-08%2018:12:46

Intelligent Traffic Extend APIs 347


Response Params ( OK in body )
Response Example
OK

 Obtain and export traffic snapshot event record results


Obtain and export traffic snapshot event record results
Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficSn
apEventInfo
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
name char[16] R File type, fixed value: "TrafficSnapEventInfo"
"TrafficSnapEventInfo”
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=getFileExportState&name=TrafficSnapEventInfo
DA

Response Params ( key=value format in body )


HU

Name Type R/O Description Example


state int R Export status, the value is 0: success, 1: failure, 2: 1
A_

running, 3: the file is invalid, 4: the file is too large,


HT

5: the file has duplicate data


TP

Response Example
_A

state=0
PI

 Download the exported traffic snapshot event record file


fo

Download the exported traffic snapshot event record file


Request URL http://<server>/cgi-bin/recordUpdater.cgi?action=downloadFile&Type=TrafficSnapEve
r

ntInfo
In

Method GET
te

Request Params ( key=value format in URL )


lb

Name Type R/O Description Example


Type char[16] R File type, fixed value: "TrafficSnapEventInfo"
ra

"TrafficSnapEventInfo”
s

filename char[256] O The exported file name must be the "RecordFile01"


same as the file name used in the
export command.
Request Example
http://<server>/cgi-bin/recordUpdater.cgi?action=downloadFile&Type=TrafficSnapEventInfo&filename=
RecordFile01

Response Params ( binary in body )


Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: application/octet-stream
Content-Length: xxx

Intelligent Traffic Extend APIs 348


<File Data…>

12.4 Vehicles Distribution

12.4.1 Subscribe Vehicles Distribution Data

Table 12-13

URL http://<server>/cgi-bin/vehiclesDistribution.cgi?action=attach
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
DA

Send heartbeat interval, range is [1, 60],unit is second. If the


URL contains this parameter, and the value is 5, it means every
HU

heartbeat int O 5 seconds the device should send the heartbeat message to
A_

the client, the heartbeat meaage are "Heartbeat". If this


HT

parameter is not present, its default value is 60.


TP

[ Response Params ] ( key=value format)


Name Type R/O Param Description
_A

Channel int R Video channel index which starts from 1


PI

array<obj
VehiclesData R Vehicles distribution data info.
ect>
fo

+PtzPresetId int R The ptz preset index which starts from 1.


r

+RuleId int R The rule id.


In

The rule type, 197 : vehicle congestion detection, 198 : vehicle


+RuleType int R
te

limit detection.
+VehiclesNum int R The vehicles number.
lb

+QueueLen int R The vehicle queue length.


ra

The detection region, the first array is point list, max item is 32,
array<arr
s

+Region R the second array is point, must be two int, means x and y value,
ay<int>>
coordinate remap to 0 - 8192.
[ Example ]
GET http://192.168.1.108/cgi-bin/vehiclesDistribution.cgi?action=attach&Channel=1&he
Request
artbeat=5
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed
Response
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Intelligent Traffic Extend APIs 349


Channel=1
VehiclesData[0].PtzPresetId=1
VehiclesData[0].RuleId=1
VehiclesData[0].RuleType=197
VehiclesData[0].VehiclesNum=25
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
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>
DA

Content-Type: text/plain
Content-Length: 11
HU
A_

Heartbeat
HT

-<boundary>
TP

Content-Type: text/plain
Content-Length: <length>
_A
PI

Channel=1
VehiclesData[0].PtzPresetId=2
fo


r
In
te
lb
ra
s

Intelligent Traffic Extend APIs 350


13 Thermography and Radiometry APIs
13.1 Thermography Manager

13.1.1 Get Capability of Thermography

Table 13-1

http://<server>/cgi-bin/ThermographyManager.cgi?action=getCaps&channel=<Channe
Syntax
lNo>
Method GET
Description Get thermography capability.
DA

Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getCaps&channel=1
HU

caps.PresetModes = Indoor
caps.Brightness.Max = 100
A_

caps.Brightness.Min = 0
HT

caps.Brightness.Step = 1
TP

caps.Sharpness.Max= 100
_A

caps.Sharpness.Min = 0
caps.Sharpness.Step = 5
PI

caps.EZoom.Max= 24
caps.EZoom.Min = 0
fo

caps.EZoom.Step = 1
r

caps.ThermographyGamma.Max= 8
In

caps.ThermographyGamma.Min = -8
te

caps.ThermographyGamma.Step = 1
Success
caps.SmartOptimizer.Max= 100
lb

Return
caps.SmartOptimizer.Min = 0
ra

caps.SmartOptimizer.Step = 5
s

caps.Agc.Max= 255
caps.Agc.Min = 0
caps.Agc.Step = 5
caps.AgcMaxGain.Max= 255
caps.AgcMaxGain.Min = 0
caps.AgcMaxGain.Step = 5
caps.AgcPlateau.Max= 100
caps.AgcPlateau.Min = 0
caps.AgcPlateau.Step = 5
caps.PresetColorization[i]= Ironbow2
caps.PresetROIModes[j]= Full Screen
Parameters in URL:
Comment ChannelNo: integer, video channel index which starts from 1.

Thermography and Radiometry APIs 351


Parameters in Response:
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"}

13.1.2 Thermography Options


 Get thermography options config

Table 13-2

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

Description Thermography options contain EZoom, Colorization, and SmartOptimizer and so on.
HU

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

yOptions
HT

head.EZoom=0
head.Colorization=White Hot
TP

head.SmartOptimizer=10
_A

head.OptimizedRegion.Type=Custom
PI

head.OptimizedRegion.Enable= true
head.OptimizedRegion.Regions[i][0u]=0
fo

head.OptimizedRegion.Regions[i][1u]=0
r

head.OptimizedRegion.Regions[i][2u]=0
Success
head.OptimizedRegion.Regions[i][3u]=0
In

Return
head.Agc=10
te

head.AgcMaxGain=10
lb

head.AgcPlateau=10
ra

head.Mode="HighTemperature"
head.Auto.LowToHigh=13
s

head.Auto.LHROI=15
head.Auto.HighToLow=12
head.Auto.HLROI=95
Parameters in Response:
head = table.ThermographyOptions [ChannelNo][0]
ChannelNo: integer, array index starts from 0, which means video channel (equals to
Comment
video channel index -1, and so 0 means channel 1).
Regions: the region is a rectangle
i: the array index starts from 0.
 Set thermography options config

Table 13-3

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

Thermography and Radiometry APIs 352


alue>[&<paramName>=<paramValue>…]
Method GET
Description Set thermography options.
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.

In table below,
Comment
head = ThermographyOptions[ChannelNo][0]
ChannelNo: integer, array index starts from 0, which means video channel(equals to
video channel index -1, and so 0 means channel 1).
i: the array index starts from 0.
DA

Appendix
HU

ParamName ParamValue type Description


Range is [0—24].
A_

head.EZoom integer Range and step are got from interface in "13.1.1
HT

Get Capability of Thermography".


TP

Range is {"White Hot", "Black Hot", "Ironbow2",


_A

"IceFire"…}.
head.Colorization String
Range and step are got from interface in "13.1.1
PI

Get Capability of Thermography".


fo

Range is [0—100].
head.SmartOptimizer integer Range and step are got from interface in "13.1.1
r

Get Capability of Thermography".


In

Range is {"Full Screen", "Sky", "Ground",


te

head.OptimizedRegion.Type String "Horizontal", "Center 75%", "Center 50%", "Center


lb

25%", "Custom"}.
head.OptimizedRegion.Enabl true: enable
ra

bool
e false: not enable
s

head.OptimizedRegion.Regi Range is [0—8191].


integer
ons[i][0u] i: the region index, starts from 0.
head.OptimizedRegion.Regi Range is [0—8191].
integer
ons[i][1u] i: the region index, starts from 0.
head.OptimizedRegion.Regi Range is [0—8191].
integer
ons[i][2u] i: the region index, starts from 0.
head.OptimizedRegion.Regi Range is [0—8191].
integer
ons[i][3u] i: the region index, starts from 0.
Range is [0—255].
head.Agc integer Range and step are got from interface in "13.1.1
Get Capability of Thermography".
Range is [0—255].
head.AgcMaxGain integer
Range and step are got from interface in "13.1.1

Thermography and Radiometry APIs 353


ParamName ParamValue type Description
Get Capability of Thermography".
Range and step are got from interface in "13.1.1
head.AgcPlateau integer
Get Capability of Thermography".
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]

13.1.3 Get ExternSystem Information

Table 13-4

http://<server>/cgi-bin/ThermographyManager.cgi?action=getExternSystemInfo&chann
DA

Syntax
el=<ChannelNo>
HU

Method GET
A_

Description Get extern system Info.


http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getExternSystemInfo&
HT

Example
channel=1
TP

sysInfo.SerialNumber = 11111111123
_A

Success sysInfo.SoftwareVersion = 2222222222222


PI

Return sysInfo.FirmwareVersion= 3333333333333


sysInfo.LibVersion = 4444444444
fo

Parameters in URL:
Comment
ChannelNo: integer, video channel index which starts from 1.
r
In

13.1.4 Get Information of Preset Mode


te
lb

Table 13-5
ra

http://<server>/cgi-bin/ThermographyManager.cgi?action=getPresetParam&channel=<
s

Syntax
ChannelNo>&mode=<modeType>
Method GET
Description Get preset mode info.
http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getPresetParam&chan
Example
nel=1&mode=Default
presetInfo.Brightness = 50
presetInfo.Sharpness= 50
presetInfo.EZoom= 12
Success presetInfo.ThermographyGamma= 0
Return presetInfo.Colorization= "White Hot"
presetInfo.SmartOptimizer= 10
presetInfo.OptimizedRegion.Type= Full Screen
presetInfo.OptimizedRegion.Enable= Full Screen

Thermography and Radiometry APIs 354


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
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 :
Regions : the region is a rectangle
i : the array index.

13.1.5 Get Optimized Region Information


DA
HU

Table 13-6
A_

http://<server>/cgi-bin/ThermographyManager.cgi?action=getOptimizedRegion&chann
HT

Syntax
el=<ChannelNo>
TP

Method GET
_A

Description Get optimized region info.


http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=getOptimizedRegion&c
PI

Example
hannel=1
optimizedRegion.Type= Full Screen
fo

optimizedRegion.Enable= true
r

Success optimizedRegion.Regions[i][0u]=0
In

Return optimizedRegion.Regions[i][1u]=0
te

optimizedRegion.Regions[i][2u]=0
optimizedRegion.Regions[i][3u]=0
lb

Parameters in URL:
ra

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


s

Comment
Parameters in Response:
Regions : the region is a rectangle
i: the region index.

13.1.6 Enable Shutter

Table 13-7

http://<server>/cgi-bin/ThermographyManager.cgi?action=enableShutter&channel=<C
Syntax
hannelNo>&enable=<Enable>
Method GET
Description Shutter control, whether enable shutter.
Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=enableShutter&channel

Thermography and Radiometry APIs 355


=1&enable=true
Success
OK
Return
Parameters in URL:
Comment ChannelNo: integer, video channel index which starts from 1.
Enable: true or false, enable or not.

13.1.7 Fix Focus

Table 13-8

http://<server>/cgi-bin/ThermographyManager.cgi?action=fixFocus&linkVideoChannel[
Syntax
0]=<ChannelNo>&linkVideoChannel[1]=<ChannelNo>[&speed=<SpeedValue>]
Method GET
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
DA

nnel[0]=1&linkVideoChannel[1]=2
HU

Success
OK
Return
A_

Parameters in URL:
HT

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


TP

SpeedValue: float, range is 0.0-1.0.


_A

13.1.8 Do Flat Field Correction


PI
fo

Table 13-9
r

http://<server>/cgi-bin/ThermographyManager.cgi?action=doFFC&channel=<Channel
In

Syntax
No>
te

Method GET
lb

Description Do flat field correction.


Example http://192.168.1.108/cgi-bin/ThermographyManager.cgi?action=doFFC&channel=1
ra

Success
s

OK
Return
Parameters in URL:
Comment
ChannelNo: integer, video channel index which starts from 1.

13.2 Radiometry

13.2.1 Get Capability of Radiometry

Table 13-10

http://<server>/cgi-bin/RadiometryManager.cgi?action=getCaps[&channel=<ChannelN
Syntax
o>]
Method GET

Thermography and Radiometry APIs 356


Description Get the capabilities of radiometry manager.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getCaps&channel=1
caps.TotalNum.MaxNum=8
caps.TotalNum.Spot.MaxSpots=8
caps.TotalNum.Line.MaxLines=1
caps.TotalNum.Area.MaxAreas=8
caps.TemperPresets.MaxPresets=256
caps.MeterInfo.Type[0u]=Spot
caps.MeterInfo.Type[1u]=Area
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

Success caps.MeterInfo.ObjectDistanceMeter.Step=1
HU

Return caps.MeterInfo.ReflectedTemperature.Max=100
caps.MeterInfo.ReflectedTemperature.Min=0
A_

caps.MeterInfo.ReflectedTemperature.Default=0
HT

caps.MeterInfo.ReflectedTemperature.Step=1
TP

caps.MeterInfo.RelativeHumidity.Max=100
caps.MeterInfo.RelativeHumidity.Min=0
_A

caps.MeterInfo.RelativeHumidity.Default=0
PI

caps.MeterInfo.RelativeHumidity.Step=1
caps.MeterInfo.AtmosphericTemperature.Max=100
fo

caps.MeterInfo.AtmosphericTemperature.Min=0
r

caps.MeterInfo.AtmosphericTemperature.Default=0
In

caps.MeterInfo.AtmosphericTemperature.Step=1
te

caps.Statistics.MinPeriod=60
caps.Isotherm.MaxTemp=327.0
lb

caps.Isotherm.MinTemp=-20.0
ra

Parameters in URL:
Comment
s

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

13.2.2 Heat Image Thermometry


 Get heat image thermometry config

Table 13-11

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingTherm
Syntax
ometry
Method GET
Description Get HeatImagingThermometry Config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=HeatImaging
Example
Thermometry

Thermography and Radiometry APIs 357


table.RelativeHumidity = 50
table.AtmosphericTemperature =20
table.ObjectEmissivity =1
table.ObjectDistance =100
table.ReflectedTemperature=20
Success table.TemperatureUnit= Centigrade
Return table.Isotherm.Enable=true
table.Isotherm.MaxValue=50
table.Isotherm.MinValue=0
table.Isotherm.ColorBarDisplay=true
table.HotSpotFollow=true
table.TemperEnable=true
Comment —
 Set heat image thermometry config

Table 13-12
DA

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

Syntax
alue>[&<paramName>=<paramValue>…]
A_

Method GET
HT

Description Set HeatImagingThermometry Config


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingThermo
TP

Example
metry.RelativeHumidity=50&HeatImagingThermometry.ObjectDistance=20
_A

Success
OK
PI

Return
Parameters in URL:
fo

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

Appendix
In

ParamName ParamValue type Description


te

The Relative Humidity


lb

HeatImagingThermometry.RelativeHumidity integer range and step are got from


ra

interface in getCaps.
s

The Atmospheric
Temperature range and
HeatImagingThermometry.AtmosphericTemperature float
step are got from interface
in getCaps.
The Object Emissivity
HeatImagingThermometry.ObjectEmissivity float range and step are got from
interface in getCaps.
The Object Distance range
and step are got from
HeatImagingThermometry.ObjectDistance integer
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 358


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
than MinVaue
MinValue range is got form
interface in getCaps.
HeatImagingThermometry.Isotherm.MinValue float
MinValue must be smaller
than MaxVaue.
HeatImagingThermometry.Isotherm.ColorBarDisplay bool true or false
HeatImagingThermometry.HotSpotFollow bool true or false
HeatImagingThermometry.TemperEnable bool true or false
DA

13.2.3 Thermometry Rule


HU

Get thermometry rule config


A_


HT

Table 13-13
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=ThermometryRule
_A

Method GET
PI

Description Get thermometry rule.


http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=Thermometry
fo

Example
Rule
r

head.Enable = true
In

head.PresetId =0
head.RuleId=0
te

head.Name=SpotName
lb

head.Type=Spot
ra

head.MeterRegion.Coordinates[PointNo][0]= 0
s

head.MeterRegion.Coordinates[PointNo][1]= 0

head.T=3
Success head.Alarm.Id=0
Return head.Alarm.Enable=true
head.Alarm.Result =Max
head.Alarm.AlarmCondition=Below
head.Alarm.Threshold=20.0
head.Alarm.PreThreshold=10.0
head.Alarm.PreDuration=30
head.Alarm.Hysteresis=0.1
head.Alarm.Duration=30
head.LocalParameters.Enable=true
head.LocalParameters.ObjectEmissivity=0.95

Thermography and Radiometry APIs 359


head.LocalParameters.ObjectDistance=0.95
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
Alarm= AlarmSetting[AlarmNo]
AlarmNo = alarm index
 Set thermometry rule config

Table 13-14

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

Description Set thermometry rule.


HU

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&ThermometryRule[0]
Example
A_

[0].Name=name1
HT

Success
OK
Return
TP

Parameters in URL:
_A

The paramName and paramValue are in the table below.


PI

In table below,
fo

head = ThermometryRule[ChannelNo][RuleNo]
r

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

PointNo = point index


te

RuleNo =rule index.


lb

Alarm= AlarmSetting[AlarmNo]
ra

AlarmNo = alarm index


s

Appendix

ParamName ParamValue type Description


head.Enable bool Enable/Disable
Range [0—PresetMax]
PresetMax is got from
head.PresetId integer
interface in
GetCurrentProtocolCaps.
Range [0—MaxNum]
head.RuleId integer MaxNum is got from interface
in getCaps.
Radiometry rule name.
head.Name string
char[64]
head.Type string Range is {Spot, Line, Area }.

Thermography and Radiometry APIs 360


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
Temperature Sample period.
head.T integer
Unit is Second.
Range [0 — 65535],unique
head.Alarm.Id integer
alarm id
head.Alarm.Enable bool Enable/Disable
Depend on the vaule of Type
Spot : {Vaule}
head.Alarm.Result string Line: { Max, Min, Aver}
Area: {Max, Min, Aver, Std, Mid,
DA

ISO}
HU

Range is {Below, Match ,


head.Alarm.AlarmCondition string
Above }
A_

head.Alarm.Threshold float Alarm threshold


HT

head.Alarm.Hysteresis float Alarm hysteresis


TP

The duration time of alarm.


head.Alarm.Duration integer
_A

Unit is second
PI

Head.Alarm.PreThreshold float PreAlarm threshold


The duration time of preAlarm.
head.Alarm.PreDuration integer
fo

Unit is second
r

head.LocalParameters.Enable bool Enable/Disable


Range [0 — 1]
In

head.LocalParameters.ObjectEmissivity float
Accuracy is 0.01
te

Object distance
lb

head.LocalParameters.ObjectDistance float The range is got from interface


in getCaps.
ra

Object Reflected Temperature


s

head.LocalParameters.ReflectedTemp float The range is got from interface


in getCaps.

13.2.4 Heat Image Temper Event


 Get heat image temper event config

Table 13-15

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingTemp
Syntax
er
Method GET
Description Get Heat Imaging Temper config
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=HeatImagingT

Thermography and Radiometry APIs 361


emper
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

Table 13-16

http://<server>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramV
Syntax
alue>[&<paramName>=<paramValue>…]
Method GET
Description Set Heat Imaging Temper config
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingTemper[
Example
0].Enable=false&HeatImagingTemper[0].EventHandler.BeepEnable=false
DA

Success
HU

OK
Return
A_

Parameters in URL:
HT

The paramName and paramValue are in the table below.


TP

Comment In table below,


_A

head= HeatImagingTemper[ChannelNo]
PI

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

Appendix
r
In

ParamName ParamValue type Description


head.Enable
te

bool Enable/Disable Heat Imaging Temper feature.


Setting of EventHandler is described in
lb

head.EventHandler —
SetEventHandler.
ra
s

13.2.5 Get Temperature of Particular Point

Table 13-17

http://<server>/cgi-bin/RadiometryManager.cgi?action=getRandomPointTemper&chann
Syntax
el=<ChannelNo>&coordinate[0]=x &coordinate[1]=y
Method GET
Description Get temperature values of random point.
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getRandomPointTemper&
Example
channel=1&coordinate[0]=1024&coordinate[1]=1024
Success TempInfo.Type=Spot
Return TempInfo.TemperAver=27.5
Parameters in URL:
Comment
ChannelNo: integer, video channel index which starts from 1.

Thermography and Radiometry APIs 362


x : The Xscale of the point
y : The Yscale of the point

13.2.6 Get Temperature of Particular Condition

Table 13-18

http://<server>/cgi-bin/RadiometryManager.cgi?action=getTemper&<paramName>=<p
Syntax
aramValue>[&<paramName>=<paramValue>…]
Method GET
Description Get temperature values from rules which have been set.
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getTemper&condition.Pres
Example etId=0&condition.RuleId=0&condition.Type=Spot&condition.Name=Spot1&condition.ch
annel=1
Success TempInfo.Type=Spot
Return TempInfo.TemperAver=27.5
DA

Parameters in URL:
Comment
HU

The paramName and paramValue are in the table below.


A_

Appendix
HT

ParamName ParamValue type Description


TP

condition.Channel integer Video channel index. Start from 1


_A

Range [0- PresetMax]


condition.PresetId PresetMax is got from interface in
PI

integer
GetCurrentProtocolCaps.
fo

Range [0- MaxNum]


condition.RuleId integer
r

MaxNum is got from interface in getCaps.


condition.Type string Range is {Spot, Line, Area}.
In

Name is got from interface in


condition.Name
te

string
GetThermometryRuleConfig.
lb

13.2.7 Query Temperature Information


ra
s

1. Start to query temperature information

Table 13-19

http://<server>/cgi-bin/RadiometryManager.cgi?action=startFind&condition.StartTime=
Syntax <StartTimeValue>&condition.EndTime=<EndTimeValue>&condition.Type=<TypeVal
ue>&condition.channel=<ChannelValue>&condition.Period=<PeriodValue>
Method GET
Description Start to query the history data of temperature values.
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=startFind&condition.StartTi
Example me=2010-04-01%200:00:00&condition.EndTime=2010-04-08%200:00:00&condition.Ty
pe=Spot&condition.channel=1&condition.Period=5
Success token=46878
Return totalCount=333

Thermography and Radiometry APIs 363


Comment The parameters in bold face are as table below.

Appendix

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

Table 13-20

http://<server>/cgi-bin/RadiometryManager.cgi?action=doFind&token=<tokenvalue>&
Syntax
beginNumber=<BeginNumber>&count=<findNum>
Method GET
DA

Description Get the history data of temperature.


http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=doFind&token=46878&be
HU

Example
ginNumber=16&count=16
A_

found=12
HT

info[i].Time=2010-04-08 16:12:46
TP

info[i].PresetId=0
info[i].RuleId=0
_A

info[i].Type=Spot
PI

info[i].Name=xxxx
Success
info[i].Coordinate[0]=1024
fo

Return
info[i].Coordinate[1]=2048
r

info[i].Channel=0
In

info[i].TemperatureUnit=Centigrade
info[i].QueryTemperInfo.TemperAve=50.1
te

info[i].QueryTemperInfo.TemperMax=50.2
lb

info[i].QueryTemperInfo.TemperMin=50.0
ra

Parameters in URL:
s

token: query token, get from interface of the first step above.
beginNumber: the begin index in this query.
Comment
count: the number you want to query.
Params in Resp:
i: the array index.
3. Stop finding temperature information

Table 13-21

Syntax http://<server>/cgi-bin/RadiometryManager.cgi?action=stopFind&token=<tokenvalue>
Method GET
Description Stop to find the history data of temperature values.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=stopFind&token=46878
Success OK

Thermography and Radiometry APIs 364


Return
Comment token: query token, get from interface of the first step.

13.2.8 Subscribe to Temperature Information


Subscribe to temperature information
Request URL http://<server>/cgi-bin/RadiometryManager.cgi?action=attachTemper
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R Video channel number, starting from 1 1
heartbeat int O Heartbeat interval. The unit is second, and 5
the default value is 5. When the device
sends temperature data in the response, it
will periodically send a heartbeat message to
keep it alive according to the heartbeat
DA

interval. The content of the message is the


HU

string "Heartbeat".
Request Example
A_

http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=attachTemper&channel=2&heartbeat=5
HT
TP

Response Params ( multipart ; key=value format in body )


_A

Name Type R/O Description Example


info object[] R Temperature information array
PI

"2010-04-08
+Time char[32] R Record time, format: yyyy-MM-dd HH:mm:ss
fo

16:12:46"
+PresetId int O Preset number, starting from 1 1
r

+RuleId int O Rule number 1


In

Search Type "Spot"


te

"Spot": Spot
+Type char[16] R
lb

"Area": Area
"Line": Line
ra

+Name char[64] O Query item name "xxxx"


s

Query the coordinates of temperature [1024, 2048]


+Coordinate int[2] O
monitoring point
+Channel int O Video channel number, starting from 0 0
Temperature unit, value: "Centigrade"
+TemperatureUnit char[16] R "Centigrade" : Centigrade
"Fahrenheit": Fahrenheit
+QueryTemperInfo object R Temperature information
++TemperAve float R Average temperature 50.1
++TemperMax float R Maximum temperature 50.2
++TemperMin float R Minimum temperature 50.0
Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>

Thermography and Radiometry APIs 365


Connection: closed

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

info[0].Time=2010-04-08 16:12:46
info[0].PresetId=1
info[0].RuleId=1
info[0].Type=Spot
info[0].Name=xxxx
info[0].Coordinate[0]=1024
info[0].Coordinate[1]=2048
info[0].Channel=0
info[0].TemperatureUnit=Centigrade
info[0].QueryTemperInfo.TemperAve=50.1
DA

info[0].QueryTemperInfo.TemperMax=50.2
info[0].QueryTemperInfo.TemperMin=50.0
HU

……
A_

--<boundary>
HT

Content-Type: text/plain
TP

Content-Length: 11
_A

Heartbeat
PI

--<boundary>
……
fo
r

13.2.9 Subscribe to Radiometry Data


In

Subscribe to temperature distribution data


te

Request URL http://<server>/cgi-bin/RadiometryManager.cgi?action=attachProc


lb

Method GET
ra

Request Params ( key=value format in URL )


s

Name Type R/O Description Example


channel int R Video channel number, starting from 1 1
heartbeat int O Heartbeat interval. The unit is second, the 5
value range is [1,60], the default value is 5.
When the device sends temperature data in
the response, it will periodically send a
heartbeat message to keep it alive according
to the heartbeat interval. The content of the
message is the string "Heartbeat".
Request Example
http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=attachTemper&channel=2&heartbeat=5

Response Params ( multipart ; key=value format in body )


Name Type R/O Description Example

Thermography and Radiometry APIs 366


dataInfo object R Temperature distribution data information
+Width int R Image width, in pixels 1920
+Height int R Image height, in pixels 1080
+Channel int O Video channel number, starting from 0 0
Fetching data time, format: yyyy-MM-dd "2010-04-08
+Time char[32] R
HH:mm:ss 16:12:46"
+Length int O Data length 2073600
+sensorType char[16] O Algorithm type, value: "Tau” "Tau"
Decompression parameter, used when
+Unzip object O
sensorType is Tau
O Parameter R required for temperature 1
++ParamR uint
conversion
uint O Parameter B required for temperature 1
++ParamB
conversion
uint O Parameter F required for temperature 1
++ParamF
conversion
DA

uint O Parameter O required for temperature 1


++ParamO
HU

conversion
Response Example
A_

HTTP/1.1 200 OK
HT

Server: Device/1.0
TP

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


Connection: closed
_A
PI

--<boundary>
Content-Type: text/plain
fo

Content-Length: <data length>


r
In

dataInfo.Width=1920
te

dataInfo.Height=1080
dataInfo.Channel=0
lb

dataInfo.Time=2010-05-25 00:00:00
ra

dataInfo.Length=2073600
s

dataInfo.sensorType="Tau"
dataInfo.Unzip.ParamR=1
dataInfo.Unzip.ParamB=1
dataInfo.Unzip.ParamF=1
dataInfo.Unzip.ParamO=1
--<boundary>
Content-Type: application/octet-stream
Content-Length: <data length>

<Binary data>
--<boundary>
Content-Type: text/plain
Content-Length: 11

Thermography and Radiometry APIs 367


Heartbeat
--<boundary>
……

13.2.10 To Fetch Radiometry Data

Table 13-22

http://<server>/cgi-bin/RadiometryManager.cgi?action=toFetch&channel=<ChannelNo
Syntax
>
Method GET
Description Start to fetch radiometry data.
Example http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=toFetch&channel=2
Success
status=Ready
Return
ChannelNo: integer, video channel index which starts from 1.
DA

Comment status: Range is {Ready, Busy}. "Ready"means service available and "Busy"means
HU

service busy.
A_

13.2.11 Get FireWarning Config


HT
TP

Table 13-23
_A

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FireWarning
PI

Method GET
fo

Description Get FireWarning config.


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

head.Enable=true
In

head.PresetId=0
te

head.Row = 31
lb

head.Col = 40
head.Mode="Auto"
ra

head.SmdFilterEnable=false
s

head.MovingTargetFilterEnable=false
head.SunReflectEnable=false
head.TimeDurationEnable=false
Success head.FireDuration= 15
Return head.DetectWindow[windowsNum].Regions[0]=123468789
head.DetectWindow[windowsNum].Regions[1]=123468789
head.DetectWindow[windowsNum].Regions[2]=123468789
head.DetectWindow[windowsNum].Regions[3]=123468789
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 368


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,
If FireWarningMode is "SpaceExClude", then only the first rule used.
windowsNum: support 4 Nums if FireWarningMode is "PtzPreset", 8 if "SpaceExClude"
Postion: only valid in "SpaceExClude"Mode

13.2.12 Set FireWarning Config

Table 13-24

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

alue>[&<paramName>=<paramValue>…]
HU

Method GET
Description Set FireWarning config.
A_

http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FireWarning[0][0].Ea
HT

Example
nble=false
TP

Success
OK
_A

Return
Comment head = FireWarning[ChNum][RuleNum]
PI

Appendix:
fo

ParamName ParamValue type Description


r

head.Enable bool whether fire detect take effect


In

head.PresetId integer The PresetId


te

head.Row integer rows of fire detect area


lb

head.Col integer cols of fire detect area


head.Mode string Range is {"Auto","Normal"}.
ra

Head.SmdFilterEnable bool whether smd filter take effect


s

whether moving target filter take


Head.MovingTargetFilterEnable bool
effect
whether sun reflect filter take
Head.SunReflectEnable bool
effect
whether include fire detect
head.TimeDurationEnable bool duration,only take effect in
SpaceExClude mode
head.FireDuration integer fire last times
head.DetectWindow[windowsNum].Regions[0] integer detect area mask
head.DetectWindow[windowsNum].Sensitivity integer Rage {0,100}
head.DetectWindow[windowsNum].Id integer Rage {0,…}
head.DetectWindow[windowsNum].Name string detect window name
head.EventHandler EventHandler Setting of EventHandler is

Thermography and Radiometry APIs 369


ParamName ParamValue type Description
described in SetEventHandler.

13.2.13 Get FireWarningMode Config

Table 13-25

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FireWarningMode
Method GET
Description Get FireWarningMode config.
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FireWarningMo
Example
de
Success
head.Mode="PtzPreset"
Return
Parameters in Response:
head= table.FireWarningMode[ChannelNo]
Comment
DA

ChannelNo: integer, array index starts from 0, which means video channel (equals to
HU

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


A_

13.2.14 Set FireWarningMode Config


HT
TP

Table 13-26
_A
PI

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

Method GET
Description Set FireWarningMode config.
r

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

Example
. Mode ="SpaceExClude"
te

Success
OK
lb

Return
Comment
ra

head = FireWarningMode[ChannelNo]
s

Appendix:

ParamName ParamValue type Description


head.Mode string Rage is {"PtzPreset","SpaceExClude"}

13.2.15 Get Current Hot Cold Spot

Table 13-27

URL http://<server>/cgi-bin/TemperCorrection.cgi?action=getCurrentHotColdSpot
Method GET
Description Get the max and min temperature values.
[ Request Params ] ( key=value format in URL )

Thermography and Radiometry APIs 370


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.
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
[ Example ]
GET http://192.168.1.108/cgi-bin/TemperCorrection.cgi?action=getCurrentHotColdSpot
Request
&channel=1
info.HotPoint[0]=1150
info.HotPoint[1]=2320
DA

info.HotSpotValue=35.5
HU

Response info.ColdPoint[0]=5452
A_

info.ColdPoint[1]=6192
info.ColdSpotValue=24.3
HT

info.TemperatureUnit=0
TP
_A
PI

13.2.16 Heat Image Temper PreAlarm Event


fo

 Get heat image temper pre event config


r

Table 13-28
In
te

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

Description Get Heat Imaging Temper PreAlarm Event config


ra

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

nt
Success head.Enable=false
Return head.EventHandler. paramName = paramValue
Parameters in Response:
head= table.PreAlarmEvent[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 pre event config

Table 13-29

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

Thermography and Radiometry APIs 371


Description Set Heat Imaging Temper PreAlarm Event config
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
Parameters in URL:
The paramName and paramValue are in the table below.

Comment 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).

Appendix

ParamName ParamValue type Description


head.Enable bool Enable/Disable Heat Imaging Temper feature.
DA

Setting of EventHandler is described in


head.EventHandler —
HU

SetEventHandler.
A_
HT

13.2.17 Get Heat Map Info


TP
_A

Get Heat Map Info.


PI

Request URL http://<server>/cgi-bin/RadiometryManager.cgi?action=getHeatMapsDirectly&channel


=<ChannelNo>
fo

Method GET
r

Request Params ( key=value format in URL )


Name Type R/O Description Example
In

channel int R video channel index which starts 2


te

from 1
lb

Request Example
ra

http://192.168.1.108/cgi-bin/RadiometryManager.cgi?action=getHeatMapsDirectly&channel=2
s

Response Params ( multipart, binary in body )


Name Type R/O Description Example
dataInfo object O Data info
+Height integer O height 0
+Width integer O width 0
+Channel integer O Channel number 0
+Time string O Time of getting data 2010-05-25 00:00:00
+Length integer O Data length 0
+sensorType string O Algorithm type "Tau"
+Unzip object O unzip parameters, it
works when sensorType
was "Tau".
++ParamR integer O Parameter R for 1

Thermography and Radiometry APIs 372


temperature conversion
++ParamB integer O Parameter B for 1
temperature conversion
++ParamF integer O Parameter F for 1
temperature conversion
++ParamO integer O Parameter O for 1
temperature conversion
Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: text/plain
Content-Length: <data length>
DA
HU

dataInfo.Height=0
dataInfo.Width=0
A_

dataInfo.Channel=0
HT

dataInfo.Time=2010-05-25 00:00:00
TP

dataInfo.Length=0
_A

dataInfo.sensorType="Tau"
dataInfo.Unzip.ParamR=1
PI

dataInfo.Unzip.ParamB=1
dataInfo.Unzip.ParamF=1
fo

dataInfo.Unzip.ParamO=1
r
In

--<boundary>
te

Content-Type: application/octet-stream
Content-Length: <data length>
lb
ra

<Binary data>
s

--<boundary>
……

Thermography and Radiometry APIs 373


13.3 TemperCustom

13.3.1 Set Environment Temperature


Syntax http://<server>/cgi-bin/TemperCustom.cgi?action=setEnvTemp
Method GET
Description Set environment temperature
[ Request Params ] (key=value format at URL )
Name Type R/O Param Description
EnvironmentTe environment temperature Magnified 100 times,the unit is
int R
mp 0.01Celsius degree
[ Response Params ] ( OK )
Name Type R/O Param Description
[ Example ]
DA

http://192.168.1.108/cgi-bin/TemperCustom.cgi?action=setEnvTemp&
Request
EnvironmentTemp=2800
HU

Response OK
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

Thermography and Radiometry APIs 374


14 Access Control APIs
14.1 Access User

14.1.1 Add Access User Face

Table 14-1

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=add
Method POST
Description Add an access user face.
[ Request Params ] ( JSON format in body )
DA

Name Type R/O Param Description


HU

UserID string R The user's id.


Info object R The user's info.
A_

+UserName string O The user's name.


HT

The user's room num list, max array size is 32, max string
+RoomNo array<string> O
TP

size is 12. ( This param is not supported by access control. )


_A

The user's face feature, encode with base64, max array size
is 20, and max string size is 2k.
PI

+FaceData array<string> O
Note: There must be at least one between FaceData and
fo

PhotoData.
The user's face photo, encode with base64, max array size is
r

5, and max string size is 200k.


In

+PhotoData array<string> O
Note: There must be at least one between FaceData and
te

PhotoData.
lb

[ Response Params ] ( OK )
[ Example ]
ra

POST http://<server>/cgi-bin/FaceInfoManager.cgi?action=add
s

Content-Type: application/json
Content-Length: <length>

{ "UserID": "102",
"Info": {
Request
"UserName": "ZhangSan",
"RoomNo": [ "301", "303", … ],
"FaceData": [ "xxxx", "xxxx", … ],
"PhotoData": [ "yyyy", "yyyy", … ]
}
}
Response OK

Access Control APIs 375


14.1.2 Modify Access User Face

Table 14-2

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
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
DA

is 20, and max string size is 2k.


+FaceData array<string> O
Note: There must be at least one between FaceData and
HU

PhotoData.
A_

The user's face photo, encode with base64, max array size is
HT

5, max string size is 200k.


+PhotoData array<string> O
Note: There must be at least one between FaceData and
TP

PhotoData.
_A

[ Response Params ] ( OK )
PI

[ Example ]
POST http://<server>/cgi-bin/FaceInfoManager.cgi?action=update
fo

Content-Type: application/json
r

Content-Length: <length>
In

{ "UserID": "102",
te

"Info": {
lb

Request
"UserName": "ZhangSan",
ra

"RoomNo": ["301", "303", …],


s

"FaceData": ["xxxx", "xxxx", …],


"PhotoData": ["yyyy", "yyyy", …]
}
}
Response OK

14.1.3 Delete Access User Face

Table 14-3

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=remove
Method GET
Description Delete an access user face.
[ Request Params ] ( key=value format in URL )

Access Control APIs 376


Name Type R/O Param Description
UserID string R The user's id.
[ Response Params ] ( OK )
[ Example ]
Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=remove&UserID=102
Response OK

14.1.4 Find Access User Face


 Start to find access user face

Table 14-4

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=startFind
Method GET
Descripti
Start to find access user face.
DA

on
[ Request Params ] ( key=value format in URL )
HU

Name Type R/O Param Description


A_

Condition object O Search condition.


HT

+UserID string O The user's id.


TP

[ Response Params ] ( JSON format )


Name Type R/O Param Description
_A

The token of this search, use this token to get result and stop
PI

Token int O
search.
Total int O Result num, return 0 if not found.
fo

[ Example ]
r

Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=startFind


In

{ "Token": 1234,
te

Response "Total": 20
}
lb

 Get the find result


ra
s

Table 14-5

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=doFind
Method GET
Descripti
Get the find result.
on
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The token of this search, use this token to get result and stop
Token int R
search.
Offset int R Offset in the result record set, range is [0, Total – 1].
Count int R Count of result to get.
[ Response Params ] ( JSON format )
Name Type R/O Param Description

Access Control APIs 377


Info array<object> R The face information of user.
+UserID string R The user's id.
The user's face photo's MD5 hash string, max array size is 5,
+MD5 array<string> O
max string size is 33.
[ Example ]
GET
Request http://<server>/cgi-bin/FaceInfoManager.cgi?action=doFind&Token=1234&Offset=0&Coun
t=20
{ "Info": [ {
"UserID": "102",
Response "MD5": [ "xxxx", "xxxx", … ]
}, { … }, … ]
}
 Stop the find session

Table 14-6
DA

URL http://<server>/cgi-bin/FaceInfoManager.cgi?action=stopFind
HU

Method GET
A_

Description Stop the find session.


HT

[ Request Params ] ( key=value format in URL )


TP

Name Type R/O Param Description


Token for this search, use this token to get result and stop
_A

Token int R
search.
PI

[ Response Params ] ( OK )
[ Example ]
fo

Request GET http://<server>/cgi-bin/FaceInfoManager.cgi?action=stopFind&Token=1234


r

Response OK
In

14.1.5 Add Access User Card and Fingerprint


te
lb

 Add Access user card only


ra
s

Table 14-7

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard
Method GET
Description Insert access user card info.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
CardName string R Access user card name, max string length is 32.
CardNo string R Access user card number.
UserID string R The user's id.

Access Control APIs 378


Card status, 0 means normal, and abnormal status can be sum
of following:
 1 << 0: report the loss of the card
 1 << 1: the card is withdrawed
CardStatus int R  1 << 2: the card is frozen
 1 << 3: the card is arrearage
 1 << 4: the card exceeds the time limit
 1 << 5: the card is arrearage but still can open the door, and
there will be voice prompts.
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
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 )
DA

The index of the time sections of each door that this card can
TimeSections array<int> O
HU

open. ( This param is not supported by video talk device )


VTO position number. ( This param is not supported by access
A_

VTOPosition string O
control device )
HT

ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".


TP

ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


_A

Is the card still valid. ( This param is not supported by video talk
IsValid bool O
device )
PI

[ Response Params ] (key=value format)


fo

R/
Name Type Param Description
O
r

RecNo int R The record id.


In

[ Example ]
te

GET
lb

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard&
Request CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&CardType=0&Pass
ra

word=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&VTOPosition=01018001&ValidDateS
s

tart=20151022%20093811&ValidDateEnd=20151222%20093811
Response RecNo=12345
 Add access user card with fingerprint
仅下发卡片请使用
http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCard

Table 14-8

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insertEx&name=AccessControlCard
Method POST
Description Insert access user card and fingerprint. ( This api is not supported by video talk device )
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description

Access Control APIs 379


Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
CardName string O Access user card name, max string length is 32.
CardNo string O Access user card number.
UserID string R The user's id.
Card status, 0 means normal, and abnormal status can be sum
of following:
 1 << 0: report the loss of the card
 1 << 1: the card is withdrawed
CardStatus int O  1 << 2: the card is frozen
 1 << 3: the card is arrearage
 1 << 4: the card exceeds the time limit
 1 << 5: the card is arrearage but still can open the door,
and there will be voice prompts.
The card type:
CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card, 4:
DA

Blacklist Card, 5: Stress Card, 0xff: Mother Card


HU

Password string O The Access card's password.


Doors array<int> O The index of the doors that this card can open.
A_

The index of the time sections of each door that this card can
HT

TimeSections array<int> O
open.
TP

VTO position number. ( This param is not supported by access


VTOPosition string O
_A

control device )
ValidDateStart string O The start of valid date, format is "yyyyMMdd hhmmss".
PI

ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


fo

IsValid bool O Is the card still valid.


FingerprintPack
r

object O The fingerprint packet info.


et
In

+Length int O The length of each fingerprint packet.


te

+Count int O The count of fingerprint packet.


lb

[ Response Params ] (key=value format)


R/
ra

Name Type Param Description


O
s

RecNo int R The record id.


[ Example ]
POST
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insertEx&name=AccessControlCar
d&CardName=ZhangSan&CardNo=12345&UserID=102&CardStatus=0&Password=1234
56&Doors[0]=1&Doors[1]=3&Doors[2]=5&VTOPosition=01018001&ValidDateStart=20151
022%20093811&ValidDateEnd=20151222%20093811&FingerprintPacket.Length=500&Fi
Request
ngerprintPacket.Count=3
Content-Type: application/octet-stream
Content-Length: <length>

<fingerprint packet binary data>


Response RecNo=12345

Access Control APIs 380


14.1.6 Modify Access User Card and Fingerprint
 Update Access user card only

Table 14-9

URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCard
Method GET
Update access user card info.
Description
Note: You should provide at lease one optional param to update.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
recno int R The record id.
CardName string O Access user card name, max string length is 31.
DA

Access user card number.


CardNo string O
HU

Primary key, modification is not allowed in principle


The user's id.
A_

UserID string O
Primary key, modification is not allowed in principle
HT

…<See above insert command for other params of the record,


…<other param>
TP

— —
They are all optional.>
_A

[ Response Params ] ( OK )
PI

[ Example ]
GET
fo

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&
r

CardType=0&Password=123456&Doors[0]=1&Doors[1]=3&Doors[2]=5&ValidDateStart=
In

20151022%20093811&ValidDateEnd=20151222%20093811
te

Response OK
lb

 Update access user card and fingerprint


ra

Table 14-10
s

URL http://<server>/cgi-bin/recordUpdater.cgi?action=updateEx&name=AccessControlCard
Method POST
Update access user card info and fingerprint. ( This api is not supported by video talk
Description device )
Note: You should provide at lease one optional param to update.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
recno int R The record id.
CardName string O Access user card name, max string length is 32.
Access user card number.
CardNo string O
Primary key, modification is not allowed in principle

Access Control APIs 381


The user's id.
UserID string O
Primary key, modification is not allowed in principle
…<See above insert command for other params of the record.
…<other param>
They are all optional.>
FingerprintPack
object O The fingerprint packet info.
et
+Length int O The length of each fingerprint packet.
+Count int O The count of fingerprint packet.
[ Response Params ] ( OK )
[ Example ]
POST
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=updateEx&name=AccessControlC
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
=20151022%20093811&ValidDateEnd=20151222%20093811&FingerprintPacket.Length
Request
=500&FingerprintPacket.Count=3
DA

Content-Type: application/octet-stream
HU

Content-Length: <length>
A_

<fingerprint packet binary data>


HT

Response OK
TP
_A

14.1.7 Delete Access User Card and Fingerprint


PI

 Delete Access user card and fingerprint record by recno


fo

Table 14-11
r
In

URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCard
Method GET
te

Descriptio Remove the access user card and fingerprint record. ( The video talk device can not delete
lb

n fingerprint data.)
ra

[ Request Params ] ( key=value format in URL )


s

Name Type R/O Param Description


Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
recno int R The record id.
[ Response Params ] ( OK )
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCar
d&recno=12345
Response OK
 Delete all Access user card and fingerprint records

Table 14-12

Access Control APIs 382


URL http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCard
Method GET
Descriptio Remove all the access user card and fingerprint records. ( The video talk device can not
n delete fingerprint data.)
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
[ Response Params ] ( OK )
[ Example ]
GET
Request
http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCard
Response OK

14.1.8 Find Access User Card and Fingerprint


DA

 Find Access user card by condition


HU

Table 14-13
A_
HT

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
TP

Method GET
Description Find Access user card record by condition.
_A

[ Request Params ] ( key=value format in URL )


PI

Name Type R/O Param Description


name string R Record Name, should be "AccessControlCard".
fo

count int O Max result to return, default is 1024.


r

StartTime string O The start of the record's CreateTime.


In

EndTime string O The End of the record's CreateTime.


te

condition object O Search condition.


+CardNo string O Access user card number.
lb

+UserID string O The user's id.


ra

+IsValid bool O The access card valid or not.


s

[ Response Params ] (key=value format)


Name Type R/O Param Description
totalCount int O The total record num that find.
found int O The record num that returned.
records array<object> R The records 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.

Access Control APIs 383


Card status, 0 means normal, and abnormal status can be
sum of following:
 1 << 0: report the loss of the card
 1 << 1: the card is withdrawed
+CardStatus int R  1 << 2: the card is frozen
 1 << 3: the card is arrearage
 1 << 4: the card exceeds the time limit
 1 << 5: the card is arrearage but still can open the door,
and there will be voice prompts.
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
The Access card's password. ( This param is not supported
+Password string O
by 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 )
DA

The index of the time sections of each door that this card can
+TimeSections array<int> O
HU

open. ( This param is not supported by video talk device )


VTO position number. ( This param is not supported by
A_

+VTOPosition string O
access control device )
HT

+ValidDateStar
string O The start of valid date, format is "yyyyMMdd hhmmss".
TP

t
_A

+ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".


Is the card still valid. ( This param is not supported by video
PI

+IsValid bool O
talk device )
fo

+Handicap bool O is the cad of extend time


+CitizenIDNo string O citizen card id
r

+RepeatEnter
In

integer O timeout of repeater enter route, unit: s


RouteTimeout
te

user type, it can be {


lb

1: normal user
+UserType integer O
2: user in blacklist
ra

}
s

+FirstEnter bool O is with first enter authority


+DynamicChec
string O dynamic check code
kCode
+UseTime integer O count of use
[ Example ]
GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
Request
&condition.UserID=103&StartTime=123456700&EndTime=123456800&count=100

Access Control APIs 384


totalCount=1000
found=100
records[0].RecNo=12345
records[0].CreateTime=123456789
records[0].CardName=ZhangSan
records[0].CardNo=300
records[0].UserID=103
records[0].CardStatus=0
records[0].CardType=0
records[0].Doors[0]=1
records[0].Doors[1]=3
records[0].Doors[2]=5
records[0].VTOPosition=01018001
records[0].ValidStart=20151022 093811
records[0].ValidEnd=20151222 093811
records[0].IsValid=true
DA

Response …
records[1].RecNo=13579
HU

records[1].CreateTime=123456799
A_

records[1].StaticsticsTime=123456799
HT

records[1].CardName=ZhangSan
TP

records[1].CardNo=302
records[1].UserID=103
_A

records[1].CardStatus=0
PI

records[1].CardType=0
records[1].Doors[0]=2
fo

records[1].Doors[1]=4
r

records[1].Doors[2]=6
In

records[1].VTOPosition=01018002
records[1].ValidStart=20151022 093811
te

records[1].ValidEnd=20151222 093811
lb

records[1].IsValid=true
ra


s

 Find Access user card by recno

Table 14-14

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.
[ Response Params ] (key=value format)
Name Type R/O Param Description
record object R The record that returned.

Access Control APIs 385


+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.>
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCar
Request
d&recno=4
record.RecNo=4
record.CreateTime=123456789
record.CardName=ZhangSan
record.CardNo=300
record.UserID=103
record.CardStatus=0
record.CardType=0
DA

Response record.Doors[0]=1
HU

record.Doors[1]=3
record.Doors[2]=5
A_

record.VTOPosition=01018001
HT

record.ValidStart=20151022 093811
TP

record.ValidEnd=20151222 093811
_A

record.IsValid=true

PI

 Find Access user card and fingerprint by recno


fo

Table 14-15
r
In

URL http://<server>/cgi-bin/recordUpdater.cgi?action=getEx&name=AccessControlCard
Method GET
te

Find Access user card and fingerprint record by recno. ( This api is not supported by
lb

Description
video talk device )
ra

[ Request Params ] ( key=value format in URL )


s

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
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.>
+FingerprintPac
object O The fingerprint packet info.
ket

Access Control APIs 386


++Length int O The length of each fingerprint packet.
++Count int O The count of fingerprint packet.
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=getEx&name=AccessControl
Request
Card&recno=4
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Content-Length: <length>

--<boundary>
Content-Type: text/plain
Content-Length: <length>

record.RecNo=4
record.CreateTime=123456789
DA

record.CardName=ZhangSan
HU

record.CardNo=300
record.UserID=103
A_

record.CardStatus=0
HT

record.CardType=0
Response
TP

record.Doors[0]=1
_A

record.Doors[1]=3
record.Doors[2]=5
PI

record.VTOPosition=01018001
record.ValidStart=20151022 093811
fo

record.ValidEnd=20151222 093811
r

record.IsValid=true
In


te

record.FingerprintPacket.Length=500
record.FingerprintPacket.Count=3
lb

--<boundary>
ra

Content-Type: application/octet-stream
s

Content-Length: <length>

<fingerprint packet binary data>


--<boundary>--

14.1.9 Get the Total Number of Records of Access User Card


and Fingerprint

Table 14-16

http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessControlCar
URL
d

Access Control APIs 387


Method GET
Description Get the total number of records of the access user card record.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCard".
[ Response Params ] ( key=value )
count int R The total number of records.
[ Example ]
GET
Request http://192.168.1.108/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessContr
olCard
Response count=150

14.2 Access control


DA

14.2.1 [Event] AccessControl


HU
A_

Table 14-17
HT
TP

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.
_A

[ Event Params ] ( key=value format )


PI

Name Type R/O Param Description


Events array<object> R Event info array
fo

+EventBaseInfo object R Base info of event


r

++Code String R Event Code. It should be AccessControl


In

++Action String R Event Action. It can be: "Start", "Stop", "Pulse"


te

++Index int O The channel index relate to this event.


+RecNo int R The record id
lb

+Name string O The name of the door


ra

+Type string O The event type. It can be: "Entry", "Exit"


s

Open door result, can be: 0—failed, 1—success


+Status int O
If this param does not exist, that means success.

Access Control APIs 388


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
8 : by password and fingerprint together
9 : by access card and fingerprint together
10: reserved
11: by multiple access user
12: by key
13: by duress password
14: by QR code, local
15: by face recognition, local
16: reserved
DA

17: by ID card
18: by face and ID card
HU

19: by Bluetooth
A_

20: by custom password


HT

21: by UserId and password


TP

22: by face and password


23: by fingerprint and password
_A

+Method int R 24: by fingerprint and face


PI

25: by access card and face


26: by face or password
fo

27: by fingerprint or password


r

28: by fingerprint or face


In

29: by access card or face


30: by access card or fingerprint
te

31: by fingerprint and face and password


lb

32: by access card and face and password


ra

33: by access card and fingerprint and password


s

34: by access card and fingerprint and face


35: by fingerprint or face or password
36: by access card or face or password
37: by access card or fingerprint or face
38: by access card and fingerprint and face and password
39: by access card or fingerprint or face or password
40: by ID card and face, or access card or face
41: by ID card or QR code or face
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

Access Control APIs 389


+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
+Mask integer 1: without mask
2: with mask
}
+ManTemperatu O
object people’s temperature info
reInfo
++CurrentTempe O
float people’s current temperature
rature
O temperature unit:{
0: centigrade
++TemperatureU
DA

integer 1: Fahrenheit
nit
HU

2: Kelvin
}
A_

++IsOverTemper O
HT

bool is over temperature


ature
TP

[ Example ]
_A

--<boundary>
Content-Type: text/plain
PI

Content-Length: <length>
fo

Events[0].EventBaseInfo.Code=TrafficJam
r

Events[0].EventBaseInfo.Action=Pulse
In

Events[0].EventBaseInfo.Index=0
te

Events[0].RecNo=123
lb

Events[0].Name=Door1
Events[0].Type=Entry
ra

Event Events[0].Status=1
s

Events[0].Method=1
Events[0].CardNo=09DDAABB
Events[0].UserID=101

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

<Jpeg image data>


--<boundary>

Access Control APIs 390


14.2.2 [Event] CitizenPictureCompare

Table 14-18

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 )
Name Type R/O Param Description
Events array<object> R Event info array
+EventBaseInfo object R Base info of event
++Code String R Event Code. It should be CitizenPictureCompare
++Action String R Event Action. It can be: "Pulse"
++Index int O The channel index relate to this event.
+UTC uint32 O UTC 时间
+CompareResult bool O compare result. If the similarity is greater than or equal to
DA

the threshold, the comparison is considered successful


+Similarity integer O Similarity of two pictures, Unit: percentage
HU

range[1, 100]
A_

+Threshold integer O check threshold


HT

range[1, 100]
TP

+Citizen String O citzen name


+Sex integer O sex, it can be: {
_A

0 unknow
PI

1 male
2 female
fo

9 not stated
r

}
In

+Ethnicity integer O ethnicity (refer to CitizenIDCard)


+Birth String O birthday, such as "1980-01-01"
te

+Address String O address


lb

+Number String O citizen ID


ra

+Authority String O signing and issuing organization


s

+Start String O Effective date


+End String O Expiration date, and "Endless" mens Long term
effectiveness
+ImageInfo array<object> O Picture information, the first for the face cutout, the second
for the ID card photo
++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
+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

Access Control APIs 391


1 Shooting scene map
++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)
+BuildingNumbe String O building number (for building products)
r
+BuildingUnitNu String O building entrance number (for building products)
mber
+BuildingRoomN String O room number (for building products)
umber
+PersonnelRelat String O relationship (for building products)
ionship
DA

+Method integer O method (refer to OpenDoorMethod)


HU

+EventGroupID integer O event group id, used to associate different events are with
A_

same action. (Used with AccessControlevents)


+CallNumber String O phone number to be called.(called after compare succeed)
HT

(for building products)


TP

+EventType integer O event type:


_A

0: compare result
PI

1: Face acquisition
2: visitor registration
fo

3: Face permission distribution


4: inquirement of ID card face group
r

+UserID String O user ID


In

+FaceIndex integer O face index, range [0,4]


te

+Mask integer O is with mask, it can be {


lb

0: unknow
1: without mask
ra

2: with mask
s

}
default 0.
[ Example ]
--<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo.Code= CitizenPictureCompare
Event
Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].UTC=1999999999
Events[0].CompareResult=true
Events[0].Similarity=80

Access Control APIs 392


Events[0].Threshold=75

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

<Jpeg image data>


--<boundary>

14.2.3 [Event] Door Status Event


For the method of subscribing to events, refer to "错误!未找到引用源。 错误!未找到引用
Usage
源。".
Description Door status event
[ Event Params ] ( key=value format )
Name Type R/O Param Description
DA

Events array<object> R Event array


HU

+EventBaseInfo object R Basic information of event


++Code String R Event code ("DoorStatus")
A_

++Action String R Event action ("Pulse")


HT

++Index int O Door channel


TP

+UTC uint32 - Standard UTC time (without DST deviation of time zone).
_A

Required for access control products, and optional for


intercom products.
PI

+Status enumchar[32] - Door status


fo

Enumchar[32]{
"Open"
r

"Close"
In

"CloseAlways"
te

"OpenAlways"
lb

"Normal"
}
ra

Example
s

--<boundary>
Content-Type: text/plain
Content-Length: <length>

Events[0].EventBaseInfo.Code= DoorStatus
Event Events[0].EventBaseInfo.Action=Pulse
Events[0].EventBaseInfo.Index=0
Events[0].UTC=1999999999
Events[0].Status= CloseAlways
--<boundary>

Access Control APIs 393


14.2.4 Find AccessControl Record

Table 14-19

URL http://<server>/cgi-bin/recordFinder.cgi?action=find&name=<RecordName>
Method GET
Description Find AccessControl record.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
The record table name. It should be
name string R
"AccessControlCardRec".
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.
DA

+CardNo string O Access user card number.


[ Response Params ] (key=value format)
HU

Name Type R/O Param Description


A_

totalCount int O Total record num that find.


HT

found int O Record num that returned.


TP

array<object
records R The records that returned.
>
_A

+RecNo int R Record id.


PI

+CreateTime int O Record create time, UTC time.


+CardNo int R Access user card number.
fo

+CardName string O Access user card name, max string length is 31.
r

The card type:


In

+CardType int O 0: Normal Card, 1: VIP Card, 2: Visitor Card, 3: Patrol Card,
te

4: Blacklist Card, 5: Stress Card, 0xff: Mother Card


+Password string O The Access card's password.
lb

+UserID string R The user's id.


ra

+Type string O The event type. It can be: "Entry", "Exit".


s

Open door result. It can be: 0—failed, 1—success.


+Status int O
If this param does not exist, that means success.
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
The index of the door. ( This param is not supported by
+Door int O
video talk device )
The access user card ID of reader. ( This param is not
+ReaderID string O
supported by video talk device )
+ErrorCode int O The error code, valid only when Status is 0.

Access Control APIs 394


The picture's URL, max string length is 127. ( This param is
+URL string O
not supported by access control device )
The record video's URL, max string length is 127. ( This
+RecordURL string O
param is not supported by access control device )
+IsOverTempera
bool O is over temperature
ture
O temperature unit:{
0: centigrade
+TemperatureUn
integer 1: Fahrenheit
it
2: Kelvin
}
+CurrentTemper O
float current temperature
ature
+CitizenIDResult bool O citizen ID compare result
+CitizenIDName string O citizen name
+CitizenIDNo string O citizen ID number
DA

O sex:{
HU

0: unknow
1: male
A_

+CitizenIDSex integer
2: female
HT

9: not stated
TP

}
_A

+CitizenIDEthnic O
integer citizen ID ethnicity
ity
PI

+CitizenIDBirth string O birthday, format as "1980-01-01"


fo

+CitizenIDAddre O
string address
ss
r

+CitizenIDAutho O
In

string signing and issuing organization


rity
te

+CitizenIDStart string O Effective date


lb

string O Expiration date, and "Endless" mens Long term


+CitizenIDEnd
effectiveness
ra

[ Example ]
s

GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCard
Request
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
Response records[0].CardName=ZhangSan
records[0].UserID=ZhangSan
records[0].Type=Entry
records[0].Method=1

records[1].RecNo=13579

Access Control APIs 395


records[1].CreateTime=123456799
records[1].CardNo=12001
records[1].CardName=ZhangSan
records[1].UserID=ZhangSan
records[1].Type=Exit
records[1].Method=1
… DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

Access Control APIs 396


15 Access Control Extend APIs
15.1 Door

15.1.1 Open Door


Open the door
Request URL http://<server>/cgi-bin/accessControl.cgi?action=openDoor
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R the index of door, starts from 1 1
DA

UserID int O remote user ID 101


Type char[16] O the open type, default value is "Remote" "Remote"
HU

Request Example
A_

http://192.168.1.108/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Rem
HT

ote
TP

Response Params ( OK in body )


_A

Response Example
PI

OK
fo

15.1.2 Get Door Status


r
In

Get status of the door


te

Request URL http://<server>/cgi-bin/accessControl.cgi?action=getDoorStatus


lb

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

Name Type R/O Description Example


s

channel int R the index of door, starts from 1 1


Request Example
http://192.168.1.108/cgi-bin/accessControl.cgi?action=getDoorStatus&channel=1

Response Params ( key=value format in body )


Name Type R/O Description Example
Info object R door status info
+status char[16] R door status, the range is {Open, Break, Close} "Open"
Response Example
Info.status=Open

Access Control Extend APIs 397


15.1.3 Close Door
Close the door
Request URL http://<server>/cgi-bin/accessControl.cgi?action=closeDoor
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
channel int R the index of door, starts from 1. 1
UserID int O remote user ID. 101
Type char[16] O the open type, default value is "Remote". "Remote"
Request Example
http://192.168.1.108/cgi-bin/accessControl.cgi?action=closeDoor&channel=1&UserID=101&Type=Rem
ote

Response Params ( OK in body )


Response Example
DA

OK
HU
A_

15.1.4 Capture Fingerprint


HT
TP

Only ID verification terminals such as ASHZ320/520 are supported. Common access control is not
_A

supported.
PI

Table 15-1
fo

Syntax http://<server>/cgi-bin/accessControl.cgi?action=captureFingerprint
r

Method GET
In

Description Capture fingerprint data, then report it via ‘Fingerprint’ event.


te

[ Request Params ] ( key=value format at URL )


lb

Name Type R/O Param Description


info object R fingerprint data
ra

+ReaderID string R Reader machine ID


s

+FingerPrintNam
string O Fingerprint name (For smart building products)
e
+ UserID string O User Identity (For smart building products)
heartbeat int R Heartbeat interval (sec)
timeout int R Timeout (sec)
[ Response Params ] ( OK )
[ Example ]
GET http://<server>/cgi-bin/accessControl.cgi?action=captureFingerprint&
Request info.ReaderID=101&info.FingerPrintName=aaaa&info.UserID=10221&heartbeat=5&timeou
t=10
Response OK

Access Control Extend APIs 398


15.1.5 Capture face picture
Only ID verification terminals such as ASHZ320/520 are supported. Common access control is not
supported.

Table 15-2

URL http://<server>/cgi-bin/accessControl.cgi?action=captureCmd
Method GET
Description Capture face data, then report it via ‘CitizenPictureCompare’ event.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Capture entity types:
+type int R 0x01 - Face
0x02 - Identification card
DA

+ UserID string O User ID


HU

heartbeat int R Heartbeat interval (sec)


A_

timeout int R Timeout (sec)


[ Response Params ] ( OK )
HT

[ Example ]
TP

GET http://<server>/cgi-bin/accessControl.cgi?action=captureCmd&type
Request
_A

=1&UserID=10221&heartbeat=5&timeout=10
PI

Response OK
fo
r

15.2 Access Control


In
te

15.2.1 Add Access Control Custom Password


lb
ra

Table 15-3
s

http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControlCustomPa
URL
ssword
Method GET
Description Insert access control custom password.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access control custom password record name, should be
name string R
"AccessControlCustomPassword".
UserID string R The user's id.
OpenDoorPass
string R Ths user’s open door password.
word
Ths user’s alarm password. ( This param is not supported by
AlarmPassword string O
video talk device )

Access Control Extend APIs 399


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 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".
ValidCounts int O The password’s valid counts.
OriginSmartGate The origin smart gateway address. ( Video talk device
string O
Way customize. )
[ Response Params ] (key=value format)
R/
Name Type Param Description
O
RecNo int R The record id.
[ Example ]
DA

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=AccessControl
HU

CustomPassword&UserID=102&OpenDoorPassword=123456&Doors[0]=1&Doors[1]=3&
Request
A_

Doors[2]=5&VTOPosition=01018001&ValidDateStart=20151022%20093811&ValidDateEn
d=20151222%20093811&ValidCounts=30
HT

Response RecNo=12345
TP
_A

15.2.2 Modify Access Control Custom Password


PI

Table 15-4
fo

http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=AccessControlCustom
r

URL
Password
In

Method GET
te

Update access control custom password.


Description
lb

Note: You should provide at lease one optional param to update.


[ Request Params ] ( key=value format in URL )
ra

Name Type R/O Param Description


s

Access control custom password record name, should be


name string R
"AccessControlCustomPassword".
recno int R The record id.
UserID string R The user's id.
OpenDoorPass
string R Ths user’s open door password.
word
Doors array<int> O The index of the doors that custom password can open.
…<See above insert command for other params of the record,
…<other param> — —
They are all optional.>
[ Response Params ] ( OK )
[ Example ]

Access Control Extend APIs 400


GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=update&name=AccessContr
olCustomPassword&recno=12345&UserID=102&OpenDoorPassword=123456&Doors[0]
Request
=1&Doors[1]=3&Doors[2]=5&ValidDateStart=20151022%20093811&ValidDateEnd=2015
1222%20093811
Response OK

15.2.3 Delete Access Control Custom Password


 Delete access control custom password record by recno

Table 15-5

http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=AccessControlCustomPa
URL
ssword
Method GET
Descriptio
Remove the access control custom password record by recno.
n
DA

[ Request Params ] ( key=value format in URL )


HU

Name Type R/O Param Description


A_

Access user card and fingerprint record name, should be


name string R
HT

"AccessControlCustomPassword".
recno int R The record id.
TP

[ Response Params ] ( OK )
_A

[ Example ]
PI

GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=remove&name=AccessCont
Request
rolCustomPassword&recno=12345
fo

Response OK
r

 Delete all the access control custom password records


In

Table 15-6
te
lb

http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControlCustomPass
URL
word
ra

Method GET
s

Descriptio
Remove all the access control custom password records
n
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
Access user card and fingerprint record name, should be
name string R
"AccessControlCustomPassword".
[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=clear&name=AccessControl
Request
CustomPassword
Response OK

Access Control Extend APIs 401


15.2.4 Find Access Control Custom Password
 Find Access control custom password by condition

Table 15-7

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCustomPass
URL
word
Method GET
Description Find Access control custom password by condition.
[ Request Params ] ( key=value format in URL )
Name Type R/O Param Description
name string R Record Name, should be "AccessControlCustomPassword".
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.
DA

condition object O Search condition.


HU

+UserID string O The user's id.


A_

[ Response Params ] (key=value format)


Name Type R/O Param Description
HT

totalCount int O The total record num that find.


TP

found int O The record num that returned.


_A

records array<object> R The records that returned.


PI

+RecNo int R The record id.


+CreateTime int O The create time of record.
fo

+UserID string R The user's id.


r

+OpenDoorPa
string R Ths user’s open door password.
ssword
In

+AlarmPasswo Ths user’s alarm password. ( This param is not supported by


te

string O
rd video talk device )
lb

The index of the doors that custom password can open. ( This
+Doors array<int> O
ra

param is not supported by video talk device )


The index of the time sections of each door that this card can
s

+TimeSections array<int> O
open. ( This param is not supported by video talk device )
VTO position number. ( This param is not supported by video
VTOPosition string O
talk device )
+ValidDateStar
string O The start of valid date, format is "yyyyMMdd hhmmss".
t
+ValidDateEnd string O The end of valid date, format is "yyyyMMdd hhmmss".
+ValidCounts int O The password’s valid counts.
+OriginSmartG The origin smart gateway address. ( Video talk device
string O
ateWay customize. )
[ Example ]
GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=AccessControlCust
Request omPassword&condition.UserID=103&StartTime=123456700&EndTime=123456800&count
=100

Access Control Extend APIs 402


totalCount=1000
found=100
records[0].RecNo=12345
records[0].CreateTime=123456789
records[0].UserID=103
records[0].OpenDoorPassword=123456
records[0].Doors[0]=1
records[0].Doors[1]=3
records[0].Doors[2]=5
records[0].VTOPosition=01018001
records[0].ValidStart=20151022 093811
records[0].ValidEnd=20151222 093811
Response

records[1].RecNo=13579
records[1].CreateTime=123456799
records[1].UserID=103
DA

records[0].OpenDoorPassword=123456
records[1].Doors[0]=2
HU

records[1].Doors[1]=4
A_

records[1].Doors[2]=6
HT

records[1].VTOPosition=01018002
TP

records[1].ValidStart=20151022 093811
records[1].ValidEnd=20151222 093811
_A


PI

 Find Access control custom password by recno


fo

Table 15-8
r

http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCustomPas
In

URL
sword
te

Method GET
lb

Description Find Access control custom password by recno.


ra

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
s

name string R Record Name, should be "AccessControlCustomPassword".


recno int R The record id.
[ Response Params ] (key=value format)
Name Type R/O Param Description
record object R The record that returned.
+RecNo int R The record id.
+CreateTime int O The create time of record.
+UserID string R The user's id.
…<other param> — — …<See above find command for other params of the record.>
[ Example ]
GET http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=get&name=AccessControlCu
Request
stomPassword&recno=3

Access Control Extend APIs 403


record.RecNo=3
record.CreateTime=123456789
record.UserID=103
record.OpenDoorPassword=123456
record.Doors[0]=1
Response record.Doors[1]=3
record.Doors[2]=5
record.VTOPosition=01018001
record.ValidStart=20151022 093811
record.ValidEnd=20151222 093811

15.2.5 Get the Total Number of Records of Access Control


Custom Password
DA

Table 15-9
HU

http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=AccessControlCust
A_

URL
omPassword
HT

Method GET
TP

Description Get the total number of records of the access control custom password.
_A

[ Request Params ] ( key=value format in URL )


Name Type R/O Param Description
PI

Access user card and fingerprint record name, should be


name string R
"AccessControlCustomPassword".
fo

[ Response Params ] ( key=value )


r

count int R The total number of records.


In

[ Example ]
te

GET http://192.168.1.108/cgi-bin/recordFinder.cgi?action=getQuerySize&name=Access
Request
lb

ControlCustomPassword
Response count=150
ra
s

15.2.6 Get Access Control Caps

Table 15-10

URL http://<server>/cgi-bin/accessControlManager.cgi?action=getCaps
Method GET
Description Get access control capabilities.
[ Request Params ] ( none )
[ Response Params ] ( key=value )
caps object R The access control capabilities.
+AccessControl
int R The access control channel number.
Channels

Access Control Extend APIs 404


+AccessControl Support log access control alarm record or not. ( This param is
bool O
AlarmRecord not supported by video talk device )
+CustomPasswo
int O The custom password crypt type, 0 : plain text, 1 : MD5
rdEncryption
+SupportFinger Support fingerprint type, 0 : unknown, 1 : not support, 2 :
int O
Print support
+OnlySingleDoo Support single door auth type, 0 : not support, 1 : support,
int O
rAuth ( This param is not used by video talk device )
Support async auth type, 0 : not support, 1 : support, ( This
+AsynAuth int O
param is not supported by video talk device )
+SpecialDaysSc Special days schedule capabilities, ( This param is not
object O
hedule supported by video talk device )
Support special days schedule or not. ( This param is not
++Support bool O
supported by video talk device )
++MaxSpecialD Max special days schedule number. ( This param is not
uint O
aysSchedules supported by video talk device )
DA

++MaxTimePeri Max time periods per day. ( This param is not supported by
uint O
HU

odsPerDay video talk device )


++MaxSpecialD Max special day groups. ( This param is not supported by video
A_

uint O
ayGroups talk device )
HT

++MaxDaysInSp Max special days in special day group. ( This param is not
uint O
TP

ecialDayGroup supported by video talk device )


_A

[ Example ]
PI

Request GET http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getCaps


caps.AccessControlChannels=3
fo

caps.AccessControlAlarmRecord=true
caps.CustomPasswordEncryption=1
r

caps.SupportFingerPrint=1
In

caps.OnlySingleDoorAuth=1
te

Response caps.AsynAuth=1
lb

caps.SpecialDaysSchedule.Support=true
caps.SpecialDaysSchedule.MaxSpecialDaysSchedules=5
ra

caps.SpecialDaysSchedule.MaxTimePeriodsPerDay=5
s

caps.SpecialDaysSchedule.MaxSpecialDayGroups=5
caps.SpecialDaysSchedule.MaxDaysInSpecialDayGroup=5

15.2.7 Get Lock Status


Syntax http://<server>/cgi-bin/accessControl.cgi?action=getLockStatus&channel=<ChannelNo>
Method GET
Description Get status of the lock.
Example http://192.168.1.108/cgi-bin/accessControl.cgi?action= getLockStatus &channel=1
Success onLineStatus =”Online”
Return status =”Close”
Comment Parameters in URL :

Access Control Extend APIs 405


ChannelNo: integer, the index of lock, starts from 1. Default is 1 if not present.
Parameters in Response :
status: the range is {“Open”,”Close”,”Abnormal”, "FakeLocked", "Unknown" }
onLineStatus: the range is { "OnLine", "OffLine" }

15.2.8 [Config] Access Control General Setting


 Get access control general setting

Table 15-11

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessControlGener
URL
al
Method GET
Description Get access control general setting.
DA

[ Request Params ] ( None )


HU

[ Response Params ] ( key=value format )


A_

Name Type R/O Param Description


HT

table object R config table object


+AccessControl
TP

object R AccessControlGeneral config object


General
_A

++AccessProper Access property, can be : “unidirect”, “bidirect” ( This


string O
PI

ty param is supported by access control device. )


AB Lock setting ( This param is supported by access
fo

+ABLock object O
control device. )
r

+++Enable bool O Enable AB Lock or not.


In

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
te

Array<int> >
group are in closed state.
lb

++CustomPass Whether to enable custom password. ( This param is


bool O
ra

wordEnable supported by video talk device. )


s

++CommonPass The common password. ( This param is supported by


string O
word video talk device. )
++ButtonExitEna Whether to enable the open door button. ( This param is
bool O
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. )
++CheckSensor The check sensor time, in seconds. ( This param is
int O
Time supported by video talk device. )
++DuressPassw The duress password. ( This param is supported by video
string O
ord talk device. )
Whether to enable duress password. ( This param is
++DuressEnable bool O
supported by video talk device. )
++UnlockRecord Unlock Record Type,can be {"Password", "Button",
Array<string> O
Type "FingerPrint", "QRCode", "Card","Remote", "BlueTooth",

Access Control Extend APIs 406


"Face"}
sensor type,
++SensorType integer O
0 for always open; 1 for always close.
++CallLiftType string O call lift protocol type
++CallLiftEnable bool O whether to enable call lift
++AccessVoice object O Door opening prompt tone
+++CurrentVoice
integer O the current prompt tone ID, default value 0
ID
voice list, max length is 16
voice ID can be: {
0: Validate succeed
1: door open succeed
2: unlock succeed
+++VoiceList array<object> O 3: punch time clocks succeed
4: welcome
5: Welcome to come again
DA

6: thank you
HU

7: custom voice
}
A_

++++VoiceID integer O voice id


HT

++++VoiceName string O voice info


TP

++++FileName string O file full path with name


_A

[ Example ]
GET
PI

Request
http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=AccessControlGeneral
fo

table.AccessControlGeneral.AccessProperty=bidirect
table.AccessControlGeneral.ABLock.Enable=true
r

table.AccessControlGeneral.ABLock.Doors[0][0]=1
In

table.AccessControlGeneral.ABLock.Doors[0][1]=2
te

table.AccessControlGeneral.ABLock.Doors[0][2]=3
lb

table.AccessControlGeneral.ABLock.Doors[1][0]=4
table.AccessControlGeneral.ABLock.Doors[1][1]=5
ra

Respons
table.AccessControlGeneral.ABLock.Doors[1][2]=6
s

e
table.AccessControlGeneral.CustomPasswordEnable=true
table.AccessControlGeneral.CommonPassword=123456
table.AccessControlGeneral.ButtonExitEnable=true
table.AccessControlGeneral.CheckSensorBeforeLock=true
table.AccessControlGeneral.CheckSensorTime=30
table.AccessControlGeneral.DuressPassword=654321
table.AccessControlGeneral.DuressEnable=true
 Set access control general setting

Table 15-12

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti Set access control general setting.

Access Control Extend APIs 407


on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
AccessControlG
object R AccessControlGeneral config object
eneral
+AccessPropert Access property, can be : “unidirect”, “bidirect” ( This param
string O
y is supported by access control device. )
…<See above getConfig command for other params of the
…<other param> — —
config object, They are all optional.>
[ Response Params ] ( OK )
[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&AccessControlGeneral.Ac
cessProperty=bidirect&AccessControlGeneral.ABLock.Enable=false&AccessControlGener
Request al.CustomPasswordEnable=true&AccessControlGeneral.CommonPassword=123456&Acc
essControlGeneral.ButtonExitEnable=true&AccessControlGeneral.CheckSensorBeforeLoc
k=true
DA

Respons
OK
HU

e
A_

15.2.9 [Config] Access Control Setting


HT
TP

 Get access control setting


_A

Table 15-13
PI

URL http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessControl
fo

Method GET
r

Description Get access control setting.


In

[ Request Params ] ( None )


[ Response Params ] ( key=value format )
te

Name Type R/O Param Description


lb

table object R The config table


ra

The AccessControl config array for every access control


+AccessControl array<object> R
s

channel
++Enable bool O Whether to enable config for this channel.
Door state, can be : “Normal”, “CloseAlways”,
++State string O
“OpenAlways”, “NoPersonNC”, “NoPersonNO”
Open door method, can be following value, default is 2 :
0 : only by password
1 : only by access card
2 : by password or access card
3 : by access card first then password
++Method int O
4 : by password first then access card
5 : different method in differenct time range
6 : only by fingerprint
7 : by password or access card or fingerprint
8 : by password and access card and fingerprint together

Access Control Extend APIs 408


9 : by password and fingerprint together
10 : by access card and fingerprint together
11 : by multiple access user
12 : by face ( match with picture in ID card )
13 : by face and ID card
14 : by face ( match with picture in ID card ) or access card
or fingerprint
15 : by face and ID card, or access card or fingerprint
16 : by UserID and password
17 : only by face
18 : by face and password together
19 : by fingerprint and password together
20 : by fingerprint and face together
21 : by access card and face together
22 : by face or password
23 : by fingerprint or password
DA

24 : by fingerprint or face
25 : by access card or face
HU

26 : by access card or fingerprint


A_

27 : by fingerprint and face and password together


HT

28 : by access card and face and password together


TP

29 : by access card and fingerprint and password together


30 : by access card and fingerprint and face together
_A

31 : by fingerpint or face or password


PI

32 : by access card or face or password


33 : by access card or fingerprint or face
fo

34 by access card and fingerprint and face and password


r

together
In

35 : by access card or fingerprint or face or password


36 : by face and ID card, or access card or face
te

37 : by face ( match with picture in ID card ) or access card


lb

or face
ra

38 : by access card and password, or fingerprint and


s

password
39 : by ID card ( match with picture in ID card ) or face
40 : by ID card ( match with fingerprint in ID card )
41 : by ID card ( match with fingerprint and picture in ID
card )
42 : by ID card or access card or fingerprint or face or
password
43 : by multy user method
44 : by ID card or health code
++OpenAlwaysT The time range that working, value is index in
int O
ime AccessTimeSechdule config.
++CloseAlwaysT The time range that always closed, value is index in
int O
ime AccessTimeSechdule config.
++HolidayTime int O The time range that working in holidays, value is index in

Access Control Extend APIs 409


AccessTimeSechdule config.
The Unlock holding interval, unit is milliseconds, value
++UnlockHoldInt
int O should between 250 to 20000. ( This param is also
erval
supported by video talk device. )
++UnlockReload The Unlock reload interval, unit is milliseconds. ( This
int O
Interval param is also supported by video talk device. )
The access control process, can be : "Local", "Dahua",
++AccessProtoc
string O "Remote", "Private" ( This param is also supported by
ol
video talk device. )
++BreakInAlarm
bool O Whether to enable the breakin alarm.
Enable
++RepeatEnterA
bool O Whether to enable the repeat enter alarm.
larm
++DoorNotClose
bool O Whether to enable the alarm when door not closed.
dAlarmEnable
++DuressAlarm
bool O Whether to enable the duress alarm.
DA

Enable
HU

++FirstEnter object O The first enter setting.


+++Enable bool O Whenther to enable the first enter function,
A_

+++Status string O The status, can be : “KeepOpen” “Normal”


HT

The time range that enable first enter function, value is


TP

+++Time int O
index in AccessTimeSechdule config.
_A

++CardNoConve The card number convert setting : 0 – not convert, 1 –


int O
PI

rt convert using NOT operation, 2 : use HIDpro convert


++MaliciousAcc
fo

essControlEnabl bool O Whether to enable malicious access alarm.


e
r

+AutoRemoteCh
In

object O auto open door remotely


eck
te

+++Enable bool whether to enable the function


lb

working period , value is index in AccessTimeSechdule


+++Time uint
config.
ra

++Name string O name


s

++RepeatEnterT
integer O Repeat entry time, unit second, 0 means do not start
ime
++CloseTimeout integer O Closing overtime
++SensorEnable bool O sensor enable
Open the door in different periods
Array<Array<
++TimeSchedule it works when Method is "different method in differenct
object>>
time range".
+++TimeSection string O time section, format as "hh:mm:ss-hh:mm:ss"
Open door method, can be following value, default is 2 :
0 : only by password
+++Method integer O 1 : only by access card
2 : by password or access card
3 : by access card first then password

Access Control Extend APIs 410


4 : by password first then access card
5 : different method in differenct time range
6 : only by fingerprint
7 : by password or access card or fingerprint
8 : by password and access card and fingerprint together
9 : by password and fingerprint together
10 : by access card and fingerprint together
11 : by multiple access user
17 : only by face
35 : by access card or fingerprint or face or password
++CustomPass
bool O whether to enable custom password
wordEnable
++RemoteCheck bool O Is platform validation required
[ Example ]
Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=AccessControl
table.AccessControl[0].Enable=true
DA

table.AccessControl[0].State=Normal
HU

table.AccessControl[0].Method=2
table.AccessControl[0].OpenAlwaysTime=1
A_

table.AccessControl[0].CloseAlwaysTime=2
HT

Respons table.AccessControl[0].UnlockHoldInterval=500
TP

e table.AccessControl[0].AccessProtocol=Local
_A

table.AccessControl[0].BreakInAlarmEnable=true
table.AccessControl[0].DuressAlarmEnable=true
PI

table.AccessControl[0].CardNoConvert=0
table.AccessControl[0].MaliciousAccessControlEnable=true
fo


r

 Set access control setting


In
te

Table 15-14
lb

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

Method GET
Descripti
s

Set access control setting.


on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
AccessControl array<object> R AccessControl config object array
+Enable bool O Whether to enable config for this channel.
…<See above getConfig command for other params of the
…<other param> — —
config object, They are all optional.>
[ Response Params ] ( OK )
[ Example ]
GET
http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&AccessControl[0].Enable=true&
Request
AccessControl[0].State=Normal&AccessControl[0].Method=2&AccessControl[0].OpenAlwa
ysTime=1&AccessControl[0].CloseAlwaysTime=2&AccessControl[0].UnlockHoldInterval=5

Access Control Extend APIs 411


00&AccessControl[0].AccessProtocol=Local&AccessControl[0].BreakInAlarmEnable=true&
AccessControl[0].DuressAlarmEnable=true&AccessControl[0].CardNoConvert=0&AccessC
ontrol[0].MaliciousAccessControlEnable=true
Respons
OK
e

15.2.10 [Config] Wiegand Setting


 Get Wiegand setting

Table 15-15

URL http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=Wiegand
Method GET
Description Get Wiegand setting.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )
DA

Name Type R/O Param Description


HU

table object R config table object


A_

+Wiegand array<object> R Wiegand config


HT

++Mode int R Wiegand mode, 0: wiegand input, 1 : wiegand output


TP

++PulseWidth int R The pulse width, unit is microseconds


++PulseStep int R The pulse step, unit is microseconds
_A

The transfer mode, 0 : wiegand 34bit transfer, 4 byte card


PI

number, 2 bit checksum, 1 : wiegand 66bit transfer, 8 byte


++TransferMode int R
card number, 2 bit checksum, 2 : wiegand 26bit transfer, 3
fo

byte card number, 2 bit checksum,


r

++OutType int R The output type, 0 : output ID, 1 : output card number
In

the input type, the value is 32bits. It won’t accept any input
when value is 0.
te

++InputType integer O Bit0: card number input


lb

Bit1: password input


ra

bit2~Bit31:reserved
s

++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
table.Wiegand[0].PulseStep=1000
table.Wiegand[0].TransferMode=1
Respons
table.Wiegand[0].OutType=1
e
table.Wiegand[1].Mode=1
table.Wiegand[0].InputType=3
table.Wiegand[0].Doors=0

 Set Wiegand setting

Access Control Extend APIs 412


Table 15-16

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti
Set Wiegand setting.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Wiegand array<object> R Wiegand config object
+Mode int O Wiegand mode, 0 : wiegand input, 1 : wiegand output
…<See above getConfig command for other params of the
…<other param> — —
config object, They are all optional.>
[ Response Params ] ( OK )
[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&Wiegand[0].Mode=1&Wie
Request gand[0].PulseWidth=200&Wiegand[0].PulseStep=1000&Wiegand[0].TransferMode=1&Wie
DA

gand[0].OutType=1
HU

Respons
OK
A_

e
HT

15.2.11 [Config] Access Time Schedule Setting


TP
_A

The following Apis are not supported by video talk device.


PI

 Get access time schedule setting


fo

Table 15-17
r

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=AccessTimeSchedul
URL
In

e
Method GET
te

Description Get access time schedule setting.


lb

[ Request Params ] ( None )


ra

[ Response Params ] ( key=value format )


s

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
to 7 day in a week (the first one is Sunday)and last one is
array< array< holiday, each item is an array has max 6 time section,
++TimeSechdule O
string > > each time section is a string, format is “enable,
hour:minite:second – hour:minite:second”, for example : "1
00:00:00-12:00:00"
[ Example ]
Request GET

Access Control Extend APIs 413


http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=AccessTimeSchedule
table.AccessTimeSchedule[0].Name=TS1
table.AccessTimeSchedule[0].Enable=true
table.AccessTimeSchedule[0].TimeSchedule[0][0]=1 00:00:00-12:00:00
Respons
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
table.AccessTimeSchedule[0].TimeSchedule[1][1]=1 15:00:00-20:00:00

 Set access time schedule setting

Table 15-18

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti
Set access time schedule setting.
on
[ Request Params ] ( key=value format at URL )
DA

Name Type R/O Param Description


HU

AccessTimeSch
array<object> R The access time schedule config object array
A_

edule
HT

+Name string O The schedule name, max string length is 63.


…<See above getConfig command for other params of the
TP

…<other param> — —
config object, They are all optional.>
_A

[ Response Params ] ( OK )
PI

[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&AccessTimeSchedule[0].
fo

Name=TS1&AccessTimeSchedule[0].Enable=true&AccessTimeSchedule[0].TimeSchedule
r

Request [0][0]=1%2000:00:00-12:00:00&AccessTimeSchedule[0].TimeSchedule[0][1]=1%2015:00:0
In

0-20:00:00&AccessTimeSchedule[0].TimeSchedule[1][0]=1%2000:00:00-12:00:00&Access
TimeSchedule[0].TimeSchedule[1][1]=1%2015:00:00-20:00:00
te

Respons
lb

OK
e
ra

15.2.12 [Config] Special Day Group Setting


s

The following Apis are not supported by video talk device.


 Get special day group setting

Table 15-19

URL http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDayGroup
Method GET
Description Get special day group setting.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )
Name Type R/O Param Description
table object R config table object

Access Control Extend APIs 414


+SpecialDayGro
array<object> R SpecialDayGroup config object array
up
++Name string O The special day group name
++Enable bool R Whether to enable this special day group
++Days array<object> O The special days in group
+++SpecialDayN
string O The special day name.
ame
+++StartTime string O The special day start datetime
+++EndTime string O The special day end datetime
[ Example ]
Request GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDayGroup
table.SpecialDayGroup[0].Name=SpecialDayGroup1
table.SpecialDayGroup[0].Enable=true
Respons table.SpecialDayGroup[0].Days[0].SpecialDayName=NationalDay
e table.SpecialDayGroup[0].Days[0].StartTime=2017-10-01 00:00:00
table.SpecialDayGroup[0].Days[0].StartTime=2017-10-07 23:59:59
DA


HU

 Set special day group setting


A_

Table 15-20
HT
TP

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

Descripti
PI

Set special day group setting.


on
[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


r

SpecialDayGrou
array<object> R The special day group config object array
In

p
te

+Name string O The special day group name


…<See above getConfig command for other params of the
lb

…<other param> — —
config object, They are all optional.>
ra

[ Response Params ] ( OK )
s

[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&SpecialDayGroup[0].Nam
e=SpecialDayGroup1&SpecialDayGroup[0].Enable=true&SpecialDayGroup[0].Days[0].Spe
Request
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

15.2.13 [Config] Special Days Schedule Setting


The following Apis are not supported by video talk device.
 Get special days schedule setting

Table 15-21

Access Control Extend APIs 415


http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDaysSchedul
URL
e
Method GET
Description Get special days schedule setting.
[ Request Params ] ( None )
[ Response Params ] ( key=value format )
Name Type R/O Param Description
table object R config table object
+SpecialDaysSc
array<object> R SpecialDaysSchedule config object array
hedule
++Name string O The special day schedule name
++Enable bool R Whether to enable this special day schedule
The special day group number, value is the index of
++GroupNo int R
SpecialDayGroup setting array.
The time section array, the format of the item is “enable,
++TimeSection array<string> R hour:minite:second – hour:minite:second”, for example : "1
DA

00:00:00-12:00:00".
HU

++Doors array<int> R The doors array.


A_

[ Example ]
GET
HT

Request
http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=SpecialDaysSchedule
TP

table.SpecialDaysSchedule[0].Name=SpecialDayGroup1
_A

table.SpecialDaysSchedule[0].Enable=true
PI

table.SpecialDaysSchedule[0].GroupNo=1
Respons table.SpecialDaysSchedule[0].TimeSection[0]=1 00:00:00-12:00:00
fo

e table.SpecialDaysSchedule[0].TimeSection[1]=1 15:00:00-20:00:00
table.SpecialDaysSchedule[0].Doors[0]=2
r

table.SpecialDaysSchedule[0].Doors[1]=3
In


te

 Set special days schedule setting


lb

Table 15-22
ra
s

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti
Set special days schedule setting.
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
…<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&SpecialDaysSchedule[0].

Access Control Extend APIs 416


Name=SpecialDayGroup1&SpecialDaysSchedule[0].Enable=true&SpecialDaysSchedule
[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
[0]=2&SpecialDaysSchedule[0].Doors[1]=3
Respons
OK
e

15.2.14 [Config] MeasureTemperature Setting


The following Apis are not supported by video talk device.
 Get measure temperature setting

Table 15-23

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=MeasureTemperatur
URL
e
Method GET
DA

Description Get measure temperature setting.


HU

[ Request Params ] ( None )


A_

[ Response Params ] ( key=value format )


HT

Name Type R/O Param Description


table object R config table object
TP

+MeasureTempe
_A

object R MeasureTemperature config object


rature
PI

++Enable bool R whether to enable measure temperature function


mask mode
fo

0: don not detect mask


++MaskOpt uint R
r

1: mask prompt
In

2: mask intercept
++OnlyTemperat whether to enable the single function, temperature
te

bool O
ureMode monitoring
lb

++TemperatureD
bool R whether to show the temperature
ra

isplay
s

temperature unit:{
++TemperatureU 0: centigrade
uint O
nit 1: Fahrenheit
}
Temperature monitoring method, it can be:
0: Single chip microcomputer infrared temperature
monitoring
++Type integer R
1: the thermal imaging principle of temperature monitoring
2: Temperature monitoring module of Guide
3: single point temperature monitoring at wrist
++GuideModule
object O param of temperature monitoring module of Guide
Param
+++Threshold float O the temprerature threshold, unit is ℃
+++CalibrationM uint32 O Calibration Model, it can be:

Access Control Extend APIs 417


odel 0: indoor mode
1: wall mounting mode
2: Gate mode
3: exclusive floor mode
+++Correct Float O temperature correct value, unit is ℃
+++DebugModel whether tou enable debug mode of temperature
Bool O
Enable monitoring, show temperature on the top of face
+++HeatDisplay
bool O whether to show heat
Enbale
+++MaxDistance uint32 O the max distance for temperature monitoring, unit: cm
+++ProjectDebu
bool O whether to enable project debug mode
gModel
whether to show the rectangle of temperature monitoring
+++RectEnable Bool O
area on the video.
the threshold under which the temperature value will be
+++TempRandR
Float O replaced with valid one. When threshold value is 0, the
eplaceThreshold
DA

function won’t work.


HU

+++ValidTemper
float O the lower limit of valid temperature value
atureLowerLimit
A_

++InfraredTemp
HT

object O param of infrared temperature monitoring


eratureParam
TP

+++Correct float O temperature correct value, unit is ℃


_A

+++DebugModel whether tou enable debug mode of temperature


bool O
Enable monitoring, show temperature on the top of face
PI

+++MaxDistance Uint32 O the max distance for temperature monitoring, unit: cm


fo

Maximum distance for reporting high temperature events,


+++OverTemper In this distance, the high temperature was measured and
r

atureMaxDistanc Uint32 O reported directly. Beyond this distance, the high


In

e temperature was measured, it will indicates closing to the


te

point, and then measured again (CM)


lb

whether to show the rectangle of temperature monitoring


+++RectEnable bool O
area on the video.
ra

+++RetentionTi
s

Uint32 O temperature retention Time, unit: ms


me
sensor type in temperature monitoring module
+++SensorType string O "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
+++RetentionTi
Uint32 O temperature retention Time, unit: ms
me
+++Threshold Uint32 O temperature threshold, unit : ℃
++WristTempera Object O param of wrist temperature monitoring

Access Control Extend APIs 418


tureParam
+++Correct Float O temperature correct value, unit is ℃
+++InvalidTemp
Uint32 O invalid temperature monitoring distance
eratureDistance
+++Temperature
Uint32 O timeout of temperature monitoring, unit: s
Timeout
+++Threshold Float O temperature threshold, unit : ℃
+++ValidTemper
Uint32 O valid temperature monitoring distance,
atureDistance
+++ValidTemper
flaot O the lower limit of valid temperature value
atureLowerLimit
[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=
Request
MeasureTemperature
table.MeasureTemperature.Enable=true
table.MeasureTemperature.GuideModuleParam.CalibrationModel=1
DA

table.MeasureTemperature.GuideModuleParam.Correct=0
HU

table.MeasureTemperature.GuideModuleParam.DebugModelEnable=false
table.MeasureTemperature.GuideModuleParam.HeatDisplayEnbale=false
A_

table.MeasureTemperature.GuideModuleParam.MaxDistance=0
HT

table.MeasureTemperature.GuideModuleParam.ProjectDebugModel=false
TP

table.MeasureTemperature.GuideModuleParam.RectEnable=true
_A

table.MeasureTemperature.GuideModuleParam.TempRandReplaceThreshold=0
table.MeasureTemperature.GuideModuleParam.Threshold=37.300000
PI

table.MeasureTemperature.GuideModuleParam.ValidTemperatureLowerLimit=30
fo

table.MeasureTemperature.InfraredTemperatureParam.Correct=0
table.MeasureTemperature.InfraredTemperatureParam.DebugModelEnable=false
r

table.MeasureTemperature.InfraredTemperatureParam.MaxDistance=100
In

table.MeasureTemperature.InfraredTemperatureParam.OverTemperatureMaxDistance=100
te

table.MeasureTemperature.InfraredTemperatureParam.RectEnable=true
Respons
table.MeasureTemperature.InfraredTemperatureParam.RetentionTime=500
lb

e
table.MeasureTemperature.InfraredTemperatureParam.SensorType=
ra

table.MeasureTemperature.InfraredTemperatureParam.Threshold=37.300000
s

table.MeasureTemperature.InfraredTemperatureParam.ValidTemperatureLowerLimit=30
table.MeasureTemperature.MaskOpt=0
table.MeasureTemperature.OnlyTemperatureMode=false
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
table.MeasureTemperature.WristTemperatureParam.TemperatureTimeout=10
table.MeasureTemperature.WristTemperatureParam.Threshold=37.300000
table.MeasureTemperature.WristTemperatureParam.ValidTemperatureDistance=5
table.MeasureTemperature.WristTemperatureParam.ValidTemperatureLowerLimit=35

Access Control Extend APIs 419



 Set measure temperature setting

Table 15-24

URL http://<server>/cgi-bin/configManager.cgi?action=setConfig
Method GET
Descripti
Set measure temperature setting.
on
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
MeasureTemper
object R The measure temperature config object
ature
+Name string O The measure temperature name
…<See above getConfig command for other params of the
…<other param> — —
config object, They are all optional.>
DA

[ Response Params ] ( OK )
[ Example ]
HU

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&MeasureTemperature.En
A_

Request able=true&MeasureTemperature.GuideModuleParam.Threshold=38.5&MeasureTemperatur
HT

e.MaskOpt=2
TP

Respons
OK
e
_A
PI

15.2.15 [Config] CitizenPictureCompare Setting


fo
r

 Get citizen picture compare setting


In
te

Table 15-25
lb

http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=CitizenPictureCompa
URL
ra

re
Method GET
s

Description Get citizen picture compare setting


[ Request Params ] ( None )
[ Response Params ] ( key=value format )
Name Type R/O Param Description
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.
++FuncEnable bool O whether to enable citizen picture comparison
++CitizenIDCheck bool O is citizen ID check supported

Access Control Extend APIs 420


device work mode, it can be:
++SysMode string O { "FaceCollect" , "VisitorVerify", "CitizenCompare",
"CitizenIDCheck", "Other" }
[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=
Request
CitizenPictureCompare
table.CitizenPictureCompare.SysMode=CitizenCompare
table.CitizenPictureCompare.Threshold=50
Respons table.CitizenPictureCompare.UnlockEnable=false
e table.CitizenPictureCompare.FuncEnable=false
table.CitizenPictureCompare.CitizenIDCheck=false

 Set citizen picture compare setting

Table 15-26

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

Method GET
HU

Descripti
Set citizen picture compare setting
A_

on
HT

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
TP

CitizenPictureCo
_A

object R CitizenPictureCompare config object


mpare
PI

…<See above getConfig command for other params of the


…<other param> — —
config object, They are all optional.>
fo

[ Response Params ] ( OK )
r

[ Example ]
In

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&CitizenPictureCompare.S
ysMode= CitizenIDCheck&CitizenPictureCompare.Threshold=80&CitizenPictureCompare.
te

Request
UnlockEnable=true&CitizenPictureCompare.FuncEnable=true&CitizenPictureCompare.Citi
lb

zenIDCheck=true
ra

Respons
OK
s

15.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 15-27

URL http://<server>/cgi-bin/AccessUser.cgi?action=insertMulti
Method POST
Description Insert person information.
[ Request Params ] ( JSON format in body )

Access Control Extend APIs 421


Name Type R/O Param Description

UserList array<object> R User list, with up to 10 entries

+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: Extend
time user
Limit of passing times for guest
+UseTime uint16 O
users
First user authority or not. false: No;
+IsFirstEnter bool O
true: Yes
+FirstEnterDoors int16[] O -1 indicates all channels.
+UserStatus uint16 O 0: Normal; 1: Frozen
DA
HU

+Authority uint8 O User authority (attendance machine


field). 1: Admin; 2: General user
A_

+CitizenIDNo string O ID card number


HT

The password when unlocking by


TP

card + password. The password


+Password string O
_A

when unlocking by User ID +


password
PI
fo

Door authority. The index in the


controller is used with
r

+Doors int16[] O
TimeSections, and the value
In

corresponds to the subscript of the


te

AC configuration.
lb

The door authority corresponds to


the period index. For example, door
ra

+TimeSections uint16[] O 3 corresponds to period 2. Each


s

element corresponds to the door in


Doors.
Holiday plan identification. The
value is the subscript number
+SpecialDaysSchedule uint32[64] O 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.
"yyyy-MM-dd HH:mm:ss", end of
+ValidTo string O validity period. Note: The original
"ValidDateEnd" is deprecated.

Access Control Extend APIs 422


[ Response Params ] ( OK )
[ Example ]
POST http://192.168.1.108/cgi-bin/AccessUser.cgi?action=insertMulti

{
UserList[{
"UserID": "100013",
"UserName": "",
"UserType": 0,
"UseTime": 1,
"IsFirstEnter": true,
"FirstEnterDoors": [0, 1],
Request "UserStatus": 0,
"Authority": 1,
"CitizenIDNo": "123456789012345678",
"Password": "xxxxxxxxxx",
DA

"Doors": [1,3,5,7],
HU

"TimeSections": [1,2,3,4],
"SpecialDaysSchedule": [1,2],
A_

"ValidFrom": "2018-01-02 00:00:00",


HT

"ValidTo": "2018-01-02 01:00:00",


TP

} ,…,{}]
}
_A

Response OK
PI

15.2.17 Updating User Information


fo
r

Update information of multiple users.


In
te

Table 15-28
lb

URL http://<server>/cgi-bin/AccessUser.cgi?action=updateMulti
ra

Method POST
Description Update person information.
s

[ Request Params ] ( JSON format in body )


Name Type R/O Param Description

UserList array<object> R User list, with up to 10 entries

+ 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:
Extend time user
Limit of passing times for guest
+UseTime uint16 O
users

Access Control Extend APIs 423


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 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 User ID +
password

Door authority. The index in the


controller is used with
+Doors int16[] O
TimeSections, and the value
DA

corresponds to the subscript of the


HU

AC configuration.
The door authority corresponds to
A_

the period index. For example, door


HT

+TimeSections uint16[] O 3 corresponds to period 2. Each


TP

element corresponds to the door in


_A

Doors.
Holiday plan identification. The
PI

value is the subscript number


fo

+SpecialDaysSchedule uint32[64] O configured by


SpecialDaysSchedule (defined in
r

the configuration).
In

"yyyy-MM-dd HH:mm:ss", start of


te

+ValidFrom string O validity period. Note: The original


"ValidDateStart" is deprecated.
lb

"yyyy-MM-dd HH:mm:ss", end of


ra

+ValidTo string O validity period. Note: The original


s

"ValidDateEnd" is deprecated.
[ Response Params ] ( OK )
[ Example ]
POST http://192.168.1.108/cgi-bin/AccessUser.cgi?action=insertMulti

{
UserList[{
"UserID": "100013",
Request "UserName": "",
"UserType": 0,
"UseTime": 1,
"IsFirstEnter": true,
"FirstEnterDoors": [0, 1],
"UserStatus": 0,

Access Control Extend APIs 424


"Authority": 1,
"CitizenIDNo": "123456789012345678",
"Password": "xxxxxxxxxx",
"Doors": [1,3,5,7],
"TimeSections": [1,2,3,4],
"SpecialDaysSchedule": [1,2],
"ValidFrom": "2018-01-02 00:00:00",
"ValidTo": "2018-01-02 01:00:00",
} ,…,{}]

Response OK

15.2.18 Deleting All User Information


Delete all user information.
DA

Table 15-29
HU

URL http://<server>/cgi-bin/AccessUser.cgi?action=removeAll
A_

Method GET
HT

Description Clear information of all persons.


[ Request Params ] ( key=value format at URL )
TP

Name Type R/O Param Description


_A

[ Response Params ] ( OK )
PI

[ Example ]
fo
r
In

Request GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=removeAll


te
lb
ra

Response OK
s

15.2.19 Deleting Information of Multiple Users


Delete information of multiple users.

Table 15-30

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

UserIDList array<string> R User ID list, with up to 10 entries

[ Response Params ] ( OK )

Access Control Extend APIs 425


[ Example ]

GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=removeMulti&UserIDList[0]=102&
Request
UserIDList [1]=102

Respons
OK
e

15.2.20 Searching for Information of Multiple Users


Search for information of multiple users.

Table 15-31
DA

URL http://<server>/cgi-bin/AccessUser.cgi?action=list
HU

Method GET
A_

Description Search for user data.


HT

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
TP

UserIDList array<string> R User ID list, with up to 10 entries


_A

[ Response Params ]
PI

Users array<object> R The records that returned


+ UserID string R User ID
fo

+UserName string O User name


r

0: General user, by default; 1:


In

Blocklist user (report the blocklist


+UserType uint16 O event ACBlocklist); 2: Guest user;
te

3: Patrol user; 4: VIP user; 5:


lb

Extend time user


ra

Limit of passing times for guest


+UseTime uint16 O
s

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

User authority (attendance


+Authority uint8 O
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 +
password

Access Control Extend APIs 426


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,
+TimeSections uint16[] O door 3 corresponds to period 2.
Each element corresponds to the
door in Doors.
Holiday plan identification. The
value is the subscript number
+SpecialDaysSchedule uint32[64] O configured by
SpecialDaysSchedule (defined in
the configuration).
DA

"yyyy-MM-dd HH:mm:ss", start of


HU

+ValidFrom string O validity period. Note: The original


"ValidDateStart" is deprecated.
A_

"yyyy-MM-dd HH:mm:ss", end of


HT

+ValidTo string O validity period. Note: The original


TP

"ValidDateEnd" is deprecated.
_A

[ Example ]
PI
fo

GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=list&UserIDList[0]=102&UserIDList
Request
r

[1]=102
In
te

Users[0].UserID=100013
lb

Users[0].UserName=Name
ra

Users[0].UserType=1
s

Users[0].UseTime=1
Users[0].IsFirstEnter=ZhangSan
Users[0].FirstEnterDoors=0
Users[0].UserStatus=12345678
Respons Users[0].Authority=1
e Users[0].CitizenIDNo=1
Users[0].Password=ZhangSan
Users[0].Doors=0
Users[0].TimeSections=12345678
Users[0].SpecialDaysSchedule=1
Users[0].ValidFrom=1
records[0].ValidTo=ZhangSan

Access Control Extend APIs 427


15.2.21 Sending Information of Multiple Card Numbers
Send information of multiple card numbers.

Table 15-32

URL http://<server>/cgi-bin/AccessCard.cgi?action=insertMulti
Method POST
Description Insert card number information.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description

CardList array<object> R User list, with up to 10 entries

+CardNo string R Card No.


+UserID string R User ID
Card type
DA

Enumint{
HU

0: Ordinary card
A_

1: VIP card
+CardType uint16 O
HT

2: Guest card
3: Patrol card
TP

4: Blocklist card
_A

5: Duress card
PI

+CardName string O Card name


Card status. Different card status results in
fo

different person status.


r

0: Normal
1<<0: Reported for loss
In

+CardStatus uint32 O
1<<1: Canceled
te

1<<2: Frozen
lb

1<<3: Arrearage
ra

1<<4: Overdue
[ Response Params ] ( OK )
s

[ Example ]
POST http://192.168.1.108/cgi-bin/AccessCard.cgi?action=insertMulti

{
CardList[{
"UserID" : "100013"
Request "CardNo" : ""
"CardType" : 0
"CardName" : "201 - Xiao Wang"
"CardStatus" : 0
} ,…,{}]
}
Response OK

Access Control Extend APIs 428


15.2.22 Updating Information of Multiple Card Numbers
Update information of multiple card numbers.

Table 15-33

URL http://<server>/cgi-bin/AccessCard.cgi?action=updateMulti
Method POST
Description Update card number information.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description
CardList array<object> R User list, with up to 10 entries
+CardNo string R Card No.
+UserID string R User ID
Card type
Enumint{
DA

0: Ordinary card
HU

1: VIP card
+CardType uint16 O
2: Guest card
A_

3: Patrol card
HT

4: Blocklist card
TP

5: Duress card
_A

+CardName string O Card name


Card status. Different card status results in
PI

different person status.


fo

0: Normal
1<<0: Reported for loss
r

+CardStatus uint32 O
1<<1: Canceled
In

1<<2: Frozen
te

1<<3: Arrearage
lb

1<<4: Overdue
[ Response Params ] ( OK )
ra

[ Example ]
s

POST ttp://192.168.1.108/cgi-bin/AccessCard.cgi?action=updateMulti

{
CardList[{
"UserID" : "100013"
Request "CardNo" : ""
"CardType" : 0
"CardName" : "201 - Xiao Wang"
"CardStatus" : 0
} ,…,{}]
}
Response OK

Access Control Extend APIs 429


15.2.23 Removing All Card Number Information
Remove all card number information.

Table 15-34

URL http://<server>/cgi-bin/AccessCard.cgi?action=removeAll
Method GET
Description Clear all card information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
[ Response Params ] ( OK )
[ Example ]
DA

Request GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=removeAll


HU
A_
HT

Response OK
TP

15.2.24 Removing Information of Multiple Card Numbers


_A
PI

Remove information of multiple card numbers.


fo

Table 15-35
r

URL http://<server>/cgi-bin/AccessCard.cgi?action=removeMulti
In

Method GET
te

Description Delete card number data.


lb

[ Request Params ] ( key=value format at URL )


ra

Name Type R/O Param Description


s

User card number list, with up to


CardNoList array<string> R
10 entries
[ Response Params ] ( OK )
[ Example ]

Reque GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=removeMulti&CardNoList[0]=12345


st 678&CardNoList[1]=12345687

Respo
OK
nse

Access Control Extend APIs 430


15.2.25 Searching for Information of Multiple Card Numbers
Search for information of multiple card numbers.

Table 15-36

URL http://<server>/cgi-bin/AccessCard.cgi?action=list
Method GET
Description Search for card number data.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
CardNoList array<string> R User ID list, with up to 10 entries
[ Response Params ]
records array<object> R The records that returned.
+CardNo string R Card No.
+UserID string R User ID
DA

Card type
HU

Enumint{
A_

0: Ordinary card
1: VIP card
HT

+CardType uint16 O
2: Guest card
TP

3: Patrol card
_A

4: Blocklist card
5: Duress card
PI

+CardName string O Card name


fo

Card status. Different card status


results in different person status.
r

0: Normal
In

1<<0: Reported for loss


+CardStatus uint32 O
te

1<<1: Canceled
lb

1<<2: Frozen
1<<3: Arrearage
ra

1<<4: Overdue
s

[ Example ]

GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=list&CardNoList
Request
[0]=102&CardNoList[1]=102

Cards[0].CardNo=12345678
Cards[0].UserID=1
Cards[0].CardType=1
Response
Cards[0].CardName=ZhangSan
Cards[0].CardStatus=0

Access Control Extend APIs 431


Cards[1].CardNo=12345679
Cards[1].UserID=2
Cards[1].CardType=1
Cards[1].CardName=LiSi
Cards[1].CardStatus=0

15.2.26 Sending Face Information


Insert multiple face information.

Table 15-37

URL http://<server>/cgi-bin/AccessFace.cgi?action=insertMulti
Method POST
Description Insert face information.
[ Request Params ] ( JSON format in body )
DA

Name Type R/O Param Description


HU

FaceList array<object> R Face list, with up to 10 entries


A_

+UserID string R User ID


HT

Base64 of red light face templates, 8192


+FaceData array<string> O
Bytes/per face, maximum 20.
TP

Base64 of white light face images,


_A

+PhotoData array<string> O
200kx5.
PI

Either cloud storage URL of white light


face images or PhotoData. If PhotoData
fo

+PhotoURL array<string> O exists, this field is invalid when it is subject


r

to PhotoData. Only HTTP URL is available


In

now.
[ Response Params ] ( OK )
te

[ Example ]
lb

POST http://192.168.1.108/cgi-bin/AccessFace.cgi?action=insertMulti
ra
s

{
“FaceList”:[
{
"UserID": "102",
Request "FaceData": [ "xxxx", "xxxx", … ],
"PhotoData": [ "yyyy", "yyyy", … ],
" PhotoURL": [ "yyyy", "yyyy", … ],
},
….
]
}
Response OK

Access Control Extend APIs 432


15.2.27 Updating Face Information
Update multiple face information.

Table 15-38

URL http://<server>/cgi-bin/AccessFace.cgi?action=updateMulti
Method POST
Description Update face information.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description
FaceList array<object> R Face list, with up to 10 entries
+UserID string R User ID
Base64 of red light face templates, 8192
+FaceData array<string> O
Bytes/per face, maximum 20.
Base64 of white light face images,
+PhotoData array<string> O
DA

200kx5.
HU

Either cloud storage URL of white light


face images or PhotoData. If PhotoData
A_

+PhotoURL array<string> O exists, this field is invalid when it is subject


HT

to PhotoData. Only HTTP URL is available


TP

now.
_A

[ Response Params ] ( OK )
[ Example ]
PI

POST http://192.168.1.108/cgi-bin/AccessFace.cgi?action=updateMulti
fo

{
r

“FaceList”:[
In

{
te

"UserID": "102",
lb

Request "FaceData": [ "xxxx", "xxxx", … ],


"PhotoData": [ "yyyy", "yyyy", … ],
ra

" PhotoURL": [ "yyyy", "yyyy", … ],


s

},
….
]
}
Response OK

15.2.28 Deleting All Face Information


Delete all face information.

Table 15-39

URL http://<server>/cgi-bin/AccessFace.cgi?action=removeAll
Method GET

Access Control Extend APIs 433


Description Clear all face information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
[ Response Params ] ( OK )
[ Example ]

Request GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=removeAll

Response OK

15.2.29 Deleting Multiple Face Information


DA

Delete multiple face information.


HU

Table 15-40
A_
HT

URL http://<server>/cgi-bin/AccessFace.cgi?action=removeMulti
Method GET
TP

Description Delete face data.


_A

[ Request Params ] ( key=value format at URL )


PI

Name Type R/O Param Description


User card number list, with up to
fo

UserIDList array<string> R
10 entries
r

[ Response Params ] ( OK )
In

[ Example ]
te
lb

GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=removeMulti&
ra

Request
UserIDList[0]=101&UserIDList[1]=102
s

Response OK

15.2.30 Searching for Multiple Face Information


Search for multiple face information.

Table 15-41

URL http://<server>/cgi-bin/AccessFace.cgi?action=list
Method GET
Description Search for user face data.

Access Control Extend APIs 434


[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

UserIDList array<string> R User ID list, with up to 10 entries

[ Response Params ]
FaceDataList array<object> R The records that returned.
+UserID string R User ID
Base64 of red light face
+FaceData array<string> O templates, 8192 Bytes/per face,
maximum 20.
Base64 of white light face
+PhotoData array<string> O
images, 200kx5.
Either cloud storage URL of white
light face images or PhotoData. If
PhotoData exists, this field is
+PhotoURL array<string> O
invalid when it is subject to
DA

PhotoData. Only HTTP URL is


HU

available now.
[ Example ]
A_
HT
TP

GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=list&UserIDList
_A

Request
[0]=1&UserIDList[1]=2
PI
fo

FaceDataList[0].UserID=1
r

FaceDataList[0].PhotoData=[ "xxxx", "xxxx", … ],


In

FaceDataList[0].FaceData=[ "xxxx", "xxxx", … ],


te


Response
FaceDataList[1].UserID=2
lb

FaceDataList[1].PhotoData=[ "xxxx", "xxxx", … ],


ra

FaceDataList[1].FaceData=[ "xxxx", "xxxx", … ],


s

15.2.31 Sending Fingerprint Information


Insert multiple fingerprint information.

Table 15-42

URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=insertMulti
Method POST
Description Insert fingerprint information.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description
vecPackets array<string> R Fingerprint feature data

Access Control Extend APIs 435


AccessFingerprints array<object> R Fingerprint list, with up to 1 entry
+UserID string R User ID
+FingerprintPacket object R Send fingerprint information list.
++Length uint32 R Length of a single fingerprint package
++Count uint32 R Number of fingerprint packages
Either cloud storage URL of fingerprint
data or Length. If the Length exists and is
++DataURL array<string> O not 0, this field is invalid when it is subject
to Length. Only HTTP URL is available
now.
Duress fingerprint number, with a value
range of [1, count]. This field is invalid if
++DuressIndex Uint8 R the value is illegal. That is, there is no
duress fingerprint. For example, 0
indicates no duress fingerprint.
[ Response Params ] ( OK )
DA

[ Example ]
HU

POST http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=insertMulti
A_

{
HT

“vecPackets“: [ "xxxx", "xxxx", … ],


TP

“AccessFingerprints”:[
_A

{
"UserID": "102",
PI

"FingerprintPacket" :
Request
fo

{
"Length" : 810,
r

"Count" : 3,
In

"DuressIndex" : 2
te

}
}
lb

]
ra

}
s

Response OK

15.2.32 Updating Fingerprint Information


Update multiple fingerprint information.

Table 15-43

URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=updateMulti
Method POST
Description Update fingerprint information.
[ Request Params ] ( JSON format in body )
Name Type R/O Param Description
vecPackets array<string> R Binary fingerprint data (Binary Data).

Access Control Extend APIs 436


AccessFingerprints array<object> R Fingerprint list, with up to 1 entry
+UserID string R User ID
+FingerprintPacket object R Send fingerprint information list.
++Length uint32 R Length of a single fingerprint package
++Count uint32 R Number of fingerprint packages
Either cloud storage URL of fingerprint
data or Length. If the Length exists and is
++DataURL array<string> O not 0, this field is invalid when it is subject
to Length. Only HTTP URL is available
now.
Duress fingerprint number, with a value
range of [1, count]. This field is invalid if
++DuressIndex Uint8 R the value is illegal. That is, there is no
duress fingerprint. For example, 0
indicates no duress fingerprint.
[ Response Params ] ( OK )
DA

[ Example ]
HU

POST http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=updateMulti
A_

{
HT

“vecPackets“: [ "xxxx", "xxxx", … ],


TP

“AccessFingerprints”:[
_A

{
"UserID": "102",
PI

"FingerprintPacket" :
Request
fo

{
"Length" : 810,
r

"Count" : 3,
In

"DuressIndex" : 2
te

}
}
lb

]
ra

}
s

Response OK

15.2.33 Deleting All Fingerprint Information


Delete all fingerprint information.

Table 15-44

URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=removeAll
Method GET
Description Clear all fingerprint information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
[ Response Params ] ( OK )

Access Control Extend APIs 437


[ Example ]

Request GET http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=removeAll

Response OK

15.2.34 Deleting Fingerprint Information


Delete fingerprint information.

Table 15-45

URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=removeMulti
DA

Method GET
HU

Description Delete fingerprint data.


A_

[ Request Params ] ( key=value format at URL )


HT

Name Type R/O Param Description


User card number list, with up to 1
TP

UserIDList array<string> R
entry
_A

[ Response Params ] ( OK )
PI

[ Example ]
fo
r

GET http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=removeMulti&
Request
In

UserIDList[0]=101&UserIDList[1]=102
te
lb
ra

Response OK
s

15.2.35 Searching for Fingerprint Information


Search for user fingerprint information.

Table 15-46

URL http://<server>/cgi-bin/AccessFingerprint.cgi?action=get
Method GET
Description Search for user fingerprint information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

UserID string R User ID list, with up to 1 entry

[ Response Params ]

Access Control Extend APIs 438


Binary fingerprint data (Binary
FingerprintData BinaryData R
Data).
FingerprintPacket object R Description of fingerprint data
Length of a single fingerprint
+Length uint32 R
package
+Count uint32 R Number of fingerprint packages
Either cloud storage URL of
fingerprint data or Length. If the
Length exists and is not 0, this
+DataURL array<string> O
field is invalid when it is subject to
Length. Only HTTP URL is
available now.
Duress fingerprint number, with a
value range of [1, count]. This
field is invalid if the value is
+DuressIndex Uint8 R
illegal. That is, there is no duress
DA

fingerprint. For example, 0


HU

indicates no duress fingerprint.


[ Example ]
A_
HT
TP
_A

Request GET http://192.168.1.108/cgi-bin/AccessFingerprint.cgi?action=get&UserID=1


PI
fo

FingerprintPacket.Length=810
r

FingerprintPacket.Count=3
Response
In

FingerprintPacket.DuressIndex=1
te

FingerprintData=xxx
lb

15.2.36 Starting Searching for User Related Information


ra
s

Start searching for user related information.

Table 15-47

URL http://<server>/cgi-bin/AccessUser.cgi?action=startFind
Method GET
Description Start searching for user related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Search conditions. Users can
perform conditional search
Condition object R
according to the user information
field.
+UserID string O User ID

Access Control Extend APIs 439


+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:
Extend time user
Limit of passing times for guest
+UseTime uint16 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
User authority (attendance
+Authority uint8 O machine field). 1: Admin;
2: General user
+CitizenIDNo string O ID card number
DA

The password when unlocking by


HU

card + password. The password


+Password string O
when unlocking by UserID +
A_

password
HT

Door authority. The index in the


TP

controller is used with


_A

+Doors int16[] O TimeSections, and the value


corresponds to the subscript of
PI

the AC configuration.
fo

The door authority corresponds to


the period index. For example,
r

+TimeSections uint16[] O door 3 corresponds to period 2.


In

Each element corresponds to the


te

door in Doors.
lb

Holiday plan identification. The


value is the subscript number
ra

+SpecialDaysSchedule uint32[64] O configured by


s

SpecialDaysSchedule (defined in
the configuration).
"yyyy-MM-dd HH:mm:ss", start of
+ValidFrom string O validity period. Note: The original
"ValidDateStart" is deprecated.
"yyyy-MM-dd HH:mm:ss", end of
+ValidTo string O validity period. Note: The original
"ValidDateEnd" is deprecated.
[ Response Params ]
Token uint32 R Search token.
Total number of entries found this
Total uint32 R
time
Caps uint32 R Search capability: Maximum

Access Control Extend APIs 440


number of records that can be
returned each time.
[ Example ]

Request GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=startFind&Condition.UserID=1

{
"Token": 1234,
Response "Total": 20,
"Caps ": 20
}
DA

15.2.37 Getting User Related Information


HU

Get user related information.


A_
HT

Table 15-48
TP

URL http://<server>/cgi-bin/AccessUser.cgi?action=doFind
_A

Method GET
PI

Description Get user related information.


[ Request Params ] ( key=value format at URL )
fo

Name Type R/O Param Description


r

Token int R Search token


In
te

Offset int R Offset


lb

Count int R Number of entries obtained this time


ra
s

[ Response Params ]
info array<object> R Person information
[ Example ]

GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=doFind&Token=1234&Offset=0&C
Request
ount=20

Respons { "Info": [ {
e

Access Control Extend APIs 441


"UserID": "102",

}, { … }, … ]

15.2.38 Stopping Searching for User Related Information


Get user related information.

Table 15-49

URL http://<server>/cgi-bin/AccessUser.cgi?action=stopFind
Method GET
Description Get user related information.
DA

[ Request Params ] ( key=value format at URL )


HU

Name Type R/O Param Description


A_

Token int R Search token.


HT

[ Response Params ](OK)


TP

[ Example ]
_A
PI
fo

Request GET http://192.168.1.108/cgi-bin/AccessUser.cgi?action=stopFind&Token=1234


r
In
te

Response OK
lb
ra

15.2.39 Starting Searching for Card Number Related


s

Information
Start searching for card number related information.

Table 15-50

URL http://<server>/cgi-bin/ AccessCard.cgi?action=startFind


Method GET
Description Start searching for card number related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Search conditions. Users can
Condition object R perform conditional search
according to the user information

Access Control Extend APIs 442


field.
+UserID string O User ID
+CardNo string O User card number
Card type
Enumint{
0: Ordinary card
1: VIP card
+CardType uint16 O
2: Guest card
3: Patrol card
4: Blocklist card
5: Duress card
+CardName string O Card name
Card status Different card status
results in different person status.
0: Normal
1<<0: Reported for loss
+CardStatus uint32 O
DA

1<<1: Canceled
HU

1<<2: Frozen
1<<3: Arrearage
A_

1<<4: Overdue
HT

[ Response Params ]
TP

Token uint32 R Search token.


_A

Total number of entries found this


Total uint32 R
time
PI

Search capability: Maximum


fo

Caps uint32 R number of records that can be


returned each time.
r

[ Example ]
In
te
lb

Request GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=startFind&Condition.UserID=1


ra
s

"Token": 1234,
Response "Total": 20,

"Caps ": 20

15.2.40 Getting Card Number Related Information


Get card number related information.

Access Control Extend APIs 443


Table 15-51

URL http://<server>/cgi-bin/AccessCard.cgi?action=doFind
Method GET
Description Get card number related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

Token int R Search token.

Offset int R Offset

Number of entries obtained this


Count int R
time
[ Response Params ]
info array<object> R Person information
[ Example ]
DA
HU
A_

GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=doFind&Token=1234&Offset=0&C
Request
HT

ount=20
TP
_A
PI

{ "Info": [ {
fo
r

"UserID": "102",
Respons
In

e …
te

}, { … }, … ]
lb
ra

}
s

15.2.41 Stopping Searching for Card Number Related


Information
Stop searching for card number related information.

Table 15-52

URL http://<server>/cgi-bin/AccessCard.cgi?action=stopFind
Method GET
Description Stop searching for card number related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

Access Control Extend APIs 444


Token int R Search token.

[ Response Params ](OK)


[ Example ]

Request GET http://192.168.1.108/cgi-bin/AccessCard.cgi?action=stopFind&Token=1234

Response OK

15.2.42 Starting Searching for Face Related Information


Start searching for face related information.
DA
HU

Table 15-53
A_

URL http://<server>/cgi-bin/AccessFace.cgi?action=startFind
HT

Method GET
Description Start searching for face related information.
TP

[ Request Params ] ( key=value format at URL )


_A

Name Type R/O Param Description


PI

Search conditions. Users can


perform conditional search
fo

Condition object R
according to the user information
r

field.
In

+UserID string O User ID


[ Response Params ]
te

Token uint32 R Search token.


lb

Total number of entries found this


Total uint32 R
ra

time
s

Search capability: Maximum


Caps uint32 R number of records that can be
returned each time.
[ Example ]

Request GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=startFind&Condition.UserID=1

{
Response
"Token": 1234,

Access Control Extend APIs 445


"Total": 20,

"Caps ": 20

15.2.43 Getting Face Related Information


Get face related information.

Table 15-54

URL http://<server>/cgi-bin/AccessFace.cgi?action=doFind
Method GET
Description Get face related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
DA

Token int R Search token.


HU

Offset R Offset
A_

int
HT

Number of entries obtained this


Count int R
time
TP

[ Response Params ]
_A

info array<object> R Person information


PI

[ Example ]
fo
r

GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=doFind&Token=1234&Offset=0&C
In

Request
ount=20
te
lb
ra

{ "Info": [ {
s

"UserID": "102",
Respons
e …

}, { … }, … ]

15.2.44 Stopping Searching for Face Related Information


Stop searching for face related information.

Access Control Extend APIs 446


Table 15-55

URL http://<server>/cgi-bin/AccessFace.cgi?action=stopFind
Method GET
Description Stop searching for face related information.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

Token int R Search token.

[ Response Params ](OK)


[ Example ]

Request GET http://192.168.1.108/cgi-bin/AccessFace.cgi?action=stopFind&Token=1234


DA
HU

Response OK
A_
HT
TP

15.2.45 Get access control capability


_A
PI

Table 15-56
fo
r

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=getCaps
In

Method GET
Description Get access control capability.
te

Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getCaps
lb

Success caps.AccessControlChannels=5
ra

Return
s

Comment
Params in Response :

AccessControlChannels: the max channel count supported by control

15.2.46 Add SubController

Table 15-57

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=addDevice&devAddr=<devA
ddr>&name=<name>
Method GET
Description Add SubController.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=addDevice&devAddr=1

Access Control Extend APIs 447


&name=Sub1
Success FaiedCode=0
Return
Comment
Params in URL:

devAddr: SubController ID, range is [1...255]

name: SubController Name

Params in Response:

FaiedCode: 0-Success; 1-Already exists; 2-Reach quantity limit; 3-Other reason

15.2.47 Modify SubController


DA

Table 15-58
HU

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=modifyDevice&devAddr=<de
A_

vAddr>&name=<name>
HT

Method GET
Description Modify SubController.
TP

Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=modifyDevice&devAddr
_A

=1&name=Sub11
PI

Success OK
Return
fo

Comment
Params in URL:
r

devAddr: SubController ID, range is [1...255]


In
te

name: SubController Name


lb
ra
s

15.2.48 Remove SubController

Table 15-59

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=removeDevice&devAddrs[0]=
<devAddr0>[& devAddrs[1]=<devAddr1>&...&devAddrs[n]=<devAddrn>]
Method GET
Description Remove SubController.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=removeDevice&devAdd
rs[0]=4&devAddrs[1]=5
Success devInfo[0].DevAddr=4
Return devInfo[0].FaiedCode=0
devInfo[1].DevAddr=5

Access Control Extend APIs 448


devInfo[1].FaiedCode=1
Comment
Params in URL:

devAddr0...devAddrn: SubController ID, range is [1...255]

Params in Response:

DevAddr: the removed SubController ID

FaiedCode: 0-Success; 1-Fail; 2-Other

15.2.49 Get SubController Info

Table 15-60

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=getSubControllerInfo&devAd
DA

drs[0]=<devAddr0>[& devAddrs[1]=<devAddr1>&...&devAddrs[n]=<devAddrn>]
HU

Method GET
A_

Description Get SubController Info.


HT

Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getSubControllerInfo&d
evAddrs[0]=4&devAddrs[1]=5
TP

Success devInfo[0].DevAddr=4
_A

Return devInfo[0].Name=Sub4
PI

devInfo[0].AccessProperty=unidirect
devInfo[0].DeviceType=ACS-1202B-S
fo

devInfo[0].VerSion=V1.00428
r

devInfo[0].DoorToReadID[0].Door=0
In

devInfo[0].DoorToReadID[0].ReaderID[0]=1
devInfo[0].DoorToReadID[0].ReaderID[1]=2
te

devInfo[0].DoorToReadID[1].Door=1
lb

devInfo[0].DoorToReadID[1].ReaderID[0]=3
ra

devInfo[0].DoorToReadID[1].ReaderID[1]=4
devInfo[1].DevAddr=5
s

devInfo[1].Name=Sub5
devInfo[1].AccessProperty=bidirect
devInfo[1].DeviceType=ACS-1202B-S
devInfo[1].VerSion=V1.00428
devInfo[1].DoorToReadID[0].Door=0
devInfo[1].DoorToReadID[0].ReaderID[0]=11
devInfo[1].DoorToReadID[0].ReaderID[1]=12
Comment
Params in URL:

devAddr0...devAddrn: SubController ID, range is [1...255]

Params in Response:

DevAddr: SubController ID, range is [1...255]

Access Control Extend APIs 449


AccessProperty: range is [unidirect, bidirect]

DoorToReadID: ReaderID used by the door

15.2.50 Get SubController States

Table 15-61

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=getSubControllerStates&dev
Addrs[0]=<devAddr0>[& devAddrs[1]=<devAddr1>&...&devAddrs[n]=<devAddrn>]
Method GET
Description Get SubController States.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getSubControllerStates
&devAddrs[0]=4&devAddrs[1]=5
DA

Success devStates[0].DevAddr=4
HU

Return devStates[0].State=0
devStates[1].DevAddr=5
A_

devStates[1].State=1
HT

Comment
Params in URL:
TP

devAddr0...devAddrn: SubController ID, range is [1...255]


_A
PI

Params in Response:

DevAddr: SubController ID, range is [1...255]


fo

State: 0-Offline; 1-Online; 2-Other


r
In
te
lb

15.2.51 Set RepeatEnter Route


ra
s

Table 15-62

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=setRepeatEnterRoute&index
=<index>&routeInfo.PointInfo[x0].ReaderID[0]=<ReadID0>&routeInfo.PointInfo[x0].Re
aderID[1]=<ReadID1>[&routeInfo.PointInfo[x1].ReaderID[0]=<ReadID0>&routeInfo.Poi
ntInfo[x1].ReaderID[1]=<ReadID1>]&routeInfo.TimeSections=<TimeIndex>&routeInfo.
Flag=<Flag>&routeInfo.Name=<Name>
Method GET
Description Set RepeatEnter Route.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=setRepeatEnterRoute&i
ndex=0&routeInfo.PointInfo[0].ReaderID[0]=11&routeInfo.PointInfo[0].ReaderID[1]=22&
routeInfo.PointInfo[1].ReaderID[0]=33&routeInfo.PointInfo[1].ReaderID[1]=44&routeInf
o.TimeSections=1&routeInfo.Flag=1&routeInfo.Name=123
Success OK

Access Control Extend APIs 450


Return
Comment
Params in URL:

index: route index

x0,x1: PointInfo index

TimeIndex: subscript of AccessTimeSchedule

Flag: 0-Disable this route; 1-Enable this route

Name: route name

15.2.52 Get RepeatEnter Route

Table 15-63
DA
HU

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=getRepeatEnterRoute&index
=<index>
A_

Method GET
HT

Description Get RepeatEnter Route.


TP

Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getRepeatEnterRoute&i
_A

ndex=0
Success routeInfo.PointInfo[0].ReaderID[0]=11
PI

Return routeInfo.PointInfo[0].ReaderID[1]=22
routeInfo.PointInfo[1].ReaderID[0]=33
fo

routeInfo.PointInfo[1].ReaderID[1]=44
r

routeInfo.TimeSections=1
In

routeInfo.Flag=1
te

routeInfo.Name=123
Comment
lb

Params in URL:
ra

index: route index


s

Params in Response:

PointInfo: is an array, stands for points in route

TimeSections: subscript of AccessTimeSchedule

Flag: 0-Disable this route; 1-Enable this route

Name: route name

15.2.53 Set ABLock Route

Table 15-64

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=setABLockRoute&index=<in
dex>&routeInfo.PointInfo[x0].Doors[0]=<DoorID0>&routeInfo.PointInfo[x0].Doors[1]=<

Access Control Extend APIs 451


DoorID1>[&routeInfo.PointInfo[x1].Doors[0]=<DoorID0>&routeInfo.PointInfo[x1].Doors
[1]=<DoorID1>]&routeInfo.TimeSections=<TimeIndex>&routeInfo.Flag=<Flag>&routeI
nfo.Name=<Name>
Method GET
Description Set ABLock Route.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=setABLockRoute&index
=0&routeInfo.PointInfo[0].Doors[0]=11&routeInfo.PointInfo[0].Doors[1]=22&routeInfo.P
ointInfo[1].Doors[0]=33&routeInfo.PointInfo[1].Doors[1]=44&routeInfo.TimeSections=1
&routeInfo.Flag=1&routeInfo.Name=123
Success OK
Return
Comment
Params in URL:

index: route index

x0,x1: PointInfo index

TimeIndex: subscript of AccessTimeSchedule


DA
HU

Flag: 0-Disable this route; 1-Enable this route


A_

Name: route name


HT
TP
_A

15.2.54 Get ABLock Route


PI
fo

Table 15-65
r

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=getABLockRoute&index=<in
In

dex>
te

Method GET
Description Get ABLock Route.
lb

Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getABLockRoute&index
ra

=0
s

Success routeInfo.PointInfo[0].Doors[0]=11
Return routeInfo.PointInfo[0].Doors [1]=22
routeInfo.PointInfo[1].Doors [0]=33
routeInfo.PointInfo[1].Doors [1]=44
routeInfo.TimeSections=1
routeInfo.Flag=1
routeInfo.Name=123
Comment
Params in URL:

index: route index

Params in Response:

PointInfo: is an array, stands for points in route

Access Control Extend APIs 452


TimeSections: subscript of AccessTimeSchedule

Flag: 0-Disable this route; 1-Enable this route

Name: route name

15.2.55 Get Log Status

Table 15-66

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=getLogStatus&devAddr=<de
vAddr>
Method GET
Description Get Log Status.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=getLogStatus&devAddr
DA

=1
HU

Success OK
A_

Return
HT

Comment
Params in URL:
TP

devAddr: SubController ID, range is [1...255]


_A
PI
fo

15.2.56 Sync Offline Log


r
In

Table 15-67
te

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=syncOfflineLog&devAddr=<d
lb

evAddr>
ra

Method GET
s

Description Sync Offline Log.


Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=syncOfflineLog&devAd
dr=1
Success OK
Return
Comment
Params in URL:

devAddr: SubController ID, range is [1...255]

Access Control Extend APIs 453


15.2.57 Sync SubController Time

Table 15-68

Syntax http://<server>/cgi-bin/accessControlManager.cgi?action=syncSubControllerTime&dev
Addrs[0]=<devAddr0>[& devAddrs[1]=<devAddr1>&...&devAddrs[n]=<devAddrn>]
Method GET
Description Sync SubController Time.
Example http://192.168.1.108/cgi-bin/accessControlManager.cgi?action=syncSubControllerTime
&devAddrs[0]=4&devAddrs[1]=5
Success errorDevAddrs[0]=4
Return
Comment
Params in URL:

devAddr0...devAddrn: SubController ID, range is [1...255]


DA

Params in Response:
HU

errorDevAddrs: is an array, stands for DevAddr which failed in sync time


A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

Access Control Extend APIs 454


16 Intelligent Building APIs
16.1 Video Talk
The following Apis are supported by VTT / VTA products.

16.1.1 Subscribe Video Talk Status


Subscribe the video talk status. When client disconnect, it will unsubscribe.
Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=attachState
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
DA

Request Example
HU

http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=attachState
A_

Response Params ( multipart ; key=value format in body )


HT

Name Type R/O Description Example


TP

SID integer No Server subscription ID 13606


_A

state object No Called state


PI

+State string No Call state Answer


Enumchar[32]{
fo

"Ringing": passive call


r

"Inviting": active call


"Answer"
In

"Refuse"
te

"Cancel"
lb

"Hangup"
"Busying"
ra

}
s

+Talkback object No Transmission method, audio


and video encoding format,
listening port and other
session description
information
++Pack string No Packing Mode RTP
It only supports "RTP”
currently.
++Protocol string No Transport protocol type UDP
Enumchar[32]{
TCP
UDP
}
++Type string No Talk type Talk

Intelligent Building APIs 455


Enumchar[32]{
"Talk": Talk
"Broadcast": Broadcast
}
++Audio object No Audio Description
+++Format object[] No Supported audio decoding
formats
++++Compressio string No Audio compression format PCM
n Enumchar[32]{
PCM
ADPCM
"G.711A"
"G.711Mu"
"G.726"
"G.729"
"MPEG2"
DA

AMR
AAC
HU

}
A_

++++Frequency integer No Audio Sampling Frequency 44000


HT

++++Depth integer No Sampling depth 16


TP

++Video object No Video description


+++VideoPort integer No Receive video stream port 7000
_A

When receiving multiple


PI

video channels, use


different ports respectively.
fo

+++Format object[] No Supported video decoding


r

formats
In

++++Compressio string No Video compression format H.264


n Enumchar[32]{
te

"MPEG4"
lb

"MPEG2"
ra

"MPEG1"
s

"MJPG"
"H.263"
"H.264"
}
++++Frequency integer No Video sampling frequency 9000
++MediaAddr string No Streaming address 224.10.10.10
It can be an intercom or
broadcast address
Response Example
HTTP/1.1 200 OK
Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

Intelligent Building APIs 456


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

SID=315
state.State=Answer
state.Talkback.Pack=RTP
state.Talkback.Protocol=UDP
state.Talkback.Type=Talk
state.Talkback.Audio.AudioPort=6000
state.Talkback.Audio.Format[0].Compression=PCM
state.Talkback.Audio.Format[0].Frequency=44000
state.Talkback.Audio.Format[0].Depth=16
state.Talkback.Audio.Format[1].Compression=G.711A
state.Talkback.Audio.Format[1].Frequency=44000
state.Talkback.Audio.Format[1].Depth=16
DA

state.Talkback.Video.VideoPort=7000
state.Talkback.Video.Format[0].Compression=H.264
HU

state.Talkback.Video.Format[0].Frequency=90000
A_

state.Talkback.Video.Format[1].Compression=MJPG
HT


TP

state.Talkback. MediaAddr=224.10.10.10
_A

--<boundary>

PI

16.1.2 Unsubscribe Video Talk Status


fo
r

Unsubscribe the video talk status.


In

Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=detachState


Method GET
te

Request Params ( key=value format in URL )


lb

Name Type R/O Description Example


ra

SID int R the subscribe id, which is the response of 13606


s

attachState
Request Example
http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=detachState&SID=101

Response Params ( OK in body )


Response Example
OK

16.1.3 Invite Server on Video Talk


Start the video talk conversation.
Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=invite
Method GET
Request Params ( key=value format in URL )

Intelligent Building APIs 457


Name Type R/O Description Example
Talkback integer R Channel number, starting from 1 1
+Pack string O Packing Mode RTP
It only supports "RTP” currently.
+Protocol string O Transport protocol type UDP
Enumchar[32]{
TCP
"UDP"
}
+Type string O Talk type Talk
Enumchar[32]{
"Talk": Talk
"Broadcast": Broadcast
}
+Audio object O Audio Description
++Format object[] O Supported audio decoding formats
DA

+++Compression string O Audio compression format PCM


Enumchar[32]{
HU

PCM
A_

"ADPCM"
HT

"G.711A"
TP

"G.711Mu"
"G.726"
_A

"G.729"
PI

"MPEG2"
"AMR"
fo

"AAC"
r

}
In

+++Frequency integer O Audio Sampling Frequency 44000


+++Depth integer O Sampling depth 16
te

+Video object O Video description


lb

++VideoPort integer O Receive video stream port 7000


ra

When receiving multiple video channels,


s

use different ports respectively.


++Format object[] O Supported video decoding formats
+++Compression string O Video compression format H.264
Enumchar[32]{
"MPEG4"
"MPEG2"
"MPEG1"
"MJPG"
"H.263"
"H.264"
}
+++Frequency integer O Video sampling frequency 9000
+MediaAddr string O Streaming address 224.10.10.10
It can be an intercom or broadcast

Intelligent Building APIs 458


address
Request Example
http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=invite&Talkback.Protocol=UDP&Talkback.Type=T
alk&Talkback.MediaAddr=224.10.10.10

Response Params ( OK in body )


Response Example
OK

16.1.4 Cancel the Video Talk


Cancel video talk conversation.
Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=cancel
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
DA

Request Example
HU

http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=cancel
A_

Response Params ( OK in body )


HT

Response Example
TP

OK
_A

16.1.5 Answer the Invitation


PI

Answer the call.


fo

Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=answer


r

Method GET
In

Request Params ( key=value format in URL )


te

Name Type R/O Description Example


Talkback integer R Channel number, starting from 1 1
lb

+Pack string O Packing Mode RTP


ra

It only supports "RTP” currently.


s

+Protocol string O Transport protocol type UDP


Enumchar[32]{
TCP
"UDP"
}
+Type string O Talk type Talk
Enumchar[32]{
"Talk": Talk
"Broadcast": Broadcast
}
+Audio object O Audio Description
++Format object[] O Supported audio decoding formats
+++Compression string O Audio compression format PCM
Enumchar[32]{

Intelligent Building APIs 459


PCM
"ADPCM"
"G.711A"
"G.711Mu"
"G.726"
"G.729"
"MPEG2"
"AMR"
"AAC"
}
+++Frequency integer O Audio Sampling Frequency 44000
+++Depth integer O Sampling depth 16
+Video object O Video description
++VideoPort integer O Receive video stream port 7000
When receiving multiple video
channels, use different ports
DA

respectively.
++Format object[] O Supported video decoding formats
HU

+++Compression string O Video compression format H.264


A_

Enumchar[32]{
HT

"MPEG4"
TP

"MPEG2"
"MPEG1"
_A

"MJPG"
PI

"H.263"
"H.264"
fo

}
r

+++Frequency integer O Video sampling frequency 9000


In

+MediaAddr string O Streaming address 224.10.10.10


It can be an intercom or broadcast
te

address
lb

Example
ra

http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=answer&Talkback.Protocol=UDP&Talkback.Type
s

=Talk&Talkback.MediaAddr=224.10.10.10

Response Params ( OK in body )


Response Example
OK

16.1.6 Refuse to Answer the Video Talk Invitation


Refuse answer the call.
Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=refuse
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example

Intelligent Building APIs 460


http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=refuse

Response Params ( OK in body )


Response Example
OK

16.1.7 Hang Up
Close it when the conversation is over.
Request URL http://<server>/cgi-bin/VideoTalkPeer.cgi?action=hangup
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
Request Example
http://192.168.1.108/cgi-bin/VideoTalkPeer.cgi?action=hangup
DA

Response Params ( OK in body )


HU

Response Example
A_

OK
HT

16.2 Video Talk Log


TP
_A

The following Apis are supported by VTO products.


PI

16.2.1 Query Video Talk Log


fo
r

Table 16-1
In

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog[&condition.C
Syntax
te

allType=<Type>&condition.EndState=<State>&count=<countNo>]
lb

Method GET
Description Find the VideoTalkLog record.
ra

http://192.168.1.108/cgi-bin/recordFinder.cgi?action=find&name=VideoTalkLog&conditi
s

Example
on.CallType=Incoming&condion.EndState=Missed&count=500
totalCount=1000
found=500
records[0].RecNo=789
Success records[0].CreateTime=123456789
Return records[0].CallType=Incoming
records[0].EndState=Received
records[0].PeerNumber=501

Parameters in URL:
Type: call type
Comment
State: end state of the call
countNo: the number of records to get

Intelligent Building APIs 461


Parameters in Response :
totalCount : the record count which match condition
found : the record count to return
CallType: call type. The range is {"Incoming", "Outgoing"}.
EndState: the range is {"Missed" , "Received"}

16.3 Announcement Record


The following Apis are supported by VTO products.

16.3.1 Insert Record

Table 16-2

http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=Announcement&Conten
DA

Syntax t=<Content>&ExpirTime=<ExpirTime>&IssueTime=<IssueTime>&Title=<Title>&User
HU

=<User>&State=<State>&ReadFlag=<ReadFlag>
Method GET
A_

Description Insert the Announcement record.


HT

http://192.168.1.108/cgi-bin/recordUpdater.cgi?action=insert&name=Announcement&C
TP

Example ontent=stringData&ExpirTime=2012-01-01%2012:00:00&IssueTime=2012-01-01%201
_A

2:00:00&Title=Anounce1&User=101&State=0&ReadFlag=0
Success
PI

RecNo=<RecNo>
Return
Parameters in URL:
fo

Content: Announcement Content


r

ExpirTime: the time when the Announcement expire, format: 2012-01-01%2012:00:00


In

IssueTime: Announcement issue time, format: 2012-01-01%2012:00:00


te

Title: title of the announcement


Comment
User: the number the Announcement issued to
lb

State: the state of the Announcement. 0 init, 1 send , 2 overdue


ra

ReadFlag: the read flag. 0 not read, 1 read.


s

Parameters in Response :
RecNo: the record index of the new record

16.4 Alarm Record

16.4.1 Query Alarm Record

Table 16-3

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AlarmRecord[&StartTime=<
Syntax
startTime>&EndTime=<endTime>&count=<countNo>]
Method GET
Description Find the AlarmRecord record. ( This api is supported by video talk device. )

Intelligent Building APIs 462


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
records[0].CreateTime=123456789
Success records[0].Channel=0
Return records[0].SenseMethod=DoorMagnetism
records[0].RoomNumber=501
records[0].ReadFlag=0
records[0].Comment=Friend

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
DA
HU

Comment Parameters in Response :


totalCount : the record count which match condition
A_

found : the record count to return


HT

SenseMethod :the range is { "DoorMagnetism", "PassiveInfrared", "GasSensor",


TP

"SmokingSensor", "WaterSensor", "ActiveInfrared", "CallButton", "UrgencyButton",


"Steal", "Perimeter", "PreventRemove", "DoorBell" }
_A
PI

16.4.2 Query Access Control Alarm Record


fo
r

Table 16-4
In

http://<server>/cgi-bin/recordFinder.cgi?action=find&name=AccessControlAlarmRecor
Syntax
te

d[&StartTime=<startTime>&EndTime=<endTime>&count=<countNo>]
Method GET
lb

Find the AccessControlAlarmRecord record. ( This api is supported by access control


ra

Description
device. )
s

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
00
totalCount=1000
found=500
records[0].RecNo=789
records[0].CreateTime=123456789
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

Comment Parameters in URL:

Intelligent Building APIs 463


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

Parameters in Response :
totalCount : the record count which match condition
found : the record count to return
EventCode : alarm event code, the range is { "DoorNotClosed", "BreakIn",
"RepeatEnter", "Duress", "AlarmLocal", "ChassisIntruded" }

16.5 SIP
The user needs to connect video intercom through CGI protocol, but do not know how to use this
protocol to configure the device. This document provides the corresponding CGI protocol according
to the configuration data format involved in the specific service.
DA

16.5.1 Get SIP Configuration


HU
A_

Table 16-5
HT
TP

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name
=SIP
_A

Method GET
PI

Description Get SIP server configuration.


[ Request Params ] (None)
fo

[ Response Params ] ( key=value format )


r

Name Type R/O Param Description


In

table object R Configuration data table


te

+SIP object R Configuration name


lb

++AccoutName string O Account name


SIP server
ra

++SIPServer string R
IP address or domain name
s

++SIPServerPort int R SIP server port number


++OutboundProxy string O Proxy server IP address or domain name
++OutboundProxyID string O Proxy server ID
++OutboundProxyPort Int O Proxy server port number
User account ID
++UserID String R
Generally a phone number
++UserType int O User type
++AuthID String R Authentication ID
++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 464


++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
false: Not delete
++DefaultCallNumber string O Default call number
++MediaDetail Object O Media configuration
Video stream
enumchar[32]{
"Main": Main stream
+++VideoStream string O "Extra1": Sub stream 1
"Extra2": Sub stream 2
"Extra3": Sub stream 3
DA

}
HU

Audio stream
enumchar[32]{
A_

"Main": Main stream


HT

+++AudioStream string O "Extra1": Sub stream 1


TP

"Extra2": Sub stream 2


_A

"Extra3": Sub stream 3


}
PI

++RouteEnable bool O Enable SIP cross-router or not.


fo

Router address, which can be IP


++Route string O
address or domain name.
r

Username to log in to VTNC


In

++SIPServerLoginUserName string O
For intelligent building only
te

Password to log in to VTNC


++SIPServerLoginPWD string O
lb

For intelligent building only


Whether the door station is a standby
ra

++IsMainVTO string O server


s

For intelligent building only


Standby server IP address
++SIPServerRedundancy string O
For intelligent building only
++SIPServerRedundancyUserNa Standby server login username
string O
me For intelligent building only
++SIPServerRedundancyPassWo Standby server login password
string O
rd For intelligent building only
The start number of the analog indoor
++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 465


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
table.SIP.AuthPassword=123456
table.SIP.IsMainVTO=0
table.SIP.LocalRTPPort=15000
table.SIP.LocalSIPPort=5060
table.SIP.OutboundProxy=192.168.1.111
table.SIP.OutboundProxyID=8000
table.SIP.OutboundProxyPort=5060
table.SIP.RegisterRealm=VDP
table.SIP.Route[0]=sip:10.30.1.2:5060;lr
DA

Response table.SIP.RouteEnable=true
HU

table.SIP.SIPServer=192.168.1.111
table.SIP.SIPServerID=8000
A_

table.SIP.SIPServerLoginPWD=admin
HT

table.SIP.SIPServerLoginUserName=admin
TP

table.SIP.SIPServerPort=5060
table.SIP.SIPServerRedundancyPassWord=admin
_A

table.SIP.SIPServerRedundancyUserName=admin
PI

table.SIP.UserEnable=true
table.SIP.UserID=8001
fo

table.SIP.UserType=2
r
In

16.5.2 Modifying SIP Configuration


te
lb

Table 16-6
ra

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

Method GET
Description Modify SIP configuration.
[ Request Params ] ( key=value at URL )
Name Type R/O Param Description
+SIP object R Configuration name
++AccoutName string O Account name
SIP server
++SIPServer string R
IP address or domain name
++SIPServerPor
int R SIP server port number
t
++OutboundPro
string O Proxy server IP address or domain name
xy
++OutboundPro
string O Proxy server ID
xyID

Intelligent Building APIs 466


++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
String R Authentication password
d
STUN (Simple Traversal of UDP over NATs) server
++STUNServer String O
IP address or domain name
++RegisterReal
String R Registration domain
m
++RegExpiration int O Registration interval, in seconds
Local SIP port
++LocalSIPPort Int R
0-65535
Local RTP port
DA

++LocalRTPPort int R
0-65535
HU

Restart to delete registration information.


++UnregisterOn
A_

bool O true: Delete


Reboot
false: Not delete
HT

++DefaultCallNu
TP

string O Default call number


mber
_A

++MediaDetail Object O Media configuration


PI

Video stream
enumchar[32]{
fo

"Main": Main stream


+++VideoStream string O "Extra1": Sub stream 1
r

"Extra2": Sub stream 2


In

"Extra3": Sub stream 3


te

}
lb

Audio stream
enumchar[32]{
ra

"Main": Main stream


s

+++AudioStream string O "Extra1": Sub stream 1


"Extra2": Sub stream 2
"Extra3": Sub stream 3
}
++RouteEnable bool O Enable SIP cross-router or not.
Router address, which can be IP address or domain
++Route string O
name.
++SIPServerLog Username to log in to VTNC
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 467


++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
For intelligent building only
ord
The start number of the analog indoor monitor supported
++AnalogNumbe
string O in the analog system
rStart
For intelligent building only
The end number of the analog indoor monitor supported
++AnalogNumbe
string O in the analog system
rEnd
For intelligent building only
Enable registration
For intelligent building
++UserEnable bool R
DA

true: Register to the SIP server.


HU

false: Not register to the SIP server.


[ Response Params ] ( OK )
A_

[ Example ]
HT

GET http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&SIP.SIPServer
TP

Request =192.168.1.108&SIP.SIPServerPort=5060&SIP.RegisterRealm=VDP&SIP.RouteEnable=
_A

true
Response OK
PI
fo

16.5.3 Get Registar Configuration


r
In

Table 16-7
te
lb

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=
Registar
ra

Method GET
s

Description Get Registar configuration.


[ Request Params ] (None)
[ Response Params ] ( key=value format )
Name Type R/O Param Description
table object R Configuration data table
+Registar object[] R
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.)
++Enable bool O Register to the registration server or not.

Intelligent Building APIs 468


++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"
"ThirdParty"
"3CXSystem"
"Asterisk"
}
++GeneralServerInfo object O
+++Address char[40] O IP address
+++Port uint O Registration port number
+++Password char[64] O Password registered to the register server,
which will be used when registration
DA

authentication is required.
HU

[ Example ]
GET http://10.0.0.8/cgi-bin/configManager.cgi?action=getConfig&name=
A_

Request
Registar
HT

Response table.Registar[0].ServerType=VTO
TP
_A

16.5.4 Modifying Registar Configuration


PI
fo

Table 16-8
r

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

Method GET
te

Description Modify Registar configuration.


lb

[ Request Params ] ( key=value at URL )


Name Type R/O Param Description
ra

+Registar object[] R One-dimensional array. Each subscript represents a register


s

server.
++RegistarNam char[] O Registration server name, which must be unique.
e (Note: For VTH, use the IP address and port in the
configuration to connect VTO.)
++Enable bool O Register to the registration server or not.

Intelligent Building APIs 469


++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"
"ThirdParty"
"3CXSystem"
"Asterisk"
}
++GeneralServe object O
rInfo
+++Address char[40] O IP address
+++Port uint O Registration port number
+++Password char[64] O Password registered to the registration server, which will be
DA

used when registration authentication is required.


HU

[ Response Params ] ( OK )
[ Example ]
A_

GET
HT

Request
http://10.0.0.8/cgi-bin/configManager.cgi?action=setConfig&Registar.ServerType=VTO
TP

Response OK
_A
PI

16.6 Room Number Database Management


fo
r

16.6.1 Adding Room Number


In
te

Table 16-9
lb

URL http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=VideoTalkContact
ra

Method GET
s

Description Add room number to the contacts.


[ Request Params ] (key=value format in URL)
Name Type R/O Param Description
CreateTime uint O Start time
UTC seconds, read only
FirstName string O First name
FamilyName string O Last name
VTShortNumber string R Short number for video intercom
VTMiddleNumbe string O Middle number for video intercom
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

Intelligent Building APIs 470


VTOPosition string O Door number linked with indoor monitor
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
for video talk
(Change string to uint32 for consistency)
VTSlavePort uint32 O Allocator port when accessing to the analog indoor monitor for
video talk
(Change string to uint32 for consistency)
VTSlaveAddress string O Address of the analog indoor monitor for video talk
NickName string O Nickname
Notes string O Notes
DA

Type enumchar[ O User type


HU

32] Enumchar[32]{
"VTH": Indoor monitor
A_

"VTO": Door station


HT

}
TP

RegisterType enumchar[ R Registration method


_A

32] Enumchar[32]{
"public"
PI

"local"
fo

}
VTHPassword string R Registration password
r

VTOBuilding string O Building number


In

VTOUnit string O Unit number


te

GroupNumber string O Group


lb

Channel uint32 O Channel number, based on which the mobile phone subscribes
to the call notification message.
ra

Floors char[256][4 O Floor number (lift control requirements), with up to 256


s

] characters
LiftControlByVT bool O Lift control is triggered by the indoor monitor opening the door.
H
[ Response Params ] (key=value format )
Name Type R/O Param Description
RecNo int R Record ID of successfully creation
[ Example ]
GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=insert&name=VideoTalkContact&VTShort
Number=101&RegisterType=public&VTHPassword=123456
Response RecNo=12345

Intelligent Building APIs 471


16.6.2 Getting Records by recno

Table 16-10

URL http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=VideoTalkContact
Method GET
Description Search for room number records by recno.
[ Request Params ] (key=value format in URL)
Name Type R/O Param Description
recno int R Record ID
[ Response Params ] (key=value format )
Name Type R/O Param Description
+RecNo int R Record ID
+CreateTime uint O Start time
UTC seconds, read only
DA

+FirstName string O First name


+FamilyName string O Last name
HU

+VTShortNumbe string R Short number for video intercom


A_

r
HT

+VTMiddleNumb string O Middle number for video intercom


TP

er
+VTLongNumbe string O Long number for video intercom or serial number of VTH
_A

r analog indoor monitor


PI

+VTNetAddress string O Network address for video intercom


+MacAdress string O MAC address
fo

+VTOPosition string O Door number linked with indoor monitor


r

+VTSlaveBindM enumint O Mode when accessing to the analog indoor monitor for video
In

ode talk
te

Enumint{
0: SubAddress
lb

1: SubID+SubPort
ra

}
s

+VTSlaveId uint32 O Allocator address when accessing to the analog indoor monitor
for video talk
(Change string to uint32 for consistency)
+VTSlavePort uint32 O Allocator port when accessing to the analog indoor monitor for
video talk
(Change string to uint32 for consistency)
+VTSlaveAddres string O Address of the analog indoor monitor for video talk
s
+NickName string O Nickname
+Notes string O Notes
+Type enumchar[ O User type
32] Enumchar[32]{
"VTH": Indoor monitor
"VTO": Door station

Intelligent Building APIs 472


}
+RegisterType enumchar[ R Registration method
32] Enumchar[32]{
"public"
"local"
}
+VTHPassword string R Registration password
+VTOBuilding string O Building number
+VTOUnit string O Unit number
+GroupNumber string O Group
[ Example ]
GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=get&name=VideoTalkContact&recno=123
45
record.RecNo=12345
record.CreateTime=123456789
DA

record.FirstName=Dafei
HU

record.FamilyName=Wang
record.VTShortNumber=0101
A_

record.VTMiddleNumber=11010101
HT

record.VTLongNumber=330103001101010151
TP

record.VTNetAddress=127.0.0.1
_A

record.MacAdress=0A:3E:FF:2A:50:41
record.VTOPosition=01018001
PI

record.VTSlaveBindMode=0
fo

record.VTSlaveId=1258421
Response record.VTSlavePort=1258421
r

record.VTSlaveAddress=04:b3:01:f7
In

record.NickName=Nick
te

record.Notes=Friend
record.Type=VTH
lb

record.RegisterType=public
ra

record.VTHPassword=123456
s

record.VTOBuilding=01
record.VTOUnit=01
record.GroupNumber=301
record.Channel=1
record.Floors[0]=1
record.LiftControlByVTH=true

16.6.3 Updating Room Number Records

Table 16-11

URL http://<server>/cgi-bin/recordUpdater.cgi?action=update&name=VideoTalkContact
Method GET
Description Update Room number database records.

Intelligent Building APIs 473


[ Request Params ] (key=value format in URL)
Name Type R/O Param Description
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
r
VTLongNumber string O Long number for video intercom or serial number of VTH
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
VTSlaveBindMo enumint O Mode when accessing to the analog indoor monitor for video
DA

de talk
HU

Enumint{
A_

0: SubAddress
1: SubID+SubPort
HT

}
TP

VTSlaveId uint32 O Allocator address when accessing to the analog indoor monitor
_A

for video talk


PI

(Change string to uint32 for consistency)


VTSlavePort uint32 O Allocator port when accessing to the analog indoor monitor for
fo

video talk
(Change string to uint32 for consistency)
r

VTSlaveAddress string O Address of the analog indoor monitor for video talk
In

NickName string O Nickname


te

Notes string O Notes


lb

Type enumchar[ O User type


ra

32] Enumchar[32]{
"VTH": Indoor monitor
s

"VTO": Door station


}
RegisterType enumchar[ O Registration method
32] Enumchar[32]{
"public"
"local"
}
VTHPassword string O Registration password
VTOBuilding string O Building number
VTOUnit string O Unit number
GroupNumber string O Group
Channel uint32 O Channel number, based on which the mobile phone subscribes
to the call notification message.

Intelligent Building APIs 474


Floors char[256][4 O Floor number (lift control requirements), with up to 256
] characters
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
Response OK

16.6.4 Deleting Records by recno

Table 16-12

URL http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=VideoTalkContact
DA

Method GET
HU

Description Delete records by recno.


A_

[ Request Params ] (key=value format in URL)


Name Type R/O Param Description
HT

recno int R Record ID


TP

[ Response Params ] (OK)


_A

[ Example ]
PI

GET
Request http://<server>/cgi-bin/recordUpdater.cgi?action=remove&name=VideoTalkContact&recno
fo

=12345
Response OK
r
In

16.6.5 Clearing All Room Numbers


te
lb

Table 16-13
ra

URL http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=VideoTalkContact
s

Method GET
Description Delete all records .
[ Request Params ] (key=value format in URL)
Name Type R/O Param Description
name string R Database name, which must be VideoTalkContact.
[ Response Params ] (OK)
[ Example ]
Request GET http://<server>/cgi-bin/recordUpdater.cgi?action=clear&name=VideoTalkContact
Response OK

Intelligent Building APIs 475


16.6.6 Getting Total Quantity of Room Number

Table 16-14

URL http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=VideoTalkContact
Method GET
Description Get the total number of records of the database VideoTalkContact.
[ 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 ]
GET
Request
DA

http://<server>/cgi-bin/recordFinder.cgi?action=getQuerySize&name=VideoTalkContact
Response Count=200
HU
A_
HT
TP

16.7 ElevatorFloorCounter
_A
PI

setElevatorFloorInfo
fo

http://<server>/cgi-bin/ElevatorFloorCounter.cgi?action=setElevatorFloorInfo&CheckBas
r

URL
eFloor=<Second>&channel=<ChannelNo>
In

Method GET
te

Description
lb

[ Request Params ] (key=value format in URL)


Name Type R/O Param Description
ra

Channel int R ChannelNo,from 1, default 1


s

CheckBaseFloor string R Calibrate base floor, unit floor, It's not necessarily numbers
[ Response Params ] (key=value format )
Name Type R/O Param Description
[ Example ]
http://192.168.1.108/cgi-bin/ElevatorFloorCounter.cgi?action=setElevatorFloorInfo&Check
Request
BaseFloor=5&Channel=1
Response OK

16.7.1 getElevatorWorkInfo
http://<server>/cgi-bin/ElevatorFloorCounter.cgi?action=getElevatorWorkInfo&Channel=
URL
<ChannelNo>

Intelligent Building APIs 476


Method GET
Description
[ Request Params ] (key=value format in URL)
Name Type R/O Param Description
Channel int R ChannelNo,from 1, default 1
[ Response Params ] (key=value format )
Name Type R/O Param Description
Operation information, including the current floor, status, speed,
table object R
whether to calibrate
[ Example ]
http://192.168.1.108/cgi-bin/ElevatorFloorCounter.cgi?action=getElevatorWorkInfo&Chann
Request
el=1
table.ElevatorFloor=20
table.ElevatorWorkState=1
Response
table.ElevatorWorkSpeed=20
table.IsCheckFloor=true
DA
HU

16.7.2 getCaps
A_
HT

http://<server>/cgi-bin/ElevatorFloorCounter.cgi?action=getCaps&Channel=<ChannelNo
TP

URL
>
_A

Method GET
PI

Description
[ Request Params ] (key=value format in URL)
fo

Name Type R/O Param Description


r

Channel int R ChannelNo,from 1, default 1


[ Response Params ] (key=value format )
In

Name Type R/O Param Description


te

caps object R
lb

+IsElevatorFloor
bool R Whether the floor configuration function is supported
ra

Counter
[ Example ]
s

Request http://192.168.1.108/cgi-bin/ ElevatorFloorCounter.cgi?action=getCaps&channel=1


Response caps.IsElevatorFloorCounter=true

Intelligent Building APIs 477


17 DVR Custom APIs
17.1 File Finder

17.1.1 Create a File Finder

Table 17-1

http://<server>/cgi-bin/FileFindHelper.cgi?action=startFind&condition.channel=<Channe
lNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamType=<
Syntax
stream>[&condition.flags[0]=<flag>&condition.events[0]=<event>&combineMode.granu
larity=<granularityValue>&combineMode.types[0]=<combineType>]
DA

Method GET
Description Start to find files.
HU

Find a file in channel 1. Event type is "AlarmLocal" or "VideoMotion". Time lines between
A_

2014-1-1 12:00:00 and 2015-1-10 12:00:00. Combine "AlarmLocal" or "VideoMotion"


HT

files with granularity 16.


TP

URL is:
Example http://172.23.1.66/cgi-bin/fileFindHelper.cgi?action=startFind&condition.channel=1&con
_A

dition.startTime=2014-1-1%2012:00:00&condition.endTime=2015-1-10%2012:00:00&co
PI

ndition.streamType=Main&condition.flags[0]=Event&condition.events[0]=AlarmLocal&co
ndition.events[1]=VideoMotion&combineMode.granularity=16&combineMode.types[0]=A
fo

larmLocal&combineMode.types[0]=VideoMotion
r

Success
result=08137
In

Return
te

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.
lb

Parameters in URL:
ra

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


s

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
range of flag is {"Timing", "Marked", "Event", "Restrict"}. If omitted, find files with all the
flags.
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", "VideoLoss"}. This condition can be
omitted. If omitted, find files of all the events.
stream: which video stream type you want to find. The range of stream is {"Main",
"Extra1", "Extra2", "Extra3"}.
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:

DVR Custom APIs 478


File 1:
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

File 2:
items[0].Channel =1
items[0].StartTime =2011-1-1 13:00:00
items[0].EndTime =2011-1-1 14:00:00
items[0].Events[0]=AlarmLocal
items[0].VideoStream=Main
items[0].Length =790
DA

items[0].Duration = 3600
HU

file1 and file2 will be combined to file3


A_

File 3:
HT

items[0].Channel =1
TP

items[0].StartTime =2011-1-1 12:00:00


items[0].EndTime =2011-1-1 14:00:00
_A

items[0].Events[0]=AlarmLocal
PI

items[0].VideoStream=Main
items[0].Length =1580
fo

items[0].Duration = 7200
r
In

17.1.2 Create a Motion File Finder


te
lb

Table 17-2
ra

http://<server>/cgi-bin/FileFindHelper.cgi?action=startMotionFind&condition.channel=<C
s

hannelNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamT
Syntax ype=<stream>&motionRegion.senseLevel=<level>[&motionRegion.rects[rectNo][0]=<r
ect0>&motionRegion.rects[rectNo][1]=<rect1>&motionRegion.rects[rectNo][2]=<rect2>
&motionRegion.rects[rectNo][3]=<rect3>]
Method GET
Description Start to find motion files.
Find a file in channel 1, event type is "AlarmLocal" or "VideoMotion", and time between
2014-1-1 12:00:00 and 2015-1-10 12:00:00, motion region is [0,0,21,17]
URL is:
http://172.23.1.66/cgi-bin/fileFindHelper.cgi?action=startMotionFind&condition.channel=
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][

DVR Custom APIs 479


3]=17
Success
result=08137
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
range of flag is {"Timing", "Marked", "Event", "Restrict"}. If omitted, find files with all the
flags.
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
omitted, find files of all the events.
stream: which video stream type you want to find. The range of stream is {"Main",
"Extra1", "Extra2", "Extra3"}.
DA

level: the motion sensitive level, range is 0–6, 0 represent all level
HU

rectNo: the rects array index, start from 1


rect0 & rect1 & rect2 & rect3 : relative coordinates, rect0 and rect2 range is 0—21, rect1
A_

and rect3 range is 0—17. {0,0,0,0} top—left, {21,0,0,0} top—right, {0,17,0,0} bottom
HT

—left, {21,17,0,0} bottom—right


TP

17.1.3 Get the File Information Found by the Finder


_A
PI

Table 17-3
fo

http://<server>/cgi-bin/FileFindHelper.cgi?action=findNext&findId=<findId>&count=<fileCo
r

Syntax
unt>
In

Method GET
te

Descriptio
Find the next files no more than fileCount number.
n
lb

Example http://192.168.1.108/cgi-bin/FileFindHelper.cgi?action=findNext&findId=08137&count=100
ra

found=1
s

items[0].channel =1
items[0].startTime =2011-1-1 12:00:00
items[0].endTime =2011-1-1 13:00:00
Success
items[0].fileType =dav
Return
items[0].events[0]=AlarmLocal
items[0].streamType=Main
items[0].length =790
items[0].duration = 3600
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.

DVR Custom APIs 480


17.1.4 Stop the Finder

Table 17-4

Syntax http://<server>/cgi-bin/FileFindHelper.cgi?action=stopFind&findId=<findId>
Method GET
Description Stop the searching operation.
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.

17.1.5 Get Bound Files


DA

Table 17-5
HU

http://<server>/cgi-bin/FileFindHelper.cgi?action=getBoundFile&condition.channel=<Cha
A_

Syntax nnelNo>&condition.startTime=<start>&condition.endTime=<end>&condition.streamTyp
HT

e=<stream>[&condition.flags[0]=<flag>&condition.events[0]=<event>]
Method GET
TP

Description Get bound files.


_A

http://<server>/cgi-bin/FileFindHelper.cgi?action=getBoundFile&condition.channel=1&co
PI

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
fo

found=2
r

items[0].channel =1
In

items[0].startTime =2011-1-1 12:00:00


items[0].endTime =2011-1-1 13:00:00
te

items[0].flags [0]= Timing


lb

items[0].streamType=Main
ra

items[0].length =790
Success
s

items[0].duration = 3600
Return
items[1].channel =1
items[1].startTime =2011-1-1 13:00:00
items[1].endTime =2011-1-1 14:00:00
items[1].events[0]= Timing
items[1].streamType=Main
items[1].length =790
items[1].duration = 3600
Comment Params is same as FileFindHelper.startFind

DVR Custom APIs 481


17.2 BandLimit

17.2.1 Get Bandwidth Limit State

Table 17-6

Syntax http://<server>/cgi-bin/BandLimit.cgi?action=getLimitState
Method GET
Description Get bandwidth limit state.
Example http://192.168.1.108/cgi-bin/bandLimit.cgi?action=getLimitState
Success
limit=true
Return
Comment —

17.3 Record Files Protection


DA
HU

17.3.1 Add Protection


A_
HT

Table 17-7
TP

http://<server>/cgi-bin/FileManager.cgi?action=addConditionList&condition.Types[0]=<
_A

Syntax paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramValu
PI

e>&condition.Channel[0]=<paramValue>
Method GET
fo

Description Add protection or access control for record files.


r

http://192.168.1.108/cgi-bin/FileManager.cgi?action=addConditionList&condition.Types
In

[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
te

dition.Channel[1]=3
lb

Success
OK
ra

Return
s

In table below:
Comment TypeIndex: The index of type array
ChIndex: The index of channel number array

Appendix:

ParamName ParamValue type Description


An array. The range is {"RecordProtect",
condition.Type[TypeIndex] string
"RecordRestrict"}.
The time format is "Y-M-D H-m-S", example
condition.StartTime string
2011-7-3%2021:02:32
condition.EndTime string The time format is "Y-M-D H-m-S"
condition.Channel[ChIndex] integer Video channel index which starts from 1.

DVR Custom APIs 482


17.3.2 Cancel Protection

Table 17-8

http://<server>cgi-bin/FileManager.cgi?action=cancelConditionList&condition.Types[0]
Syntax =<paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramVa
lue>&condition.Channel[0]=<paramValue>
Method GET
Description Cancel protection of record files.
http://192.168.1.108/cgi-bin/FileManager.cgi?action=cancelConditionList&condition.Ty
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&
condition.Channel[1]=3
Success
OK
Return
Comment paramValue as Appendix above.
DA
HU

17.3.3 Remove Protection


A_
HT

Table 17-9
TP

http://<server>/cgi-bin/FileManager.cgi?action=removeConditionList&condition.Types[0
_A

Syntax ]=<paramValue>&condition.StartTime=<paramValue>&condition.EndTime=<paramV
PI

alue>&condition.Channel[0]=<paramValue>
Method GET
fo

Description Remove protection of record files.


r

http://192.168.1.108/cgi-bin/FileManager.cgi?action=removeConditionList&condition.Ty
In

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]=0&
te

condition.Channel[1]=3
lb

Success
OK
ra

Return
s

Comment paramValue as Appendix above.

17.3.4 DownloadFile
download file
Request URL http://<server>/cgi-bin/FileManager.cgi?action=downloadFile
Method GET
Request Params ( key=value format in URL )
Name Type R/O Description Example
fileName string R filename or path download.jp
g
Request Example
http://192.168.1.108/cgi-bin/FileManager.cgi?action=downloadFile&fileName=download.jpg

DVR Custom APIs 483


Response Params (multipart binary data )
Name Type R/O Description Example
Response Example
HTTP/1.1 200 OK
Content-type: text/plain;charset=utf-8
CONNECTION: close
Set-Cookie:secure; HttpOnly
CONTENT-LENGTH: <length>

<Binary Data>

17.3.5 UploadFile
Upload radar photos
DA

http://<server>/cgi-bin/FileManager.cgi?action=uploadFile&fileName=<FileName>&Pat
Request URL
h=<Path>
HU

Method POST
A_

Request Params ( key=value format in url )


HT

Name Type R/O Description Example


TP

File name, only the types bmp an


fileName string R "xxxxxx.bmp"
d jpg are available for radars.
_A

Path string R The file path to store /upload_pic


PI

Request Example
POST http://192.168.1.108/cgi-bin/FileManager.cgi?action=uploadFile&fileName=xxxxxx.bmp&fileLengt
fo

h=124879 HTTP/1.1
r

Host: 192.168.1.108
In

Connection: keep-alive
te

Content-Type: multipart/form-data;boundary=---------------------------8655433224198
Content-Length: xxxxxxxxx
lb
ra

-----------------------------8655433224198
s

Content-Disposition:form-data;name="upload"; filename="xxxxxx.bmp"
Content-Type: image/jpeg or application/x-MS-bmp

photo data….

-----------------------------8655433224198--

Response Params ( OK in body )


Parameter Type Required Description Example
Response Example
OK

DVR Custom APIs 484


17.4 Daylight

17.4.1 Get Daylight

Table 17-10

Syntax http://<server>/cgi-bin/global.cgi?action=getDST
Method GET
Description Get daylight saving time state.
Example http://192.168.1.108/cgi-bin/global.cgi?action=getDST
Success
result = 1
Return
Comment result: 1/0, yes or not in daylight saving time
DA
HU
A_
HT
TP
_A
PI
fo
r
In
te
lb
ra
s

DVR Custom APIs 485


18 Open Platform APIs
18.1 Open Platform

18.1.1 Application Start and Stop


 Start Application

Table 18-1

http://<server>/cgi-bin/installManager.cgi?action=start&appname=<appname>&appid=
Syntax
<appid>
Method GET
DA

Description Start application.


HU

http://192.168.1.108/cgi-bin/installManager.cgi?action=start&appname=FaceDemo&ap
Example
pid=1
A_

Success
HT

OK
Return
TP

Parameters in URL:
_A

Comment appname: the application name,


appid: optional, the application id
PI

 Stop Application
fo

Table 18-2
r
In

http://<server>/cgi-bin/installManager.cgi?action=stop&appname=<appname>&appid=
Syntax
<appid>
te

Method GET
lb

Description Stop application.


ra

http://192.168.1.108/cgi-bin/installManager.cgi?action=stop&appname=FaceDemo&ap
Example
s

pid=1
Success
OK
Return
Parameters in URL:
Comment appname: the application name,
appid: optional, the application id

18.1.2 Install Application


 Install application with app data

Table 18-3

URL http://<server>/cgi-bin/dhop.cgi?action=uploadApp
Method POST

Open Platform APIs 486


Description Install application.
[ Request Params ] (None)
[ Response Params ] ( OK )
[ 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>
Content-Disposition: form-data; name="dev_upgrade"; filename="demo.bin"
Content-Type: application/octet-stream

<app data>
--<boundary>--
Response OK
DA

 Install Application with app download url


HU

Table 18-4
A_
HT

URL http://<server>/cgi-bin/dhop.cgi?action=installAppByUrl
Method GET
TP

Description Install application.


_A

[ Request Params ] (key=value format in URL)


PI

Url string R The app download url


[ Response Params ] ( OK )
fo

[ Example ]
r

GET http://192.168.1.108/cgi-bin/dhop.cgi?action=installAppByUrl&Url=https://aaa/bbb/c
Request
In

cc/app.bin
Response OK
te
lb

18.1.3 Update Application and License


ra
s

 Update Application with app download url

Table 18-5

URL http://<server>/cgi-bin/dhop.cgi?action=updateAppByUrl
Method GET
Description Update Application
[ Request Params ] (key=value format in URL)
appName string R The app name
Url string R The app download url
[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/dhop.cgi?action=updateAppByUrl&appName=xxx&Url
Request
=https://aaa/bbb/ccc/app.bin

Open Platform APIs 487


Response OK
 Update firmware with firmware download url

Table 18-6

URL http://<server>/cgi-bin/dhop.cgi?action=updateFirmwareByUrl
Method GET
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
Response OK
 Update application license with license download url
DA

Table 18-7
HU
A_

URL http://<server>/cgi-bin/dhop.cgi?action=updateLicenseByUrl
Method GET
HT

Description Update application license.


TP

[ Request Params ] (key=value format in URL)


_A

appName string R The app name


PI

Url string R The license download url


[ Response Params ] ( OK )
fo

[ Example ]
r

GET http://192.168.1.108/cgi-bin/dhop.cgi?action=updateLicenseByUrl&appName=xxx&
Request
Url=https://aaa/bbb/ccc/license.bin
In

Response OK
te

 Update application license with license data


lb
ra

Table 18-8
s

URL http://<server>/cgi-bin/dhop.cgi?action=uploadLicense
Method POST
Description Update application license.
[ Request Params ] (key=value format in URL)
appName string R The app name
[ Response Params ] ( OK )
[ Example ]
POST /cgi-bin/dhop.cgi?action=uploadLicense&appName=xxx HTTP/1.1
Host: 172.29.2.176
Content-Type: application/octet-stream
Request
Content-Length: <length>

<app license data>


Response OK

Open Platform APIs 488


18.1.4 Uninstall Application
URL http://<server>/cgi-bin/dhop.cgi?action=uninstall
Method GET
Description Uninstall application.
[ Request Params ] (key=value format in URL)
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

18.1.5 Download Application Log


DA

URL http://<server>/cgi-bin/dhop.cgi?action=downloadLog
HU

Method GET
A_

Description Download application log.


[ Request Params ] (key=value format in URL)
HT

appName string R The app name


TP

[ Response Params ] ( log file content )


_A

[ Example ]
PI

Request GET http://192.168.1.108/cgi-bin/dhop.cgi?action=downloadLog&appName=xxx


HTTP/1.1 200 OK
fo

Server: Device/1.0
r

Content-Type: Application/octet-stream
Response
Content-Length: <length>
In
te

<log file data>


lb
ra
s

Open Platform APIs 489


19 Other APIs
19.1 Discover Devices

19.1.1 Discover Devices on Internet

Table 19-1

Syntax http://<server>/cgi-bin/deviceDiscovery.cgi?action=attach[&DeviceClass=<deviceClass>]
Method GET
DA

Description Discover devices on internet.


HU

Example http://192.168.1.108/cgi-bin/deviceDiscovery.cgi?action=attach&DeviceClass=VTO
A_

deviceInfo[index].AlarmInputChannels=8
HT

deviceInfo[index].AlarmOutputChannels=0
deviceInfo[index].DeviceClass=VTO
TP

deviceInfo[index].DeviceType=VTO2000A
_A

deviceInfo[index].HttpPort=80
PI

deviceInfo[index].IPv4Address.DefaultGateway=172.12.0.1
deviceInfo[index].IPv4Address.DhcpEnable=false
fo

deviceInfo[index].IPv4Address.IPAddress=172.12.7.102
r

deviceInfo[index].IPv4Address.SubnetMask=255.255.0.0
In

deviceInfo[index].IPv6Address.DefaultGateway=2008::1
Success
deviceInfo[index].IPv6Address.DhcpEnable=false
te

Return
deviceInfo[index].IPv6Address.IPAddress=2008::6/112
lb

deviceInfo[index].Mac=00:01:5b:01:44:77
ra

deviceInfo[index].MachineName=YZZ4DZ008D00031
deviceInfo[index].Port=37777
s

deviceInfo[index].RemoteVideoInputChannels=0
deviceInfo[index].SerialNo=YZZ4DZ008D00031
deviceInfo[index].Vendor=Multi
deviceInfo[index].Version=1.200.0.0
deviceInfo[index].VideoInputChannels=1
deviceInfo[index].VideoOutputChannels=16
Parameters in URL:
deviceClass: in range of {VTO, VTH, VTT, VTS, VTNC, SHG}
Comment Parameters in Response:
index: the array index which starts from 0.
Version: Software Version

Other APIs 490


19.2 positionManager

19.2.1 getStatus
Syntax http://<server>/cgi-bin/positionManager.cgi?action=getStatus
Method GET
Description Get gps info
Example http://192.168.1.108/cgi-bin/positionManager.cgi?action=getGPSStatus
Success status.Time=2011-07-03 21:02:32
Return status.Longitude=120.175556
status.Latitude=30.186389
status.Speed=30.00
status.Altitude=45.0
status.Bearing=45.3
status.SatelliteCount=11
DA

status.WorkStatus=1
HU

Comment Time:time, ex: 2012-01-04 23:30:30.


Longitude:Longitude, in degrees, positive East, negative West
A_

Latitude:Latitude, in degrees, positive north, negative South


HT

Speed:speed, unit: km/h


TP

Altitude:Altitude, unit: m
_A

Bearing:Direction angle,unit: degree


SatelliteCount:Satellite number
PI

WorkStatus:GPS working status,0= unlocated,1= un-differenced positioning,2=


differential positioning,3= invalid PPS,6= estimating
fo
r
In

19.3 GpsControl
te
lb

19.3.1 getCaps
ra
s

Get the capability of position system.


Syntax http://<ip>/cgi-bin/GpsControl.cgi?action=getCaps
Method GET
Description Get GpsControl caps.
Example http://192.168.1.108/cgi-bin/ GpsControl.cgi?action=getCaps
Success caps. SUPPORTMODE[0]=”GPS”
Return caps. SUPPORTMODE[1]=”BEIDOU”

19.3.2 GPS config


 getConfig of position system
Syntax http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=GPS

Other APIs 491


Method GET
Description Get the config of position system.
Example http://192.168.1.108/cgi-bin/global.cgi?action= getConfig&name=GPS
Success Table.GPS[0].Enable[0]=true
Return Table.GPS[1].Enable[1]=false
Table.GPS[0].CurMode[0]="GPS"
Table.GPS[1].CurMode[1]="BEIDOU"
Table.GPS[0].SyncTime[0]=true
Table.GPS[1].SyncTime[1]=false

 setConfig of position system.


Syntax http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[
&<paramName>=<paramValue>...]
Comment In below table, head =GPS

Success OK or ERROR
DA

Return
HU

Appendix:
A_

ParamName ParamVal Description


HT

ue type
TP

head.Enable bool true/false


_A

head.CurMode string "GPS"/"BEIDOU"


bool
PI

head.SyncTime true/false

19.4 LensFunc
fo
r

19.4.1 getCaps
In
te

URL http://<server>/cgi-bin/LensFunc.cgi?action=getCaps
lb

Method GET
ra

Description Get Caps


s

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
Channel uint R Video channel index which starts from 1.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
Caps object R The capacity.
+DepthField uint8 R Whether support depth field adjust, 0 : not support, 1 : support
+AngleAdjust object O The angel adjust capacity.
Whether support angel adjust, 0 : not support, 1 : only support
++Support uint8 R horizontal adjust, 2 : only support vertical adjust, 3 : support
both horizontal and vertical adjust.
++MaxVelocity uint8 R The max velocity, range from 1 to 8
[ Example ]
Request GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=getCaps&Channel=1

Other APIs 492


Caps.DepthField=1
Response Caps.AngelAdjust.Support=3
Caps.AngelAdjust.MaxVelocity=8

19.4.2 adjustAngleContinuously
URL http://<server>/cgi-bin/LensFunc.cgi?action=adjustAngleContinuously
Method GET
Description Adjust the angel continuously.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Channel uint R Video channel index which starts from 1.
The moving direction, 0 : negative X axis direction, 1 : positive
Direction uint8 R X axis direction, 2 : negative Y axis direction, 3 : positive Y axis
direction
DA

Velocity uint8 R The adjust velocity, range from 1 to MaxVelocity


HU

[ Response Params ] ( OK )
A_

[ Example ]
HT

GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=adjustAngleContinuously&Chan
Request
nel=1&Direction=2&Velocity=2
TP

Response OK
_A
PI

19.4.3 stopAdjustingAngle
fo
r

URL http://<server>/cgi-bin/LensFunc.cgi?action=stopAdjustingAngle
In

Method GET
Description Stop adjusting angel
te

[ Request Params ] ( key=value format at URL )


lb

Name Type R/O Param Description


ra

Channel uint R Video channel index which starts from 1.


s

[ Response Params ] ( OK )
[ Example ]
Request GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=stopAdjustingAngle&Channel=1
Response OK

19.4.4 adjustDepthField
URL http://<server>/cgi-bin/LensFunc.cgi?action=adjustDepthField
Method GET
Description Adjust depth position
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description

Other APIs 493


Channel uint R Video channel index which starts from 1.
DepthField float R The sensor depth position, range from 0 to 1, -1 means reset.
[ Response Params ] ( OK )
[ Example ]
GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=adjustDepthField&Channel=1&D
Request
epthField=0.3
Response OK

19.4.5 adjustDepthFieldContinuously
URL http://<server>/cgi-bin/LensFunc.cgi?action=adjustDepthFieldContinuously
Method GET
Description Adjust depth position continuously.
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
DA

Channel uint R Video channel index which starts from 1.


HU

The sensor depth position adjust velocity, range from -1 to 1,


DepthFieldSpee
A_

float R positive and negative value means difference direction, 0


d
HT

means stop adjust.


[ Response Params ] ( OK )
TP

[ Example ]
_A

GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=adjustDepthFieldContinuously&
Request
PI

Channel=1&DepthFieldSpeed=0.03
Response OK
fo
r
In

19.4.6 getDepthFieldStatus
te

URL http://<server>/cgi-bin/LensFunc.cgi?action=getDepthFieldStatus
lb

Method GET
ra

Description Get depth position status.


s

[ Request Params ] ( key=value format at URL )


Name Type R/O Param Description
Channel uint R Video channel index which starts from 1.
[ Response Params ] ( key=value format )
Name Type R/O Param Description
Status object R The depth position status.
The depth position status, “Normal” : normal status,
+Status string R
“AutoDepthField” : adjusting depth position.
+DepthField float R The sensor board relative position, range from 0 to 1
+DepthFieldStep
uint R The depth position total step.
s
The depth position reset result, only valid when reset.
+ResetResult string O
“Success” : reset success, ”Failed” : reset failed
[ Example ]

Other APIs 494


Request GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=getDepthFieldStatus&Channel=1
Status.Status=Normal
Status.DepthField=0.3
Response
Status.DepthFieldSteps=1000
Status.ResetResult=Success

19.4.7 autoAdjustDepthField
URL http://<server>/cgi-bin/LensFunc.cgi?action=autoAdjustDepthField
Method GET
Description Automatic adjust depth position
[ Request Params ] ( key=value format at URL )
Name Type R/O Param Description
Channel uint R Video channel index which starts from 1.
[ Response Params ] ( OK )
DA

[ Example ]
HU

GET http://192.168.1.108/cgi-bin/LensFunc.cgi?action=autoAdjustDepthField&Channel=
Request
A_

1
HT

Response OK
TP
_A

19.4.8 Scene Correction


PI
fo

Request URL http://<server>/cgi-bin/api/LensFunc/correctScene


r

Method POST
In

Request Params (JSON format in body)


Name Type R/O Description Example
te

Channel int R Channel number, starting 1


lb

from 1.
ra

Type enumint R Correction type. 1


s

enumint{
0: Automatic correction
1: Manual correction
}
Direction enumint O Rotation direction. This 1
parameter is only valid when
the correction method is
manual correction.
enumint{
0: Clockwise
1: Counter clockwise
}
Step int O Speed (range: 0–8). 5
0 means stop rotation.

Other APIs 495


When the rotation mode is
continuous rotation, it
means the rotation speed.
When the rotation mode is
point-based rotation, it
means the speed of each
rotation. This parameter is
only valid when the
correction mode is manual
correction.
Mode enumint O Rotation mode. This 1
parameter is only valid when
the correction mode is
manual correction.
enumint{
0: Continuous rotation
1: Point-based rotation
}
DA

Request Example
HU

{
"Channel": 1,
A_

"Type": 1,
HT

"Direction": 1,
TP

"Step": 5,
_A

"Mode": 1
}
PI
fo

19.5 LensManager
r
In

19.5.1 resetAngle
te
lb

 Reset camera lens angle


ra

URL http://< server >/cgi-bin/LensManager.cgi?action=resetAngle


s

Method GET

Description Reset camera lens angle

[ Request Params ] ( key=value format at URL )

Name Type R/O Param Description


Channel uint R Video channel index which starts from 1.

[ Response Params ] ( OK )

[ Example ]

Request http://172.27.1.153/cgi-bin/LensManager.cgi?action=resetAngle&Channel=1

Other APIs 496


Response OK

19.6 FishEye

19.6.1 Get FishEye Capability


The method described in the Section “4.5.12 Get video input capability” should be used first.In the
response, it will contain these message "caps.FishEye=false", if the value of the FishEye is true,
Then you can use the method described below to get the detail capability.

Table 19-2

http://<server>/cgi-bin/devVideoInput.cgi?action=getCapsEx&channel=<ChannelNo>&
Syntax
name=VideoInFishEye
DA

Method GET
HU

Description Get fisheye capability.


http://192.168.1.108/cgi-bin/devVideoInput.cgi?action=getCapsEx&channel=1&name=
A_

Example
VideoInFishEye
HT

caps.Type=Chip
TP

caps.MountMode[0]=WallMode
_A

caps.MountMode[1]=CeilMode
……
PI

caps.CalibrateMode[0]=Original
Success
caps.CalibrateMode[1]=Config
fo

Return
caps.CalibrateMode[2]=Panorama
r

……
In

caps.EPtzCmd[0]=Up
te

caps.EPtzCmd[1]=Down
…….
lb

Parameters in Response:
ra

Type: string, it can be Chip, Plugin, and ChipAndPlugin. Chip means only support
s

calibrate by device.
Plugin means only support calibrate by plugin. ChipAndPlugin means support
both.
MountMode: string and array.and MountMode means the install mode, it can be
Comment
WallMode,CeilMode, FloorMode,180CeilMode.
CalibrateMode: string and array. It can be Original, Config, Panorama,
DoublePanorama, OriginalPlusThreeEPtzRegion, Single, FourEPtzRegion,
TwoEPtzRegion, and Normal.
EPtzCmd: string and array. It can be ZoomIn, ZoomOut, Up, Down, Left, Right,
RotateClock, RotateAntiClock, Stop, TapView, and ShowRegion.

19.6.2 FishEye Setting


 Get FishEye config

Other APIs 497


Table 19-3

Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=FishEye
Method GET
Description Get FishEye config.
Example http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=FishEye
head.PlaceHolder=1
Success
head.CalibrateMode=Original
Return
……..
Parameters in Response:
head = table.FishEye[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).
PlaceHolder:integer, it can be 1(CeilMode), 2(WallMode), 3(FloorMode).
CalibrateMode: string. It can be Original, Config, Panorama, DoublePanorama,
OriginalPlusThreeEPtzRegion, Single, FourEPtzRegion, TwoEPtzRegion, and Normal.
DA

 Set FishEye config


HU

Table 19-4
A_
HT

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

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

Description Set FishEye config.


PI

Change the placeholder setting of channel 1:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].PlaceHol
fo

der=1
r
In

Change the calibratemode setting of channel 1:


http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FishEye[0].Calibrate
te

Example
Mode=Panorama
lb
ra

Also can use


s

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
calibratemode in one message.
Success
OK
Return
Comment —

19.7 Radar Adaptor

19.7.1 getCaps
Please use the interface getCapsEx.
 Radar equipment detection capability request
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getCaps&channel=< ChannelNo >

Other APIs 498


Method GET
Description Request radar device detection capabilities
Example 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
Return caps.DetectionAngle = 8003 //Zoom in 100 times
caps.DetectionHuman = 4000 //Zoom in 100 times
Comment Parameters in URL:
ChannelNo: integer, channel index which starts from 1.

19.7.2 getCapsEx
 Radar equipment caps request
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getCapsEx&channel=<ChannelNo>
Method GET
DA

Description Request radar device detection capabilities


HU

Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=getCapsEx&channel=1
A_

Success caps.DetectionRange = 5000 // Radar detection range


HT

Return caps.DetectionAngle = 8003 // Radar detection angle


caps.DetectionHuman = 4000 // Radar human detection range
TP

caps.Capacity.Support = true //Power setting enable


_A

caps.Capacity.List[0] = 150 // Power allows setting list, no more than 24 choices


PI

...
caps.Capacity.List[23] = 300
fo

caps.RadarScene.Support = true // Scene setting enable


r

caps.RadarChannel.Support = true // Radar channel setting enable


In

caps.RadarChannel.List[0] = 1 // Channel allows setting list, no more than 24 choices



te

caps.RadarChannel.List[23] = 2
lb

caps.MovedDetect.Support = true // Device motion detection setting enabled


ra

Comment Parameters in URL:


s

ChannelNo: integer, channel index which starts from 1.

19.7.3 getStatus
 Radar Equipment Status Request
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getStatus&channel=<ChannelNo>
Method GET
Description Request radar device status
Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=getCaps&channel=1
Success status.State = Normal
Return
Comment Parameters in URL:
ChannelNo: integer, channel index which starts from 1.

Other APIs 499


Appendix:

ParamName ParamValue type Description


State string Radar state, the range is { "Normal" , "Abnormal" }

19.7.4 calculateRealSize
 Radar real map size calculation
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=calculateRealSize&channel=<Channel
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
DA

Success realSize.realMap[0]=300
HU

Return realSize.realMap[1]=400
Comment Parameters in URL:
A_

ChannelNo: integer, channel index which starts from 1.


HT

Distance: Segment distance, Unit: m


TP

startPoint: Line segment start coordinates


_A

endPoint: Line segment end coordinates


PI

Appendix:
fo

ParamName ParamValue type Description


realMap array<integer> Length and width of actual map, unit:meter
r
In
te

19.7.5 attachAlarmPointInfo
lb
ra

 Radar track point request


s

Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=attachAlarmPointInfo&channel=<Chann
elNo>&[&heartbeat=<Heartbeat>]
Method GET
Description Request radar track points
[ 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
heartbeat int O every 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

Other APIs 500


60.
Example http://192.168.0.108/cgi-bin/radarAdaptor.cgi?action=attachAlarmPointInfo&channel=1&
heartbeat=5
Success HTTP/1.1 200 OK
Return Server: Device/1.0
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Connection: closed

--<boundary>
Content-Type: application/octet-stream
Content-Length: <length>

Channel=1
info[0].PointType=0x80
info[0].RegionNumber=1
info[0].ObjectType=1
DA

info[0].TrackID=1
HU

info[0].Distance=1001 //Zoom in 100 times, while the true value is 10.01


info[0].Angle=2010 //Zoom in 100 times
A_

info[0].Speed=501 //Zoom in 100 times


HT

……
TP

info[3].PointType=0x80
_A

……
PI

--<boundary>
Content-Type: text/plain
fo

Content-Length: 11
r
In

Heartbeat
te

-<boundary>
Content-Type: application/octet-stream
lb

Content-Length: <length>
ra
s

Channel=1
info[0].PointType=0x80
……

--<boundary>

Comment Parameters in URL:
ChannelNo: integer, channel index which starts from 1.

Notice:
A detach occurs when the connection is disconnected.

Other APIs 501


19.7.6 getLinkSDState
 Linked device status request
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=getLinkSDState&channel=<ChannelNo>
&ip[0]=<ip>&ip[1]=<ip>......&ip[23]=<ip>
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
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:
DA

ChannelNo: integer, channel index which starts from 1.


HU

ip: IP address of the linkage device


A_

Appendix:
HT

ParamName ParamValue type Description


TP

State integer device state, 0: out of time, 1: offline, 2: disconnected


_A
PI

19.7.7 manualLocate
fo
r

 Radar manual positioning request


In

Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=manualLocate&channel=<ChannelNo>&
te

point[0]=<x>&point[1]=<y>
lb

Method GET
Description Request manual radar positioning
ra

Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=manualLocate&channel=1&point[0]
s

=10&point[1]=10
Success OK
Return
Comment Parameters in URL:
ChannelNo: integer, channel index which starts from 1.
point: Pixel coordinates in the code stream

19.7.8 startRadarCalibration
 Radar equipment calibration
Syntax http://<server>/cgi-bin/radarAdaptor.cgi?action=startRadarCalibration&channel=<Chan
nelNo>&mode=<mode>&direction=<direction>&step=<step>

Other APIs 502


Method GET
Description Calibration of radar equipment
Example http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=startRadarCalibration&channel=1
&mode=1&direction=1&step=5
Success OK
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,
3:left, 4: right, 5: left_top, 6: right_top, 7: left_bottom, 8: right_bottom
step: step size

19.7.9 addRadarLinkSD
DA

 Radar link SD added


HU

Request URL http://<server>/cgi-bin/radarAdaptor.cgi?action=addRadarLinkSD


A_

Method GET
HT

Request Params ( key=value format in URL )


Name Type R/O Description Example
TP

Devices array<o 是 Add or update the added device login


_A

bject> information
PI

+PassWord char[32] 是 password, plaintext "admin123"


+UserName char[12 是 user name "admin"
fo

8]
r

+Port integer 是 port 5000


+SDLinkIP char[32] 是 device ip adress "192.168.1.108"
In

Channel integer 是 video channel, which starts from 1. 1


te

Request Example
lb

http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=addRadarLinkSD&Devices[0].SDLinkIP=10.11.17.
ra

98&Devices[0].Port=5000&Devices[0].Usename=admin&Devices[0].PassWord=admin123&Channel=1
s

Response Params ( key=value format in body )


Name Type R/O Description Example
SD object 是 dome camera
+Info object 是 information
++ErrorCode integer 是 errorcode 0
0:normal
1:overtime
2:Wrong user name or password
3:The device does not support linkage
Response Example
SD.Info.ErrorCode=0

Other APIs 503


19.7.10 delRadarLinkSD
 Remove radar link SD
Request URL http://<server>/cgi-bin/radarAdaptor.cgi?action=delRadarLinkSD
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
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
DA

http://192.168.1.108/cgi-bin/radarAdaptor.cgi?action=delRadarLinkSD&Devices[0].SDLinkIP=10.11.17.9
HU

8&Channel=1
A_

Response Params ( key=value format in body )


HT

Name Type R/O Description Example


TP

Response Example
_A

OK
PI

19.7.11 [Config]MapPara
fo
r

map para
Parameter Type Required Description Example
In

One-dimensional array, with one


te

MapPara object[] Yes


configuration for each video channel
lb

Configuration of radar position on the


+RadarCoordinate object Yes null
ra

map
++RadarDirectionAngle double Yes Configuration of radar direction (°) 70.5
s

++RadarPixelPoint integer Yes Pixel coordinates of radar on the map [10, 20]
+MapSize object Yes Configuration of map size null
Pixel coordinates of line segment in the [[10,10],
++PixelLine integer[][] Yes
image [20,20]]
The actual length represented by the
++Distance double Yes 10.1
line segment in the image (m)
Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=MapPara

Appendix: configuration operation method

configname and configobject in the following table correspond to specific configuration names and
configuration contents.
special explanation:
In the return of getConfig, there is a "table" level above the specific configuration.

Other APIs 504


In the request of setConfig, there is no "table" level above the specific configuration.
 getConfig
Syntax http://<server>/cgi-bin/configManager.cgi?action=getConfig&name=configName
Method GET
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

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
DA

table.MapPara[0].RadarCoordinate.RadarDirectionAngle=70.5
HU

table.MapPara[0].RadarCoordinate.RadarPixelPoint[0]=10
table.MapPara[0].RadarCoordinate.RadarPixelPoint[1]=20
A_

table.MapPara[0].MapSize.PixelLine[0][0]=10
HT

table.MapPara[0].MapSize.PixelLine[0][1]=10
TP

table.MapPara[0].MapSize.PixelLine[1][0]=20
table.MapPara[0].MapSize.PixelLine[1][1]=20
_A

table.MapPara[0].MapSize.Distance=10.1
PI

table.MapPara[1].RadarCoordinate.RadarDirectionAngle=70.5

fo
r

 setConfig
In

Syntax http://<server>/cgi-bin/configManager.cgi?action=setConfig
te

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

Name Type R/O Description Example


ra

configObject string R Specific configuration configObject


s

content
Request Example
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
arPixelPoint[1]=20&MapPara[0].MapSize.PixelLine[0][0]=10&MapPara[0].MapSize.PixelLine[0][1]=10&
MapPara[0].MapSize.Distance=10.1

Response Params ( OK in body )


Name Type R/O Description Example
Response Example
OK

Other APIs 505


19.7.12 [Config]RadarAnalyseRule
RadarAnalyseRule
Requi
Parameter Type Description Example
red
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.
+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
DA

the Detail.Code field in the log.


HU

[["1
A_

00:00:00-23:59:59",
"0
HT

Alarm period. For the definition of alarm


00:00:00-23:59:59",
TP

period, see Dahua Information Exchange


"0
Format.
_A

00:00:00-23:59:59",
++TimeSectio TimeSect TimeSection is used for the filtering of notify
PI

Yes "0
n ion[][] action. No data is sent if it is not within the
00:00:00-23:59:59",
period.
fo

"0
All fields except this one are used for
00:00:00-23:59:59",
r

listener response.
"0
In

00:00:00-23:59:59",]
te

]
lb

List of snapshot channel numbers.


One-dimensional array. Each member
ra

++SnapshotC
int[] Yes indicates that the corresponding channel [0]
s

hannels
needs to take snapshot, and the channel
number starts from 0.
++SnapshotE
bool Yes Enable snapshotg false
nable
++RecordLat Record delay time (second)
integer Yes 10
ch Range [10, 300]
List of record channel numbers.
One-dimensional array. Each member
++RecordCha
int[] Yes indicates that the corresponding channel [0]
nnels
needs to record, and the channel number
starts from 0.
Record enabling, with RecordChannels.
++RecordEna
bool Yes Record is enabled if it is true; start false
ble
recording when the event action is start and

Other APIs 506


stop recording when it is stop. Record is not
enabled if it is false.
++VoiceEnabl
bool Yes Voice prompt false
e
++BeepEnabl
bool Yes Buzzer false
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
Output delay time (second) after the alarm
++AlarmOutL
integer Yes output stops. 10
atch
Range [10, 300]
++AlarmOutE
bool Yes Enable alarm output false
nable
List of alarm output channel numbers.
DA

One-dimensional array. Each member


++AlarmOutC
int[] Yes indicates that the corresponding channel [0]
HU

hannels
needs to output alarm, and the channel
A_

number starts from 0.


HT

+Enable bool Yes Enable alarm enabling false


TP

+AlarmOutNu Alarm configuration number, which is


integer Yes 1
mber unique.
_A

Controlled device IP (which is optional and


PI

+SDLinkIP char[32] No reserved. Ignore this field due to business "192.168.1.108"


adjustment).
fo

Example
r

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarAnalyseRule
In

Note:
te

Please refer to appendix in chapter 15.6.11 for configuration operation method


lb
ra

19.7.13 [Config]RadarCalibration
s

RadarCalibration
Parameter Type Required Description Example
Configuration of radar and PTZ
cameras calibration.
RadarCalibration object[] Yes One-dimensional array, with one
configuration for each video
channel.
+SlopeAngle double Yes Slope compensation angle. 10.0
+InstallHeight double Yes Radar installation height (m). 10.5
+CalibrationParas object[] Yes Calibration parameter. null
Vertical compensation angle of
++TiltRecoupAngle double Yes linked PTZ camera. 5.0
The range is -90° to 90°; 0° in the

Other APIs 507


horizontal direction; 0 to 90°
below the horizontal direction;
-90° to 0° above the horizontal
direction.
Installation height of linked PTZ
++LinkSDHeight double Yes 10.5
camera (m).
++CalibrationPos object[] Yes Array of calibration points. null
PTZ value (normalized value) of
calibration points.
The first element is the horizontal
angle, which is normalized to -1 to
1.
+++Ptz float[3] Yes The second element is the [0.95, 0.43, 0.12]
vertical angle, which is
normalized to -1 to 1.
The third element is the zoom
DA

times, which is normalized to 0 to


1.
HU

Pixel coordinates of calibration


A_

+++AlarmPixelPoint int[2] Yes [10, 20]


points.
HT

++SDLinkIP char[32] Yes Controlled device IP. "192.168.1.108"


TP

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

Note:
PI

Please refer to appendix in chapter 15.6.11 for configuration operation method


fo
r

19.7.14 [Config]RadarGuardLine
In

RadarGuardLine
te

Parameter Type Required Description Example


lb

Two-dimensional array. The


ra

first dimension indicates video


s

RadarGuardLine object[][10] Yes channel, and the second


dimension indicates multiple
rule lines (up to 10).
Alarm output configuration.
Configure the
+AlarmOutNumber integer Yes AlarmOutNumber field 1
according to
RadarAnalyseRule.
Target filtering
bit0: Reserved
bit1: Human.
+TargetFilter integer Yes 0x01
bit2: Vehicle.
bit3: Animal
(Enable by setting it to 1)

Other APIs 508


Rule point, pixel coordinates
[width, height]. [[0, 0], [128,
+Polygon integer Yes
Range of number of points [3, 128],…,[]]
24]
Rule type, alarm or shield type.
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]
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:
DA

Please refer to appendix in chapter 15.6.11 for configuration operation method


HU
A_

19.7.15 [Config]RadarLink
HT
TP

RadarLink
Parameter Type Required Description Example
_A

One-dimensional array, with one configuration for each


PI

RadarLink object[] Yes


video channel
+RadarLink bool Yes Enable radar-PTZ linkage true
fo

Example
r

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name= RadarLink
In

Note:
te

Please refer to appendix in chapter 15.6.11 for configuration operation method


lb
ra

19.7.16 [Config]RadarLinkDevice
s

RadarLinkDevice
Parameter Type Required Description Example
Remote device linkage
configuration.
object[][24]
Two-dimensional array. The
RadarLinkDevice object[][] Yes
first dimension indicates video
channel, and the second
dimension indicates multiple
remote linkage devices.
+DeviceName char[128] Yes Device name "Dahua North Gate"
+DeviceType char[32] Yes Device type "200W PTZ camera"
+Vendor char[32] Yes Device source "DH"

Other APIs 509


+SDLinkIP char[32] Yes Controlled device IP "192.168.1.108"
Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarLinkDevice
Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method

19.7.17 [Config]RadarPara
RadarPara
Parameter Type Required Description Example
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
DA

range is -5 to 5; 0 is the default value; the


++Level integer No smaller the value, the higher the human 0
HU

recognition rate; the larger the value, the higher


A_

the vehicle recognition rate.


HT

+TargetRatio object Yes Tracking screen ratio for radar-PTZ linkage. null
TP

Reciprocal of screen ratio.


Required. Calculate the reciprocal. For
_A

++Ratio integer Yes 1


example, when the screen ratio is 0.5, Ratio =
PI

2; when the screen ratio is 0.25, Ratio = 4.


+RadarChannel object Yes Radar channel configuration. null
fo

Channel selection.
r

++Route integer Yes 1: Channel 1 1


In

2: Channel 2
te

+Capacity object Yes Configuration of radar transmitting power. null


Radar transmitting power is measured by
lb

++Power integer Yes 300


detection distance (m).
ra

+Structured object Yes Structured information configuration null


s

++TrackDisplayTime integer No Range [1, 30] (s). 5


++TrackType integer No 0: Disable 1: Trajectory box 2: Trajectory 0
++Enable bool Yes Enable structured information display false
+Scene object Yes Scene configuration null
Scene selection.
1: Default.
++Type integer Yes 2: Shrub. 1
3: Spacious.
4: Custom.
Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarPara
Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method

Other APIs 510


19.7.18 [Config]RadarTrackGlobal
RadarTrackGlobal
Parameter Type Required Description Example
One-dimensional array, with one
RadarTrackGlobal object[] Yes configuration for each video
channel
Tracking switching mode
Tour/time priority/distance priority
+TrackSwitchMode char[32] Yes "Rotation"
Rotation/TimePriority/DistancePri
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
DA

Example
HU

http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RadarTrackGlobal
A_

Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method
HT
TP
_A

19.7.19 [Config]RemoteSDLink
PI

RemoteSDLink
fo

Parameter Type Required Description Example


r

Remote device linkage enabling


configuration.
In

Two-dimensional array. The first


RemoteSDLink object[][24] Yes
te

dimension indicates video channel, and


lb

the second dimension indicates multiple


remote linkage devices.
ra

+RadarLink bool Yes Enable linkage. true


s

+SDLinkIP char[32] Yes Controlled device IP. "192.168.1.108"


Example
http://192.168.1.108/cgi-bin/configManager.cgi?action=getConfig&name=RemoteSDLink
Note:
Please refer to appendix in chapter 15.6.11 for configuration operation method

19.8 Advertisement

19.8.1 Getting Ad Placement Capability


Get advertisement placement capability. For access control device.

Other APIs 511


19.8.1.1 Request
Syntax http://<server>/cgi-bin/VideoOutput.cgi?action=getAdvertisementCaps
Method GET
Parameter
key=value format at URL
Format
Parameter Type Required Description Example
params object No
Example
http://<server>/cgi-bin/VideoOutput.cgi?action=getAdvertisementCaps

19.8.1.2 Response
Parameter
key=value format at URL
Format
Parameter Type Required Description Example
DA

Supports Ad placements or
Support bool Yes true
HU

not
A_

Set of advertising file


storage types; array, up to
HT

16 types
TP

Enumchar[32]
_A

{
PI

"Local": The device directly


gets the file from the local
fo

storage path (The platform


can upload this file through
r

FileManager.uploadFile to
In

the local path of the device).


te

FileStorageType array/array<> Yes "FTP": Advertising files are "Local","FTP","HTTP"


lb

stored on the FTP server and


need to be downloaded by
ra

the device from the FTP


s

server (This type was used


for intelligent building
products).
"HTTP": The device
downloads the file through
the http URL provided by
the cloud platform.
}
This exists when
LocalStorage object No FileStorageType has the
Local type.
Local path of the device
+Path string Yes where advertising files are "/mnt/mtd/PublishInfo"
stored. The client uploads

Other APIs 512


advertising files to the local
path of the device; for
example, when uploading
through the
FileManager.uploadFile.Path
field, enter this field (up to
256 characters).
Format capabilities
corresponding to the video
Video object No
file contained in the
advertising video file.
Supports playing
+Support bool Yes true
advertisement videos or not.
Set of encoding formats
supported by the device;
array, up to 16 formats
DA

Enumchar[32]
HU

{
“H264”: H264 format
A_

"H264Private": H264
HT

+StreamType int Yes encoded dav video "H264Private","H265Private"


TP

“H265”:H265 format
_A

"H265Private":H265
encoded dav video
PI

"MPEG4": MPEG4 encoding


"MPEG4Private": MPEG4
fo

encoded dav format


r

}
In

Minimum pixels of video


+MinWidth int Yes 50
te

width.
Maximum pixels of video
lb

+MaxWidth int Yes 800


width.
ra

Minimum pixels of video


+MinHeight int Yes 50
s

height.
Maximum pixels of video
+MaxHeight int Yes 1280
height.
Capabilities corresponding
Audio object No to the audio file contained in
the advertising file.
Supports playing
+Support bool Yes true
advertisement audios or not.
List of supported audio
decoding formats;
the array with up to 64
+Formats array/array<> Yes
returns. Each member
represents a combination of
decoding parameters.

Other APIs 513


Audio compression format
enumchar[32]{
/* PCM format with header
*/
++Compression string Yes "PCM" "PCM"
"G.711A"
"G.711Mu"
"AAC"
}
Audio sampling frequency;
value range: 8 K–192 K; for
++Frequency int Yes 16000
example, 16000 indicates
16K.
Sampling depth
enumint{
8,
++Depth int Yes 16
DA

16,
HU

24,
}
A_

Packaging cycle, in ms;


HT

++PacketPeriod int Yes 40


value range: [10, 250]
TP

Size of a single audio or


OneAVFileMaxSize int Yes 102400
_A

video advertising file, in KB.


Maximum number of audio
PI

MaxAVFileNums int Yes or video advertising files 5


fo

supported.
Format capabilities
r

corresponding to the image


In

Pictrue object Yes


file contained in the
te

advertising file.
lb

Supports playing
+Support int Yes advertisement images or true
ra

not.
s

Set of encoding format


capabilities of the image
advertising file; array, up to
16 formats
Enumchar[32]
+Types array/array<> Yes { "PNG","JPG","BMP"
"PNG": Image in PNG format
"JPG": Image in JPG format
"BMP": Image in BMP
format
}
Minimum pixels of image
+MinWidth int Yes
width.
+MaxWidth int Yes Maximum pixels of image

Other APIs 514


width.
Minimum pixels of image
+MinHeight int Yes
height.
Maximum pixels of image
+MaxHeight int Yes
height.
Maximum size of a single
+OnePicMaxSize int Yes
image file, in KB.
Maximum number of images
+MaxPicNums int Yes
supported.
Example
Support=true,
FileStorageType=Local,FTP,HTTP
LocalStorage.Path="/mnt/mtd/PublishInfo"
Video.Support=true
Video.StreamType="H264Private","H265Private"
Video.MinWidth=50
DA

Video.MaxWidth=800
HU

Video.MinHeight=50
Video.MaxHeight=1280
A_

Audio.Support=true
HT

Audio.Formats[0u].Compression="PCM"
TP

Audio.Formats[0u].Frequency=16000
_A

Audio.Formats[0u].Depth=16
Audio.Formats[0u].PacketPeriod=40
PI

OneAVFileMaxSize=102400
fo

MaxAVFileNums=5
Pictrue.Support=true
r

Pictrue.Types="PNG","JPG","BMP"
In

Pictrue.MinWidth=50
te

Pictrue.MaxWidth=800
Pictrue.MinHeight=50
lb

Pictrue.MaxHeight=1280
ra

Pictrue.OnePicMaxSize=100
s

Pictrue.MaxPicNums=50

19.8.2 Acquiring Advertisement Resource List


CGI command of VideoOutput.list protocol: Acquiring advertisement resource list.

19.8.2.1 Request
Syntax http://<server>/cgi-bin/VideoOutput.cgi?action=list&path=/mnt/dvr/sda0/2010/8/11/dav
Method GET
Parameter Format key=value format at URL

Other APIs 515


Parameter Type Required Description Example
path char[260] Yes Acquire path "/mnt/dvr/sda0/2010/8/11/dav"
Complete Example
http://<server>/cgi-bin/VideoOutput.cgi?action=list&path=/mnt/dvr/sda0/2010/8/11/dav

19.8.2.2 Response
Parameter key=value format at URL
Format
Parameter Type Required Description Example
elementInfo object[] No File element
information.
+type enumchar[ No File element type. "File"
16] enumchar[16]
{ "File": file
"Directory":
DA

Directory}
HU

+file object No File information


A_

(valid when Type=


“File”).
HT

++FileType char[64] No File type. " Video"


TP

enumchar[16]{
_A

"Video": Video file


PI

"Image": Image file


"Audio": Audio file
fo

}
++CreateTim char[20] No Creation time "2010-4-15 9:58:32"
r

e
In

++ModifyTim char[20] No Modification time "2010-4-15 9:58:32"


te

e
lb

++Size double No File size. The decimal 1873.0


part is meaningless.
ra

Unit: Byte.
s

++path char[260] No Absolute path. "/mnt/dvr/sda0/2010/8/11/d


av.jpg"
++Desc char[128] No Customized file "xxxxxxx"
description.
+directory object No Directory
information (valid
when Type =
“Directory”).
++CreateTim char[20] No Creation time. "2010-4-15 9:58:32"
e Format: “Y-M-D
H-M-S”.
++path char[260] No Absolute path. "/mnt/dvr/sda0/2010/8/11/d
av"

Other APIs 516


Complete Example
elementInfo[0].type=File
elementInfo[0].file.FileType=Video
elementInfo[0].file.CreateTime=2010-4-15 9:58:32
elementInfo[0].file.ModifyTime=2010-4-15 9:58:32
elementInfo[0].file.Size=1873.0
elementInfo[0].file.path=mnt/dvr/sda0/2010/8/11/dav.jpg
elementInfo[0].file.Desc=xxxxxxx
elementInfo[0].directory.CreateTime=2010-4-15 9:58:32
elementInfo[0].directory.path=/mnt/dvr/sda0/2010/8/11/dav

elementInfo[1].type=File
elementInfo[1].file.FileType=Wireshark/tcpdump
elementInfo[1].file.CreateTime=2010-4-15 9:58:32
elementInfo[1].file.ModifyTime=2010-4-15 9:58:32
elementInfo[1].file.Size=1873.0
DA

elementInfo[1].file.path=mnt/dvr/sda0/2010/8/11/dav.jpg
HU

elementInfo[1].file.Desc=xxxxxxx
elementInfo[1].directory.CreateTime=2010-4-15 9:58:32
A_

elementInfo[1].directory.path=/mnt/dvr/sda0/2010/8/11/dav
HT


TP
_A

19.8.3 Deleting Advertisement Files


PI

Advertisement resource deletion interface


fo
r

19.8.3.1 Request
In

Syntax http://<server>/cgi-bin/VideoOutput.cgi?action=removeFiles&fileName[0]=a.dav
te

Method GET
lb

Parameter Format key=value format at URL


ra

Parameter Type Required Description Example


s

fileName char[32][128] Yes File name ["a.dav", "b.dav" ]


Complete Example
http://<server>/cgi-bin/VideoOutput.cgi?action=removeFiles&fileName[0]=a.dav

19.8.4 Sending Advertisement Resources

Call VideoOutput.deliveryFileEx component interface internally.

19.8.4.1 Request
Syntax http://<server>/cgi-bin/VideoOutput.cgi?action=deliveryFile
Method POST
Parameter key=value format at URL

Other APIs 517


Format
Parameter Type Required Description Example
Port int No Video output port. The value 0
represents the array index of
the VideoOut configuration.
Number int No The current advertisement 0
plan number. The caller can
use this number to set up
different advertisement plans.
TimeSection TimeSched No Advertisement playing [ ["1
ule period. It is a two-dimensional 00:00:00-07:00:00",
array in which the first seven "2
elements correspond to seven 09:00:00-17:30:00",
days of a week, and the "3
eighth element corresponds 17:30:00-23:59:59" ],
to holidays, with a maximum …, [ ], ]
DA

of six periods per day. The


HU

eighth element can be left


blank or entered as null,
A_

indicating that the holiday


HT

period is not supported.


TP

Enable bool No Enable play function. true


_A

StartTime: char[20] No Start time "2016-08-10


10:00:00"
PI

Name char[128] No Advertisement name “Happly holliday”


fo

EndTime: char[20] No End time. It is meaning only "2016-08-10


for loop video play. 12:00:00"
r

Mode char[16] No Video play mode. "Once"


In

Once: Each file in the list is


te

played once.
lb

Repeat: Files in the list are


played repeatedly until end
ra

time.
s

Alone: Cut-in play (playing


alone).
Type char[16] No Operation type. If the field "Replace"
does not exist, it is Replace by
default.
Replace: After it is cleared,
the advertisement will be
sending again.
Add: Add advertisement
resources.
Remove: Remove
advertisement resources.
Operate according to the ID
field of FileList..

Other APIs 518


Clear: Clear all advertisement
resources.
FileList object[] No Video file list
+FileType enumchar[ No File type. "Video"
16] enumchar[16]{
"Video": Video file
"Image": Image file
"Audio": Audio file
}
+PlayWithM int No It is 1 by default. File mode: 1
ode 1: Recognition mode.
2: Information release mode.
3: Home page mode.
The file can only be played in
the corresponding working
mode. The recognition mode
DA

is the standard function of the


HU

program, which will


automatically preform object
A_

recognition when detecting a


HT

object. The information


TP

release mode requires


_A

human-device interaction
before recognition.
PI

URL char[128] No The resource address of the "ftp://192.168.1.108/


file. 1.dav"
fo

+URLEx char[512] No File extension resource "http://10.35.81.187:


r

address: The original URL field 89


In

is too short and not enough 27/1952fdd7-48e8-11


te

for the supporting ICC e


platform (currently it has b-b015-08eded28a3
lb

reached 160 bytes), which 44 /20210


ra

needs to be increased. The 315/1/cdce2e98-855


s

maximum length of URLEx is d-11eb- ac3f-08


512 bytes. Compatibility eded28 a344.jpg?
logic of platform: When the token=
Support field of the device fe65ac56-ff42-4597-
capability interface 80f4-
VideoOutput.getAdvertiseme 33e571deab22"
ntCaps returns true, the real
download address is filled in
the URLEx field, and the URL
field is filled with an empty
string. Compatibility logic of
device: If the URL is not an
empty string, the URL is used
directly; only when the URL

Other APIs 519


field is an empty string and
URLEx is not an empty string,
the URLEx field is used.
+Sustain int No Stay time of each Image, 5
which is valid only when
FileType is Image. Unit:
Second.
+TimeSectio TimeSched No (The new advertisement [ ["1
n ule program might not be 00:00:00-07:00:00",
implemented) Play period. It "1
is a two-dimensional array in 09:00:00-17:30:00",
which the first seven "1
elements correspond to seven 17:30:00-23:59:59" ],
days of a week, and the …, [ ], ]
eighth element corresponds
to holidays, with a maximum
DA

of six periods per day. The


HU

eighth element can be left


blank or entered as null,
A_

indicating that the holiday


HT

period is not supported.


TP

+Size int No Files size. Unit: Byte. It is 102400


_A

convenient to verify whether


the file can be downloaded
PI

successfully before
downloading. The actual
fo

download might fail, because


r

the space limit of the device


In

folder (used to save


te

advertisements) has been


reached If there is no such
lb

field, no verification is
ra

performed.
s

+ID int32 No File number. 3


Complete Example
POST http://192.168.1.108/cgi-bin/VideoOutput.cgi?action=deliveryFile
{
"Port" : 0,
"Number" : 0
"TimeSection": [
["1 00:00:00-07:00:00",
"1 09:00:00-17:30:00",
"1 17:30:00-23:59:59"
], …, [ ],
],
"Enable" : true,
"StartTime" : "2016-08-10 10:00:00",

Other APIs 520


"EndTime" : "2016-08-10 12:00:00",
"Mode" : "Once",
"FileList" : [{
"FileType" : "Video",
"URL" : "ftp://192.168.1.108/1.dav",
"Sustain" : 5
"Size": 102400,
"ID": 3
}, {}]
}

19.8.5 Changing Stay Time of Advertisement Image

Change the stay time of advertisement image.


DA

19.8.5.1 Request
HU

Syntax http://<server>/cgi-bin/VideoOutput.cgi?action=changeSustain&Sustain=5
A_

Method GET
HT

Parameter Format key=value format at URL


TP

Parameter Type Required Description Example


Sustain int Yes Stay time of each Image. 5
_A

Complete Example
PI

http://<server>/cgi-bin/VideoOutput.cgi?action=changeSustain&Sustain=5
fo

19.8.6 Acquiring Video and Image Files Played by the Device


r
In

Acquire video and image files played by the device.


te
lb

19.8.6.1 Request
ra

Syntax http://<server>/cgi-bin/VideoOutput.cgi?action=queryDeliveredFile
s

Method GET
Parameter Format key=value format at URL
Parameter Type Required Description Example
Complete Example
http://<server>/cgi-bin/VideoOutput.cgi?action=queryDeliveredFile

19.8.6.2 Response
Parameter key=value format at URL
Format
Parameter Type Required Description Example
params object[] Yes All play information
+Enable bool No Enable play function. true

Other APIs 521


+Number int Yes The current 0
advertisement plan
number. The caller
can use this number
to set up different
advertisement plans.
+TimeSectio TimeSchedu Yes Advertisement [ ["1 00:00:00-07:00:00", "2
n le playing period. It is a 09:00:00-17:30:00", "3
two-dimensional 17:30:00-23:59:59" ], …, [ ], ]
array in which the
first seven elements
correspond to seven
days of a week, and
the eighth element
corresponds to
holidays, with a
DA

maximum of six
HU

periods per day. The


eighth element can
A_

be left blank or
HT

entered as null,
TP

indicating that the


_A

holiday period is not


supported.
PI

+Name char[128] No Advertisement name “Happly holliday”


+StartTime: char[20] No Start time "2016-08-10 10:00:00"
fo

+EndTime: char[20] No End time "2016-08-10 12:00:00"


r

+Mode char[16] No Video play mode. "Once"


In

Once: Each file in the


te

list is played once.


Repeat: Files in the
lb

list are played


ra

repeatedly until end


s

time.
Alone: Cut-in play
(playing alone).
+FileList object[] No Video file list. Up to 20 file lists are
supported.
++Download bool No Check whether the true
ed file has been
downloaded to the
device.
++FileType enumchar[1 No File type. "Video"
6] enumchar[16]{
"Video": Video file
"Image": Image file
"Audio": Audio file

Other APIs 522


}
++LocalPath char[128] No The path where the "/mnt/appdata/Publish/1.da
file is downloaded to v"
the device.
++Sustain int No Stay time of each 5
Image, which is valid
only when FileType is
Image. Unit: Second.
++URL char[512] No The resource address "ftp://192.168.1.108/1.dav"
of the file, and the
maximum length is
512 bytes. It has the
same length as the
VideoOutput.delivery
File interface (used by
video intercom and
DA

delivered at the same


HU

time).
++TimeSecti TimeSchedu No Advertisement [ ["1 00:00:00-07:00:00", "1
A_

on le playing period. It is a 09:00:00-17:30:00", "1


HT

two-dimensional 17:30:00-23:59:59" ], …, [ ], ]
TP

array in which the


_A

first seven elements


correspond to seven
PI

days of a week, and


the eighth element
fo

corresponds to
r

holidays, with a
In

maximum of six
te

periods per day. The


eighth element can
lb

be left blank or
ra

entered as null,
s

indicating that the


holiday period is not
supported.
++Size int No Files size. Unit: Byte. 102400
++ID int No File number. 3
Complete Example
params[0].Enable=true
params[0].Number=0
params[0].TimeSection[0][0]=6 00:00:00-23:59:59
params[0].TimeSection[0][1]=0 00:00:00-23:59:59
params[0].TimeSection[0][2]=0 00:00:00-23:59:59
params[0].TimeSection[0][3]=0 00:00:00-23:59:59
params[0].TimeSection[0][4]=0 00:00:00-23:59:59
params[0].TimeSection[0][5]=0 00:00:00-23:59:59

Other APIs 523


params[0].TimeSection[1][0]=6 00:00:00-23:59:59
params[0].TimeSection[1][1]=0 00:00:00-23:59:59
params[0].TimeSection[1][2]=0 00:00:00-23:59:59
params[0].TimeSection[1][3]=0 00:00:00-23:59:59
params[0].TimeSection[1][4]=0 00:00:00-23:59:59
params[0].TimeSection[1][5]=0 00:00:00-23:59:59

params[0].Name="十一快乐"
params[0].StartTime="2016-08-10 10:00:00"
params[0].EndTime="2016-08-10 12:00:00"
params[0].Mode="Once"
params[0].FileList.Downloaded=true
params[0].FileList.FileType="Video"
params[0].FileList.LocalPath="/mnt/appdata/Publish/1.dav"
params[0].FileList.Sustain=5
params[0].FileList.URL="ftp://192.168.1.108/1.dav"
DA

params[0].FileList.Size=102400
params[0].FileList.ID=3
HU

...
A_
HT
TP

19.9 Water Quality Detection


_A
PI

19.9.1 Report Search


fo
r

19.9.1.1 Start Searching Reports


In
te

Searching for water quality reports.


Request URL http://<server>/cgi-bin/api/WaterDataStatServer/startFind
lb

Method POST
ra

Request Params ( JSON format in body )


s

Name Type R/O Description Example


condition Object O Search conditions of
water quality detection
+StartTime char[20] O Start time (temporarily "5/25/2010 00:00:00"
accurate to the hour)
+Type enumchar[ O enumchar[32][32]{ ["PH"," NTU"]
32][32] "Quality": Water quality
category
"PH": pH value
“NTU": Turbidity value
"NH3-N": Ammonia
nitrogen value
}
+PresetID int[] O Preset [1]

Other APIs 524


((one-dimensional array)
+EndTime char[20] O End time (temporarily "2010-05-25 00:00:00"
accurate to the hour)
Request Example
{
"condition": {
"StartTime": "2010-05-25 00:00:00",
"Type": ["PH"," NTU"],
"PresetID": [1],
"EndTime": "2010-05-25 00:00:00"
}
}

Response Params ( JSON format in body )


Name Type R/O Description Example
token uint32 O Obtained search token 2342343
DA

totalCount uint32 O Total number of qualified 233


results
HU

Response Example
A_

{
HT

"token": 2342343,
TP

"totalCount": 233
}
_A
PI

19.9.1.2 Acquiring Search Results


fo

Searching for water quality reports.


r

Request URL http://<server>/cgi-bin/api/WaterDataStatServer/doFind


In

Method POST
te

Request Params ( JSON format in body )


Name Type R/O Description Example
lb

token uint32 O Search token 46878


ra

beginNumber uint32 O Starting sequence 0


s

number of the search. It


means that the search
starts from the
beginNumber records,
and returns count
records. 0 ≤
beginNumber ≤
totalCount-1.
count int32 O Number of traffic 24
statistics for each
search
Request Example
{
"token": 46878,

Other APIs 525


"beginNumber": 0,
"count": 24
}

Response Params ( JSON format in body )


Name Type R/O Description Example
found uint32 O Number of searched 12
entries
info object[] O Traffic statistics. It is an
array and each element
represents a traffic
record that satisfies the
condition.
+StartTime char[20] O Start time 2018-03-03 00:00:00",
+Quality enumint O enumint { 1
1: I Category
2: II Category
DA

3: III Category
4: IV Category
HU

5: V Category
A_

}
+PH float O pH (1–14) 5.5
HT

+NTU float O Turbidity (0–500 NTU) 250.0


TP

+NH3-N float O Ammonia nitrogen (0– 25.0


_A

50 mg/L)
PI

+TN float O Total nitrogen (0–50 25.0


mg/L)
fo

+SD float O Transparency (0–30 m) 20.0


+COD float O Chemical oxygen 20.0
r

demand (0–100 mg/ L)


In

+NN float O Nitrite-nitrogen (0–500 250.0


te

mg/ L)
lb

+Chl-a float O Chlorophyll A (0–300 ug/ 20.0


L)
ra

+TP float O Total phosphorus (0–5 2.5


s

mg/L)
+CODMn float O Permanganate index 20.0
(0–100 mg/L)
+SS float O Floating objects (0– 500.0
1000 mg/ L)
+BOD5 float O Biochemical oxygen 25.0
demand for 5 days (0–
50 mg/L)
+NO3-N float O Nitrate (0–500 mg/ L) 250.0
+TSI float O Eutrophic index (no 25.0
range)
+BlackSmellyL enumchar[ O Black and odorous "Light"
evel 32] level
enumchar[32]{

Other APIs 526


"Normal”
"Light”
"Heavy”
}
+DO float O Dissolved oxygen (0–10 20.0
mg/L)
Response Example
{
"found": 12,
"info": [{
"StartTime": "2012-03-14 00:00:00",
"Quality": 1,
"PH": 5.5,
"NTU": 250.0,
"NH3-N": 25.0,
"TN": 25.0,
DA

"SD": 20.0,
"COD": 20.0,
HU

"NN": 250.0,
A_

"Chl-a": 20.0,
HT

"TP": 2.5,
TP

"CODMn": 20.0,
"SS": 500.0,
_A

"BOD5": 25.0,
PI

"NO3-N": 250.0,
"TSI": 25.0,
fo

"BlackSmellyLevel": "Light",
r

"DO": 20.0
In

},…{}]
}
te
lb
ra

19.9.1.3 Stopping Searching


s

Stopping the search of water quality detection database.


Request URL http://<server>/cgi-bin/api/WaterDataStatServer/stopFind
Method POST
Request Params ( JSON format in body )
Name Type R/O Description Example
token uint32 O Search token 46284
Request Example
{
"token": 46284
}

Response Params ( JSON format in body )


Name Type R/O Description Example

Other APIs 527


Response Example
{}

19.9.2 Acquiring Capabilities


Acquiring the interface for water quality detection.
Request URL http://<server>/cgi-bin/api/WaterDataStatServer/getCaps
Method POST
Request Params ( JSON format in body )
Name Type R/O Description Example
Request Example
{}

Response Params ( JSON format in body )


Name Type R/O Description Example
DA

Support enumint O Supports water quality 0


HU

detection currently.
enumint{
A_

0: No
HT

1: Yes
TP

}
SupportLocal enumint O Supports local storage. 0
_A

DataStore enumint{
PI

0: No
1: Yes
fo

}
r

Response Example
In

{
te

"Support": 0,
"SupportLocalDataStore": 0
lb

}
ra
s

19.9.3 Acquiring Real-time Detection Data


The water quality detection data is refreshed every minute, and you can acquire the data in real time.
Request URL http://<server>/cgi-bin/api/WaterDataStatServer/getWaterData
Method POST
Request Params ( JSON format in body )
Name Type R/O Description Example
Type enumchar[ O enumchar[32][32]{ ["PH"," NTU ", …]
32][32] "Quality": Water quality
category
"PH": pH value
“NTU": Turbidity value
"NH3-N": Ammonia

Other APIs 528


nitrogen value
}
Request Example
{
"Type": ["PH"," NTU ", …]
}

Response Params ( JSON format in body )


Name Type R/O Description Example
Quality enumint O The smaller the 1
category value, the
better the water quality.
enumint {
1: I Category
2: II Category
3: III Category
DA

4: IV Category
5: V Category
HU

}
A_

UploadInfo object O Reported data of water


HT

quality detection.
TP

Reports all water quality


detection data when an
_A

alarm is triggered.
PI

+PH float O pH (1–14) 5.2


+NTU float O Turbidity (0–500 NTU) 200.0
fo

+NH3-N float O Ammonia nitrogen (0– 20.0


r

50 mg/L)
In

+TN float O Ammonia nitrogen (0– 25.0


te

50 mg/L)
+SD float O Transparency (0–30 m) 20.0
lb

+COD float O Chemical oxygen 50.0


ra

demand (0–100 mg/ L)


s

+NN float O Nitrite-nitrogen (0-500 20.0


mg/ L)
+DO float O Dissolved oxygen (0–10 5.0
mg/L)
+Chl-a float O Chlorophyll A (0–300 ug/ 200.0
L)
+TP float O Total phosphorus (0–5 2.5
mg/L)
+CODMn float O Permanganate index 20.0
(0–100 mg/L)
+SS float O Floating objects (0– 20.0
1000 mg/ L)
+BOD5 float O Biochemical oxygen 25.0
demand for 5 days (0–

Other APIs 529


50 mg/L)
+NO3-N float O Nitrate (0–500 mg/ L) 20.0
+TSI float O Eutrophic index (no 20.0
range)
+BlackSmellyL enumchar[ O Black and odorous level "Light"
evel 32] enumchar[32]{
"Normal”
"Light”
"Heavy”
}
FlunkType enumchar[ O Parameter value ["PH"," NTU ", …]
32][32] exceeds its threshold
enumchar[32][32]{
"PH": pH value
“NTU": Turbidity value
"NH3-N": Ammonia
DA

nitrogen value
}
HU

Response Example
A_

{
HT

"Quality": 1,
TP

"UploadInfo": {
"PH": 5.2,
_A

"NTU": 200.0,
PI

"NH3-N": 20.0,
"TN": 25.0,
fo

"SD": 20.0,
r

"COD": 50.0,
In

"NN": 20.0,
"DO": 5.0,
te

"Chl-a": 200.0,
lb

"TP": 2.5,
ra

"CODMn": 20.0,
s

"SS": 20.0,
"BOD5": 25.0,
"NO3-N": 20.0,
"TSI": 20.0,
"BlackSmellyLevel": "Light"
},
"FlunkType": ["PH"," NTU ", …]
}

Other APIs 530

You might also like