8.11.12 Notification alertStream
/Event/notification/alertStream
GET
General Resource v1.0
Viewer
Description It is used to get the event notification data stream through HTTP
server push.
Query None
©2009 – 2014 by HIKVISION. All rights reserved.
98Inbound Data None
Success Return Stream of <EventNotificationAlert>
Notes:
This function is used to get an event notification alert stream from the media device via
HTTP or HTTPS. This function does not require that a client/VMS system be added as an
HTTP(S) destination on the media device. Instead, the client/VMS system can call this
API to initialize a stream of event information from the device. In other words, a
connection is established with the device when this function is called, and stays open to
constantly receive event notifications.
This API uses HTTP server-push with the MIME type multipart/mixed defined in RFC
2046.
<protocol> is the protocol name, i.e. “HTTP” or “HTTPS”.
<channelID> is present for video and analytics events.
<activePostCount> is the sequence number of current notification for this particular event.
It starts at 1. Useful for recurring notifications of an event. Each event maintains a
separate post count.
EventNotificationAlert XML Block
<EventNotificationAlert version=“1.0”
xmlns=“
http://www.hikvision.com/ver10/XMLSchema”>
<ipAddress>
<!-- dep, xs:string -->
</ipAddress>
<portNo>
<!-- opt, xs:integer -->
</portNo>
<protocol>
<!-- opt, xs:string -->
</protocol>
<macAddress>
<!-- opt, xs:string;MAC --> </macAddress>
<channelID>
<!-- dep, xs:string -->
</channelID>
<dateTime>
<!-- req, xs:datetime --> </dateTime>
<activePostCount> <!-- req, xs:integer -->
</activePostCount>
<eventType> <!-- req, xs:string, “IO,VMD,videoloss, shelteralarm” --> </eventType>
<eventState>
<!-- req, xs:string, “active,inactive” --> </eventState>
<eventDescription> <!-- req, xs:string -->
</eventDescription>
<inputIOPortID> <!-- dep, xs:integer, if <eventType> is “IO” -->
</inputIOPortID>
<DetectionRegionList>
<!-- dep, if <eventType> is “VMD” -->
<DetectionRegionEntry>
<!-- req -->
<regionID>
<!-- req, xs:string -->
</regionID>
<sensitivityLevel>
<!-- req, xs:integer, 0..100 --> </sensitivityLevel>
</DetectionRegionEntry>
</DetectionRegionList>
</EventNotificationAlert>
Example
The following is an example of an HTTP event stream that pushes a VMD event from
video channel 1.
©2009 – 2014 by HIKVISION. All rights reserved.
99GET /Event/notification/alertStream HTTP/1.1
...
HTTP/1.1 200 OK
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=“<boundary>”
--<boundary>
Content-Type: application/xml; charset=“UTF-8”
Content-Length: xxx
<?xml version=“1.0” encoding=“UTF-8”?>
<EventNotificationAlert version=“1.0”
xmlns=“
http://www.hikvision.com/ver10/XMLSchema”>
<ipAddress>172.6.64.7</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>01:17:24:45

9:F4</macAddress>
<channelID>1</channelID>
<dateTime>2009-11-14T15:27Z</dateTime>
<activePostCount>1</activePostCount>
<eventType>VMD</eventType>
<eventState>active</eventState>
<eventDescription>Motion alarm</eventDescription>
<DetectionRegionList>
<DetectionRegionEntry>
<regionID>2</regionID>
<sensitivityLevel>4</sensitivityLevel>
</DetectionRegionEntry>
</DetectionRegionList>
</EventNotificationAlert>
--<boundary>
...