IP Camera API Webooks for AI Security Camera Alarms / Events

Home Forums Viewtron Security Camera Systems Support IP Camera API IP Camera API Webooks for AI Security Camera Alarms / Events

  • AI Security Camera AI Detection Webhooks

    Viewtron AI security cameras may be configured to send outbound HTTP Posts / webhooks when an AI detection alarm event occurs. Click here if you are looking for the Webhook API guide for Viewtron NVRs. The format is slightly different. Supported events include license plate recognition, face detection, human detection, vehicle detection, intrusion detection, and more. Please refer to the below API documentation for details on using the webhooks for your application. Please refer to these setup instructions to enable webbook APIs on your Viewtron security camera.


    Contents


    10.1 Intrusion Detection (Perimeter)

    GetSmartPerimeterConfig

    Retrieves the intrusion/perimeter detection configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartPerimeterConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.
    Entity Data None

    Successful Response:

    <?xml version="1.0" encoding="utf-8"?>
    <config xmlns="http://www.ipc.com/ver10" version="2.0.0">
      <perimeter>
        <switch type="boolean">true</switch>
        <alarmHoldTime type="uint32">20</alarmHoldTime>
        <objectFilter>
          <car>
            <switch type="boolean">true</switch>
            <sensitivity type="uint32" max="100" min="1" default="50">50</sensitivity>
          </car>
          <person>
            <switch type="boolean">true</switch>
            <sensitivity type="uint32" max="100" min="1" default="50">50</sensitivity>
          </person>
          <motor>
            <switch type="boolean">true</switch>
            <sensitivity type="uint32" max="100" min="1" default="50">50</sensitivity>
          </motor>
        </objectFilter>
        <saveTargetPicture type="boolean">false</saveTargetPicture>
        <saveSourcePicture type="boolean">false</saveSourcePicture>
        <regionInfo type="list" maxCount="4" count="1">
          <item>
            <pointGroup type="list" maxCount="8" count="4">
              <item>
                <X type="uint32">4075</X>
                <Y type="uint32">2466</Y>
              </item>
              <!-- Additional points... -->
            </pointGroup>
          </item>
        </regionInfo>
      </perimeter>
    </config>

    [Back to Top]


    10.2 Line Crossing (Tripwire)

    GetSmartTripwireConfig

    Retrieves the line crossing/tripwire detection configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartTripwireConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.
    Entity Data None

    Successful Response:

    <?xml version="1.0" encoding="utf-8"?>
    <config xmlns="http://www.ipc.com/ver10" version="2.0.0">
      <types>
        <tripwireDirection>
          <enum>none</enum>
          <enum>rightortop</enum>
          <enum>leftorbotton</enum>
        </tripwireDirection>
      </types>
      <tripwire>
        <switch type="boolean">false</switch>
        <alarmHoldTime type="uint32">20</alarmHoldTime>
        <objectFilter>
          <car>
            <switch type="boolean">true</switch>
            <sensitivity type="uint32" max="100" min="1" default="50">50</sensitivity>
          </car>
          <person>
            <switch type="boolean">true</switch>
            <sensitivity type="uint32" max="100" min="1" default="50">50</sensitivity>
          </person>
        </objectFilter>
        <lineInfo type="list" maxCount="4" count="1">
          <item>
            <direction type="tripwireDirection">rightortop</direction>
            <startPoint>
              <X type="uint32">10</X>
              <Y type="uint32">10</Y>
            </startPoint>
            <endPoint>
              <X type="uint32">1000</X>
              <Y type="uint32">1000</Y>
            </endPoint>
          </item>
        </lineInfo>
      </tripwire>
    </config>

    [Back to Top]


    10.3 Face Detection

    GetSmartVfdConfig

    Retrieves the face detection configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartVfdConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.
    Entity Data None

    Notes:

    • Face detection events are sent via HTTP POST when configured in Alarm Server settings
    • Event type code: VFD (face detection) or VFD_MATCH (face match with database)
    • Events include face crop image and full scene image (Base64 encoded)

    [Back to Top]


    10.4 License Plate Recognition (LPR)

    GetSmartVehicleConfig

    Retrieves the license plate recognition configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartVehicleConfig[/channelId]
    Applicable Products IPC (LPR cameras)
    Channel ID Optional. Default is 1.
    Entity Data None

    Successful Response:

    <?xml version="1.0" encoding="UTF-8"?>
    <config version="2.0.0" xmlns="http://www.ipc.com/ver10">
      <types>
        <plateAreaType>
          <enum continent="NorthAmerica">U.S.A</enum>
          <enum continent="NorthAmerica">Canada</enum>
          <enum continent="Europe">Germany</enum>
          <enum continent="Europe">Britain</enum>
          <!-- Additional regions... -->
        </plateAreaType>
        <alarmListType>
          <enum>blackList</enum>
          <enum>whiteList</enum>
          <enum>strangerList</enum>
        </alarmListType>
      </types>
      <vehicle>
        <switch type="boolean">true</switch>
        <plateSencitivity type="uint8">49</plateSencitivity>
        <plateSupportArea type="plateAreaType">U.S.A</plateSupportArea>
        <saveTargetPicture type="boolean">true</saveTargetPicture>
        <saveSourcePicture type="boolean">true</saveSourcePicture>
        <dedupMode>
          <switch type="boolean">false</switch>
          <intervalTime type="uint32" default="5">5</intervalTime>
        </dedupMode>
        <regionInfo type="list" maxCount="1" count="1">
          <item>
            <X1 type="uint32">375</X1>
            <Y1 type="uint32">2866</Y1>
            <X2 type="uint32">9625</X2>
            <Y2 type="uint32">8800</Y2>
          </item>
        </regionInfo>
      </vehicle>
    </config>

    AddVehiclePlate

    Adds license plates to the whitelist or blacklist.

    Field Value
    URL POST http://<host>[:port]/AddVehiclePlate
    Applicable Products IPC (LPR cameras)
    Entity Data License plate data (XML)

    Request Example:

    <?xml version="1.0" encoding="utf-8"?>
    <config>
      <vehiclePlates type="list" count="1">
        <item>
          <carPlateNumber type="string"><![CDATA[ABC1234]]></carPlateNumber>
          <beginTime type="string"><![CDATA[2024/01/01 00:00:00]]></beginTime>
          <endTime type="string"><![CDATA[2024/12/31 23:59:59]]></endTime>
          <carOwner type="string"><![CDATA[John Doe]]></carOwner>
          <plateItemType type="string">whiteList</plateItemType>
        </item>
      </vehiclePlates>
    </config>

    Notes:

    • plateItemType can be whiteList, blackList, or strangerList
    • beginTime and endTime set the validity period for the plate

    GetVehiclePlate

    Retrieves license plates from the database.

    Field Value
    URL POST or GET http://<host>[:port]/GetVehiclePlate
    Applicable Products IPC (LPR cameras)
    Entity Data Search filter (XML)

    Request Example:

    <config xmlns="http://www.ipc.com/ver10" version="2.0.0">
      <vehiclePlates type="list" maxCount="10000" count="1">
        <searchFilter>
          <item>
            <pageIndex type="uint32">0</pageIndex>
            <pageSize type="uint32">10</pageSize>
            <listType type="vehicleListTypes">allList</listType>
            <carPlateNum type="string"></carPlateNum>
          </item>
        </searchFilter>
      </vehiclePlates>
    </config>

    Notes:

    • LPR events are sent via HTTP POST when configured in Alarm Server settings
    • Event type code: VEHICLE or VEHICE (typo in some firmware)
    • Events include plate number, plate image, and overview image (Base64 encoded)
    • See Python API Server for parsing examples

    [Back to Top]


    10.5 Region Entry/Exit Detection

    GetSmartAoiEntryConfig

    Retrieves the region entry detection configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartAoiEntryConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    GetSmartAoiLeaveConfig

    Retrieves the region exit detection configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartAoiLeaveConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    Event Type Codes: AOIENTRY (region entry), AOILEAVE (region exit)

    [Back to Top]


    10.6 Target Counting

    GetSmartPassLineCountConfig

    Retrieves the target counting configuration.

    Field Value
    URL POST or GET http://<host>[:port]/GetPassLineCountConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    GetPassLineCountStatistics

    Gets current counting statistics.

    Field Value
    URL POST or GET http://<host>[:port]/GetPassLineCountStatistics[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    Successful Response:

    <?xml version="1.0" encoding="utf-8"?>
    <config xmlns="http://www.ipc.com/ver10" version="2.0.0">
      <entranceCount>
        <person type="uint32">0</person>
        <car type="uint32">0</car>
        <bike type="uint32">0</bike>
      </entranceCount>
      <exitCount>
        <person type="uint32">0</person>
        <car type="uint32">0</car>
        <bike type="uint32">0</bike>
      </exitCount>
    </config>

    [Back to Top]


    10.7 Video Metadata Detection

    GetSmartVsdConfig

    Retrieves the video metadata detection configuration. Video metadata detection identifies humans and vehicles in the scene and provides bounding box coordinates.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartVsdConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    Event Type Code: VSD

    [Back to Top]


    10.8 Loitering Detection

    GetSmartLoiteringConfig

    Retrieves the loitering detection configuration. Triggers when a person remains in a defined area longer than the specified duration.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartLoiteringConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    Event Type Code: LOITER

    [Back to Top]


    10.9 Illegal Parking Detection

    GetSmartPvdConfig

    Retrieves the illegal parking detection configuration. Triggers when a vehicle is parked in a prohibited zone.

    Field Value
    URL POST or GET http://<host>[:port]/GetSmartPvdConfig[/channelId]
    Applicable Products IPC
    Channel ID Optional. Default is 1.

    Event Type Code: PVD

    [Back to Top]


    10.10 Thermal Imaging

    GetMeasureTemperatureConfig

    Retrieves the thermal imaging temperature measurement configuration (for thermal cameras only).

    Field Value
    URL POST or GET http://<host>[:port]/GetMeasureTemperatureConfig[/channelId]
    Applicable Products IPC (thermal cameras)
    Channel ID Optional. Default is 1.

    [Back to Top]


    Event Type Code Reference

    When receiving HTTP POST alarm events, use these codes to identify the event type:

    Code Detection Type
    VEHICLE or VEHICE License Plate Recognition
    VFD Face Detection
    VFD_MATCH Face Match (recognized face)
    PEA Intrusion / Perimeter
    TRIPWIRE Line Crossing
    AOIENTRY Region Entry
    AOILEAVE Region Exit
    LOITER Loitering
    VSD Video Metadata (human/vehicle detection)
    PVD Illegal Parking
    MOTION Motion Detection

    10.11 Real-Time Target Object Tracking (traject)

    The Viewtron IP camera has an advanced HTTP Post system called httpPostV2 that supports real-time target tracking of human objects and vehicle objects. When subscribed to the traject data type, the camera sends continuous HTTP Posts (~7 per second) with bounding box coordinates and target classification for the entire duration a target is being tracked in the detection zone.

    This is fundamentally different from the alarm-based HTTP Post approach documented above. Alarm posts send one event when detection starts. httpPostV2 traject sends a continuous stream of tracking data — there are zero gaps while a target is present.

    Comparison: Alarm Posts vs traject

    Method What You Get Gaps While Target Present
    Alarm server push (httpPost v1) One POST per alarm event Yes — 20-60 second gaps between re-triggers
    GetAlarmStatus polling Poll for alarm true/false Yes — 5-20 second gaps due to alarmHoldTime cycles
    httpPostV2 traject Continuous stream (~7 posts/sec) None — zero gaps

    Use cases:

    • Relay/lighting control based on continuous human presence
    • People/vehicle counting with real-time position tracking
    • Dwell time analysis
    • Custom alarm logic based on target position and movement

    How httpPostV2 Works

    httpPostV2 is a subscription system configured on the camera. You define:

    1. Where to send — your server URL (up to 3 URLs supported)
    2. Which events — detection types to subscribe to (PERIMETER, TRIPWIRE, MOTION, etc.)
    3. Which data types — what kind of data to include in posts

    Available data types

    Data Type Description Post Frequency
    alarmStatus Alarm on/off status One per alarm cycle
    traject Real-time tracking data — target ID, type, bounding box ~7 posts/sec continuously
    smartData Detection event data with coordinates One per event
    sourceImage Full frame JPEG (base64 in XML) One per event
    targetImage Cropped target JPEG (base64 in XML) One per event

    You can subscribe to multiple data types on the same URL. When all five are subscribed, traject posts start first (within the first frame of detection), followed by smartData with images, then alarmStatus.


    Configuring httpPostV2

    httpPostV2 is configured via the camera’s API using SetHttpPostConfig. It can also be configured in the camera’s web interface under Network > HTTP Post > Smart Track Data.

    Get current config

    POST or GET http://<camera-ip>/GetHttpPostConfig

    Set traject subscription

    <?xml version="1.0" encoding="UTF-8"?>
    <config version="1.0" xmlns="http://www.ipc.com/ver10">
    <httpPostV2><postUrlConf>
      <urlList type="list" count="1"><item>
        <urlId>1</urlId>
        <switch>true</switch>
        <url>
          <protocol>http</protocol>
          <domain><![CDATA[YOUR_SERVER_IP]]></domain>
          <port>YOUR_PORT</port>
          <path><![CDATA[/API]]></path>
          <authentication>none</authentication>
        </url>
        <heatBeatSwitch>true</heatBeatSwitch>
        <keepaliveTimeval>90</keepaliveTimeval>
        <subscribeDateType type="list" count="1">
          <item>traject</item>
        </subscribeDateType>
        <subscriptionEvents type="list" count="1">
          <item>PERIMETER</item>
        </subscriptionEvents>
      </item></urlList>
    </postUrlConf></httpPostV2>
    </config>

    Replace YOUR_SERVER_IP and YOUR_PORT with your API server’s address.

    Available subscription events

    ALL, MOTION, SENSOR, PERIMETER, TRIPWIRE, OSC, AVD,
    AOIENTRY, AOILEAVE, PASSLINECOUNT, TRAFFIC, VSD, PVD, LOITER, ASD

    traject XML Format

    When a target enters the detection zone, the camera sends posts like this at ~7 per second:

    <?xml version="1.0" encoding="UTF-8" ?>
    <config version="1.7" xmlns="http://www.ipc.com/ver10">
      <types>
        <targetType>
          <enum>person</enum>
          <enum>car</enum>
          <enum>motor</enum>
        </targetType>
      </types>
      <subscribeOption type="subscribeRelation">FEATURE_RESULT</subscribeOption>
      <currentTime type="tint64">1774646121524166</currentTime>
      <mac type="string"><![CDATA[58:5b:69:5f:42:1b]]></mac>
      <sn type="string"><![CDATA[I421B0Z1173Q]]></sn>
      <deviceName type="string"><![CDATA[FaceCam]]></deviceName>
      <traject type="list" count="1">
        <item>
          <targetId type="uint32">434</targetId>
          <point>
            <x type="uint32">0</x>
            <y type="uint32">0</y>
          </point>
          <rect>
            <x1 type="uint32">6534</x1>
            <y1 type="uint32">2708</y1>
            <x2 type="uint32">7585</x2>
            <y2 type="uint32">6388</y2>
          </rect>
          <velocity type="uint32">0</velocity>
          <direction type="uint32">0</direction>
          <targetType type="targetType">person</targetType>
          <trajectlength type="list" count="0"/>
        </item>
      </traject>
    </config>

    traject fields

    Field Type Description
    targetId uint32 Unique ID for the tracked target. Consistent across all posts for the same target. New ID assigned for each new target.
    rect x1, y1, x2, y2 Bounding box in normalized coordinates (0-10000, where 10000 = full frame width or height)
    targetType string person, car, or motor
    velocity uint32 Target velocity
    direction uint32 Target direction
    currentTime int64 Unix timestamp in microseconds
    mac / sn string Camera MAC address and serial number

    Each post is approximately 1.7 KB. Posts stop within ~140ms of the target leaving the detection zone.


    NVR Compatibility

    The NVR does not forward traject data. The NVR’s HTTP Post system only supports alarm-style events (keepalive, alarmStatus, alarmData).

    However, httpPostV2 traject works when the camera is connected to the NVR’s PoE port. You configure httpPostV2 directly on the camera’s firmware — the camera sends traject posts independently of the NVR. The NVR continues to handle recording and alarm events normally.

    Recommended setup for full coverage:

    1. Configure the NVR HTTP Post to your server — receives alarm events with images (v2.0 format, documented in NVR API Detection Events)
    2. Configure the camera httpPostV2 to your server with traject subscribed — receives real-time tracking (v1.x format)
    3. Your server receives both streams

    Firmware Compatibility

    httpPostV2 traject has been confirmed working on IPC firmware 5.1.4.0 (API protocol v1.7). Other Viewtron AI camera models with perimeter detection should support httpPostV2 as well.

    The GetHttpPostConfig endpoint will show whether your camera supports httpPostV2. If the response includes an httpPostV2 element, the feature is available.


    Python API Server

    Our open source Python API server on GitHub handles httpPostV2 traject posts alongside the standard alarm events. The server auto-detects the post type and processes it accordingly.

    For questions about httpPostV2 or the API server, contact Mike at mike@cctvcamerapros.net.

    Back to API Documentation Index