Webhook Events Overview
Viewtron devices can push real-time AI detection events to your HTTP server as webhooks. There are two sources of HTTP POST data:
-
IP Camera (direct) -- The camera sends posts directly to your server using the IPC v1.x XML format (config version
1.0or1.7). Supports the full httpPostV2 subscription system including real-timetrajecttracking. -
NVR (forwarded) -- The NVR receives events from cameras on its PoE ports and forwards them to your server using the NVR v2.0 XML format (config version
2.0.0). Does not supporttraject.
Recommended Setup
For full coverage, configure both sources simultaneously:
- Configure the NVR HTTP Post to send to your server (alarm events with images, v2.0 format)
- Configure the IPC httpPostV2 to send to your server with
trajectsubscribed (real-time tracking, v1.x format) - Your server receives both streams simultaneously
This dual-source approach gives you alarm events with images from the NVR and continuous real-time tracking from the camera.
Working Python Server
A complete working implementation is available at github.com/mikehaldas/IP-Camera-API. It handles both IPC and NVR formats, extracts images, logs events to CSV, and supports traject-based relay control.
Event Flow
When a detection event occurs, you receive these message types:
| Message Type | Description | Source |
|---|---|---|
| keepalive | Periodic heartbeat | IPC and NVR |
| alarmStatus | Alarm state change (true/false) | IPC and NVR |
| alarmData / smartData | Full detection event with coordinates and images | IPC and NVR |
| traject | Continuous real-time target position tracking | IPC only |
Format Differences
The two sources use different XML formats. See the dedicated pages for each:
- IPC Event Format (v1.x) -- Direct camera posts
- NVR Event Format (v2.0) -- NVR-forwarded posts
Section Guide
| Page | What You'll Find |
|---|---|
| Detection Types | Complete table of all detection types with IPC and NVR codes |
| IPC Format | XML structure for direct camera posts (v1.x) |
| NVR Format | XML structure for NVR-forwarded posts (v2.0) |
| Data Types | How httpPostV2 subscription types interact |
| traject Tracking | Continuous real-time target position data |
| Image Data | Base64 image encoding, source vs target images |
| Timestamps | Timestamp formats across IPC and NVR |
For step-by-step setup instructions, see Webhook Event Notification API in the Applications section.