LPR WebHook
In this guide, you will learn how to set up your web server to receive HTTP postbacks from Events Bridge when a license plate detection event occurs. The system will post event data to your web server, following the WebHookLprPayload model.
Your web server must be configured to handle incoming HTTP POST requests, and optionally validate authentication based on the configuration set in Events Bridge.
Requirements
Web Server Setup
Your web server must:
- Accept HTTP POST requests at a publicly or privately accessible URL.
- Be configured to parse JSON data from incoming requests.
- Optionally support authentication methods like Basic Authentication or Bearer Tokens, depending on how Events Bridge is configured.
Authentication (Optional)
Events Bridge can be configured to send authentication information with each POST request, using either:
- Basic Authentication: The request will include a username and password in the headers.
- Bearer Token: The request will include a token in the
Authorization
header.
Your web server must be able to validate these headers to accept the request.
HTTPS Encouraged
Using HTTPS is recommended for security, but Events Bridge can be configured to accept self-signed certificates if needed. This allows you to secure communication even if using self-signed SSL certificates.
WebHook Payload: WebHookLprPayload
When Events Bridge detects a license plate, it sends a POST request to your web server with the following payload structure.
Full Example Payload
{
"publishType": "WebHookLprPayload",
"sourceName": "eConnect Site 1 LPR",
"externalId": "98765",
"fields": [
{
"fieldName": "TenantID",
"fieldValue": "ABC123"
}
],
"payload": {
"lprPlateInfo": {
"plate": "XYZ987",
"vehicleMake": "Toyota",
"vehicleModel": "Camry",
"vehicleColor": "Blue",
"vehicleState": "CA",
"tags": [
{
"tagName": "VIP",
"expires": "2024-12-31T23:59:59Z"
}
],
"fields": [
{
"fieldName": "DriverLicenseNumber",
"stringValue": "D1234567",
"dateValue": null,
"numberValue": null,
"boolValue": null
}
]
},
"detectionInfo": {
"dateTimeUtc": "2024-10-22T10:00:00Z",
"detectorName": "EntranceCamera1",
"timeZone": "America/Los_Angeles"
},
"detectionImages": [
{
"image": "base64_encoded_image_data",
"cropSizeName": "Close"
},
{
"image": "base64_encoded_image_data",
"cropSizeName": "Car"
}
],
"detectionHistory": {
"visitHistory": [
{
"dateTimeUtc": "2024-10-20T09:00:00Z",
"detectorName": "EntranceCamera2"
}
]
}
}
}
Field Descriptions
publishType (string)
- Description: The type discriminator of the object, used as a helper for deserialization.
- Example:
"WebHookLprPayload"
1. sourceName (String)
- Description: The name of the site location where the license plate was detected. This is useful in multi-site setups to identify the location of the detection.
- Example:
"ParkingLot1"
2. externalId (String)
- Description: A unique identifier provided by the partner’s system during license plate enrollment. This allows partners to match detection events back to their internal records.
- Example:
"98765"
3. fields (Array of Objects)
- Description: An array of custom fields provided during enrollment, containing additional data such as tenant or account information.
- Sub-fields:
- fieldName (String): The name of the custom field.
- Example:
"TenantID"
- Example:
- fieldValue (String): The value assigned to the field.
- Example:
"ABC123"
- Example:
- fieldName (String): The name of the custom field.
4. payload (Object)
- Description: Contains detailed information about the detected vehicle and the detection event.
4.1 lprPlateInfo (Object)
- Description: Information about the detected vehicle, including its license plate, make, model, and any associated tags or custom fields.
Sub-fields:
- plate (String): The license plate number of the detected vehicle.
- Example:
"XYZ987"
- Example:
- vehicleMake (String, Optional): The make of the vehicle (if available).
- Example:
"Toyota"
- Example:
- vehicleModel (String, Optional): The model of the vehicle (if available).
- Example:
"Camry"
- Example:
- vehicleColor (String, Optional): The color of the vehicle (if available).
- Example:
"Blue"
- Example:
- vehicleState (String, Optional): The state or region where the vehicle is registered (if available).
- Example:
"CA"
- Example:
- tags (Array of Objects, Optional): Tags associated with the vehicle, categorizing it (e.g., "VIP", "Banned").
- tagName (String): The name of the tag.
- Example:
"VIP"
- Example:
- expires (String, Optional): Expiration date of the tag, in ISO 8601 format.
- Example:
"2024-12-31T23:59:59Z"
- Example:
- tagName (String): The name of the tag.
- fields (Array of Objects, Optional): Additional information or custom fields associated with the vehicle.
- fieldName (String): The name of the field.
- Example:
"DriverLicenseNumber"
- Example:
- fieldValue (String): The value assigned to the field.
- Example:
"D1234567"
- Example:
- fieldName (String): The name of the field.
4.2 detectionInfo (Object)
- Description: Information about the detection event, including the time and location of the detection.
Sub-fields:
- dateTimeUtc (String): The date and time of the detection, in UTC (ISO 8601 format).
- Example:
"2024-10-22T10:00:00Z"
- Example:
- detectorName (String): The name of the camera or detector that captured the license plate.
- Example:
"EntranceCamera1"
- Example:
- timeZone (String, Optional): The time zone where the detection occurred. IANA
- Example:
"America/Los_Angeles"
- Example:
4.3 detectionImages (Array of Objects, Optional)
- Description: An array of images captured at the time of the detection.
Sub-fields:
- image (String): The image of the vehicle or license plate, encoded in base64.
- Example:
"base64_encoded_image_data"
- Example:
- cropSizeName (String): The size of the image crop (e.g., "Close", "Medium", "Car", "FullFrame", "Other"").
- Example:
"Close"
- Example:
4.4 detectionHistory (Object, Optional)
- Description: Contains information about past visits or interactions with the vehicle.
Sub-fields:
- visitHistory (Array of Objects, Optional): A list of previous detections of the vehicle.
- dateTimeUtc (String): The date and time of the previous detection (ISO 8601 format).
- Example:
"2024-10-20T09:00:00Z"
- Example:
- detectorName (String): The name of the detector that captured the previous detection.
- Example:
"EntranceCamera2"
- Example:
- dateTimeUtc (String): The date and time of the previous detection (ISO 8601 format).
Authentication Handling
If Events Bridge is configured to use Basic Authentication or Bearer Token, your web server will need to validate the incoming request headers.
Basic Authentication
With Basic Authentication, the Authorization
header will contain a base64-encoded username and password. Your web server should decode and verify these credentials.
Bearer Token
With Bearer Token authentication, the Authorization
header will contain a token. Your server should validate this token before processing the request.
Final Notes
- Your web server can be hosted on either a public or private network, as long as Events Bridge can access it.
- Ensure that your web server is always available to receive POST requests from Events Bridge.
- For security, use HTTPS for all communication, even if it’s with a self-signed certificate, which is supported by Events Bridge.