LPR Camera API Integration Questions

Home › Forums › Viewtron Security Camera Systems Support › IP Camera API › LPR Camera API Integration Questions

  • I am looking at the Viewtron LPR-IP4 license plate recognition camera for an access control platform we are building for gated communities and parking lots. I read the API docs and have a few LPR camera API integration questions before we buy.

    1. Can the camera send HTTPS webhooks with custom headers like Authorization or X-API-Key? If not, what authentication options does it support?
    2. Can we sync allow list additions, updates and removals from our backend through the API without an NVR, including clearing and reloading the whole list for a full re-sync?
    3. The site will be on a dedicated cellular connection. What setup do you recommend so we can manage the allow list and trigger the gate relay remotely?
    4. Can a single API command pulse the relay, so the camera releases it on its own after a set time without a second command?
    5. Does the API return the state or region of the plate?

    These answers are for the LPR-IP4 on firmware 5.3.1, and I tested each one on a live camera.


    1. Can the LPR camera send HTTPS webhooks with an API key header?

    No. The camera’s HTTP Notification (event push) is HTTP only. The HTTPS setting under Network only covers the camera’s own web server. There is no custom header or API key field.

    The built-in option is a user name and password. The camera sends it as a standard HTTP Basic Authorization header on every request. Other good options:

    • Put a long random token in the Path field, as a path segment or a ?token= query string. Both come through intact.
    • Only accept posts from the camera’s IP address.
    • Best: run a small relay on the camera’s LAN that checks the login or token and forwards the event to your cloud over HTTPS with whatever headers you need (see section 3). A VPN also works.

    Viewtron LPR-IP4 Edit HTTP Notification setup screen for license plate detection webhooks

    2. Can I sync the LPR allow list through the API without an NVR?

    Yes. The camera keeps its own license plate database, and you manage it through its HTTP API (XML with HTTP Basic auth). No NVR is needed.

    • GetLicensePlateGroups returns the built-in lists and their IDs: temporary, allow (whiteList) and block (blackList). Read the IDs at startup instead of hard-coding them.
    • AddLicensePlates adds plates in batches (up to 100 per request per the spec), with a result code for each plate.
    • GetLicensePlates searches by list and, optionally, by plate. Paging starts at offset 1. Error code 20 just means the list is empty.
    • ModifyLicensePlate updates the owner, phone and begin / end validity dates. The plate number is the key, so to change a number, delete the plate and add it again.
    • DeleteLicensePlate with a plate number and list ID removes one plate. With only the list ID, it clears the entire list.

    So a full re-sync can be a clear followed by a batch reload. That said, I recommend syncing by difference: page through the camera’s list, compare it with your backend, and add or delete only what changed. That way there is no window where allowed cars get turned away.

    Keep the camera’s clock on NTP, since the camera enforces the validity dates.


    3. What is the best setup for an LPR camera on a cellular connection?

    Your server calls the camera’s API, and the camera pushes events to your server. Cellular usually puts the site behind carrier NAT, so your cloud cannot reach the camera directly. Here is what I recommend:

    • An on-site gateway (preferred). This is a small Linux box, or a cellular router that can run your agent, on the camera’s LAN. It keeps an outbound encrypted connection to your cloud, pulls list changes and gate commands, calls the camera API locally, and forwards the camera’s events to you over HTTPS with your API key. It also solves sections 1 and 4.
    • Or a cellular router with a VPN (WireGuard, OpenVPN or IPsec) that dials out to your cloud. A carrier private APN also works.
    • Never expose the camera’s web, API or video ports to the internet.

    To save data, turn off the full-size picture in the event push. In my test, an event with the full picture was about 0.8 MB, and the plate crop alone was about 20 KB.

    You may also want the camera to open the gate on its own for allow list matches, so normal entries do not depend on the cellular link.


    4. Can one API command pulse the gate relay?

    No. The relay output latches. ManualAlarmOut with “on” closes it, and it stays closed until you send “off”. The camera’s alarm hold time does not apply to manual commands, so plan on two commands.

    As a fail-safe, have the on-site gateway send the “off” on a local timer, so a dropped connection can never leave the gate open. Another option is a timer relay module that turns any closure into a fixed pulse.


    5. Does the LPR camera API return the plate state or region?

    No. The plate state is not captured at this time. That would be very difficult, because the state text is much smaller than the plate number and plate frames often cover it. I do not know of any LPR camera on the market that can do this.


    Related

    Still have questions? Call our technical support team at 561-433-8488 or email info@cctvcamerapros.net.