1. Introduction
The Hypertext Transfer Protocol (HTTP) is designed to enable communications between clients and servers. A client sends an HTTP request to the server, and then the server returns a response to the client. The response contains status information about the request and may also contain the requested content. The two most common HTTP methods are GET and POST.
1.1 What is GET Method
GET, the most common HTTP methods, is used to request data from a specified resource. Some notes on GET requests:
l GET requests can be cached
l The query string (name/value pairs) is sent in the URL of a GET request. So GET requests should never be used when you deal with sensitive data
l GET requests remain in the browser history
l GET requests can be bookmarked
l GET requests have length restrictions
l GET requests are only used to request data (not modify)
1.2 What is POST Method
POST is used to send data to a server to create/update a resource. Some notes on POST requests:
l The data sent to the server with POST is stored in the request body of the HTTP request:
l POST requests are never cached
l POST requests do not remain in the browser history
l POST requests cannot be bookmarked
l POST requests have no restrictions on data length
2. How to Set HTTP Notification
Enable HTTP Notification in Alarm Action before all settings.
Note: HTTP POST Method is currently only available in VCA Event (including people counting), Face Detection Message and LPR Message, while Basic Event has GET Method alone. Before firmware version 4x.7.0.77, only LPR Message supported both POST and GET Method.
2.1 The Get Method
Step 1: Select Get in HTTP Method and choose one of the three URLs to enable.
Step 2: Set Trigger Interval from 0s to 900s. For example, 5s means that if the VCA Alarm is continuously triggered, the camera will communicate with the client by GET Method every 5s.
Step 3: Fill in URL, User Name and Password.
Take an example, the API URL from a VMS is like “http://192.168.7.121:8080/api/CreatEvent?” Fill in the specified URL in camera’s web UI (if the VMS requires the authentication, please also fill in) :
The information VMS needs is Resource and Type. Once the VCA event is triggered, the camera will send below URL to VMS:
http://192.168.7.121:8080/api/CreatEvent?Resource=VCACamera&Type=RegionEntance
If the alarm information is to be displayed in VMS, the VMS side needs to extract it from the URL.
2.2 The POST Method
Step 1: Select Post in HTTP Method and choose one of the three URLs to enable.
Step 2: Set Trigger Interval from 0s to 900s. For example, 5s means that if the VCA Alarm is continuously triggered, the camera will communicate with the client by POST Method every 5s.
Step 3: Check Snapshot if you want to send the snapshot through POST method at the same time.
Step 4: Fill in URL, User Name and Password.
Take an example, the API URL from a VMS is like “http://192.168.2.24:1234/post”. Fill in the specified URL in camera’s web UI (if the VMS requires the authentication, please also fill in) :
Camera will post the information data in json format to the VMS or NVR in real time when it is triggered.
The content that will be sent is as follows:
Example 1: VCA Event
Example 2: Face Detection
Example 3: People Counting
Example 4: LPR Message
Note: For more details and other ways to push LPR message, please refer to
42.Milesight-Troubleshooting: Integration between LPR Camera and NVR(VMS).
3. Specific Example
Some professional VMS has API for HTTP GET Method. We take Nx Witness and Digifort as examples to show how HTTP Notification works.
3.1 Nx Witness
Step 1: Do all the preparations before testing, such as adding Milesight Camera in Nx Witness and enabling events that require HTTP Notification in the camera web page.
We take Region Entrance here as an example. Enable it on the web page of camera and configure more, such as setting Sensitivity, drawing detection region, scheduling enable time and so on.
Step 2: Open Nx Witness Server Web Client, click the tag For Developers after logging into Web Client and then open API Testing Tools(new).
Search “CreateEvent” to quickly find the API we want.
Step 3: The tool will automatically form Requesting URL after you fill in the content. We use three of these commonly used parameters. Fill in the information you want to send to Nx Witness when the Region Entrance is triggered.
Copy the Requesting URL.
Step 4: Open web page of the camera. Enable HTTP Notification in Alarm Action. Select Get in HTTP Method and choose one of the three URLs to enable. Set Trigger Interval from 0s to 900s. Paste the URL you just copied from API test tool in Nx Witness Server Web Client.
Reform the URL:
https://login:password@192.168.7.33:7001/api/createEvent?source=MS-C2961-REOPB&caption=Region%20Entrance&description=Someone%20in%20the%20zone(Before)
Don’t forget to finish User Name and Password (Nx Witness Server’s User Name and Password) and click Save.
Result: Once Region Entrance is triggered, Nx Witness will show the Notification.
3.2 Digifort
Step 1: Do all the preparations before testing, such as adding Milesight Camera in Digifort and enabling events that require HTTP Notification in the camera web page.
We take Motion Detection as an example. Enable it on the web page of camera and configure more, such as setting Sensitivity, drawing detection region, scheduling enable time and so on.
Step 2: Check the HTTP Notification as Alarm Action and complete the rest of the settings.
URL should be get from Digifort API document. And the Motion Detection API is:
http://[IP]:8601/Interface/Cameras/MotionDetection/Notify?Camera=CameraName
Note :
l [IP] refers to the PC's IP where the Digifort is installed.
l 8601 is the port for Motion signal in Digifort.
l Camera Name is the camera name you set in Digifort VMS, like the picture shown below.
l User Name: admin (the user name of your camera)
l Password: (the password of your camera)
Step 3: Choose ‘use motion detection by external notification’.
Result: If successful, you can see that the device icon turns yellow in the Surveillance when the camera is under Motion Detection Alarm.
——————END——————