API Versions
Viewtron devices ship with one of several API generations (1.x, 2.0, 2.1). The HTTP API protocol is approximately 95% identical between them. This documentation covers these generations as a unified reference, with inline callouts where they differ.
Detecting Your Version
Send a GetDeviceInfo request. The response includes an apiVersion field:
<apiVersion type="string"><![CDATA[2.0.0]]></apiVersion>
apiVersion may read 2.0.0 or 2.1.0. Treat any 2.x value as the v2 family, then call GetSupportedAPIs to see which commands that device actually has. Commands differ between 2.0 and 2.1 firmware (see What changed in v2.1).
If there is no apiVersion field, use GetDeviceDetail — the apiVersion appears in the property block. Devices without either field are running the v1.x protocol.
Firmware-to-Protocol Mapping
| Firmware | API Protocol | Config Version in XML |
|---|---|---|
| IPC 5.2 or earlier | v1.9 (v1.0 / v1.7) | 1.0 or 1.7 |
| IPC 5.3 or later | v2.0.0 | 2.0.0 |
| IPC 5.3.1 or later (2026 builds) | v2.1.0 | 2.1.0 |
| NVR 1.4.12 or earlier | v1.9 | 1.0 or 1.7 |
| NVR 1.4.13 or later | v2.0.0 | 2.0.0 |
Some 5.3.x builds report 2.0.0. Always read apiVersion.
What Changed in v2.0
New Commands
| Command | Description |
|---|---|
| GetSupportedAPIs | Lists all available API endpoints on the device |
| TriggerVirtualAlarm | Trigger a virtual alarm (NVR only) |
| GetAudioStreamConfig | Audio stream configuration |
| GetPassLineCountStatistics | Current entrance/exit counts |
| GetMeasureTemperatureConfig | Thermal camera temperature measurement |
| GetVehiclePlate | Query license plate database; replaced by GetLicensePlates on v2.1 |
Renamed Commands
| v1.9 Name | v2.0 Name | Change |
|---|---|---|
GetChannelList | GetChannelInfo | Richer response with channel types and names |
GetAlarmInList | GetAlarmInInfo | Adds alarm type classification (local/virtual/remote) |
Enhanced Responses
GetDeviceInfonow includesapiVersionandhttpPostVersionfields directlyGetImageConfigaddssharpen,denoise,backlightCompensation,infraredModefieldsGetSnapshotByTimereturns base64 image data in XML (v1.9 returns raw JPEG)GetDiskInfoaddsstorageType(SD/HDD) andlockedstatus- Error codes expanded from 5 to 50+ with descriptive
errorDescattribute - Responses include
Applicable Productsmetadata (IPC, NVR, or both)
Webhook Event Format Differences
The HTTP POST webhook format differs significantly between IPC (v1.x) and NVR (v2.0):
- IPC v1.x uses short smartType codes:
PEA,VFD,VEHICE,PASSLINECOUNT - NVR v2.0 uses spelled-out names:
regionIntrusion,videoFaceDetect,vehicle,targetCountingByLine - NVR v2.0 adds
messageType(keepalive, alarmStatus, alarmData) anddeviceInfowith IP, MAC, and channel ID - Timestamp precision: v1.x uses milliseconds, v2.0 uses microseconds
See the Webhook Events section for full format details.
What Changed in v2.1
Verified on a camera running 5.3.1 firmware:
GetDeviceInforeportsapiVersion2.1.0andhttpPostVersion2.1.0. Responses use config version2.1.0.- The license plate database uses group-based commands:
GetLicensePlateGroups,GetLicensePlates,AddLicensePlates,ModifyLicensePlate,DeleteLicensePlate. LPR detection settings useGetSmartLicensePlateConfig/SetSmartLicensePlateConfig. Plate snapshot search usesSearchSnapLicensePlates/DownloadSnapLicensePlate. See License Plate Recognition configuration. GetVehiclePlate,AddVehiclePlate,GetSmartVehicleConfig, andGetVehicleConfigreturn HTTP 400 witherrorCode="1"(Invalid Request) on v2.1.GetHttpPostConfig/SetHttpPostConfigare not part of the public API on v2.1. Configure HTTP POST in the camera's web interface.- In the camera's HTTP POST V2 settings, the data-type list is named
subDataType(earlier firmware:subscribeDateType). - The v2.1 HTTP POST event format is being verified. See IPC HTTP POST Format (v2.1).
Using the Python Library
The Viewtron Python SDK (pip install viewtron) abstracts the differences between v1.x and v2.0 webhook formats. Both versions expose the same method interface — get_alarm_type(), get_plate_number(), get_source_image(), etc. — so your application code works identically regardless of firmware version.
from viewtron import LPR, VehicleLPR
# v1.x IPC events use LPR class
# v2.0 NVR events use VehicleLPR class
# Both expose the same interface:
# event.get_plate_number()
# event.get_source_image()
# event.images_exist()
After this section, you should not need to think about versions unless you encounter a specific callout in the documentation.