Skip to main content

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​

FirmwareAPI ProtocolConfig Version in XML
IPC 5.2 or earlierv1.9 (v1.0 / v1.7)1.0 or 1.7
IPC 5.3 or laterv2.0.02.0.0
IPC 5.3.1 or later (2026 builds)v2.1.02.1.0
NVR 1.4.12 or earlierv1.91.0 or 1.7
NVR 1.4.13 or laterv2.0.02.0.0

Some 5.3.x builds report 2.0.0. Always read apiVersion.

What Changed in v2.0​

New Commands​

CommandDescription
GetSupportedAPIsLists all available API endpoints on the device
TriggerVirtualAlarmTrigger a virtual alarm (NVR only)
GetAudioStreamConfigAudio stream configuration
GetPassLineCountStatisticsCurrent entrance/exit counts
GetMeasureTemperatureConfigThermal camera temperature measurement
GetVehiclePlateQuery license plate database; replaced by GetLicensePlates on v2.1

Renamed Commands​

v1.9 Namev2.0 NameChange
GetChannelListGetChannelInfoRicher response with channel types and names
GetAlarmInListGetAlarmInInfoAdds alarm type classification (local/virtual/remote)

Enhanced Responses​

  • GetDeviceInfo now includes apiVersion and httpPostVersion fields directly
  • GetImageConfig adds sharpen, denoise, backlightCompensation, infraredMode fields
  • GetSnapshotByTime returns base64 image data in XML (v1.9 returns raw JPEG)
  • GetDiskInfo adds storageType (SD/HDD) and locked status
  • Error codes expanded from 5 to 50+ with descriptive errorDesc attribute
  • Responses include Applicable Products metadata (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) and deviceInfo with 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:

  • GetDeviceInfo reports apiVersion 2.1.0 and httpPostVersion 2.1.0. Responses use config version 2.1.0.
  • The license plate database uses group-based commands: GetLicensePlateGroups, GetLicensePlates, AddLicensePlates, ModifyLicensePlate, DeleteLicensePlate. LPR detection settings use GetSmartLicensePlateConfig / SetSmartLicensePlateConfig. Plate snapshot search uses SearchSnapLicensePlates / DownloadSnapLicensePlate. See License Plate Recognition configuration.
  • GetVehiclePlate, AddVehiclePlate, GetSmartVehicleConfig, and GetVehicleConfig return HTTP 400 with errorCode="1" (Invalid Request) on v2.1.
  • GetHttpPostConfig / SetHttpPostConfig are 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.