Monitoring License Plates
The Monitor License Plate API allows partners to enroll and begin monitoring a vehicle's license plate in the Events Bridge system. Once enrolled, the system will track the vehicle based on the supplied license plate information.
API Endpoint
- HTTP Method:
PUT - Endpoint:
/api/v1/lpr/monitor/{externalId} - Private Server Base URL:
https://10.0.0.123:5022 - Cloud Server Base URL:
https://customername.econnectcloud.com/eventsbridge
Authentication
This API call requires authentication with a JWT token, which must be passed in the header of the request.
Path Parameter
- externalId: The unique ID assigned by the partner's system to identify the license plate being monitored. This ID must be unique to the partner and is required for tracking and future interactions. It is case sensitive, and does not need to match the plate itself.
Request Body
The PUT request requires the following data to be passed in the body of the request.
Required Fields
- plate (String): The license plate number of the vehicle to be monitored.
Optional Fields
- monitorReason (String): The reason for monitoring the vehicle (e.g., "Security Alert", "VIP Monitoring"). This is human-readable text that is written to the eConnect notes for the subject.
- tags (Array of Objects): Tags that categorize the vehicle, each with a single
tagNameproperty.- Tags are prefixed with the field prefix assigned to your account. If your account is
SystemAand you send the tagBanned, it is stored in eConnect asSystemA-Banned. - If you supply no tags, one is added automatically using your field prefix as the tag name. This is what stops the subject being removed by routine cleanup processes.
- Tags are prefixed with the field prefix assigned to your account. If your account is
- additionalFields (Array of Objects): Any extra information to store alongside the plate, such as a TenantId. Each entry has a
fieldNameand afieldValue, and the whole array is replayed back to you in thefieldsproperty of every detection webhook.
Code Examples
- C#
- Curl
- PowerShell
using eConnect.EventsBridge.Sdk;
// Assuming sdk is already initialized with authentication
// Define the externalId
string externalId = "12345";
// Check if already enrolled
var status = await sdk.LprMonitorStatusCheckAsync(externalId);
if (status.Enrolled)
{
await sdk.LprUnMonitorAsync(externalId);
}
// Create the LprMonitorRequest
var request = new LprMonitorRequest
{
Plate = "ABC123",
MonitorReason = "Example",
Tags = new List<TagInfoItem> { new TagInfoItem { TagName = "VIP" } },
AdditionalFields = new List<AdditionalFieldItem> { new AdditionalFieldItem { FieldName = "Note", FieldValue = "Important vehicle" } }
};
// Monitor the license plate
await sdk.LprMonitorAsync(externalId, request);
# Define variables
API_URL="https://your-domain.com/eventsbridge"
TOKEN="your_token"
EXTERNAL_ID="12345"
# Check status
STATUS=$(curl -X GET "$API_URL/api/v1/lpr/monitor/$EXTERNAL_ID" \
-H "Authorization: Bearer $TOKEN" | jq -r '.enrolled')
if [ "$STATUS" == "true" ]; then
curl -X DELETE "$API_URL/api/v1/lpr/monitor/$EXTERNAL_ID" \
-H "Authorization: Bearer $TOKEN"
fi
# Create JSON request
REQUEST=$(cat <<EOF
{
"plate": "ABC123",
"monitorReason": "Example",
"tags": [{"tagName": "VIP"}],
"additionalFields": [{"fieldName": "Note", "fieldValue": "Important vehicle"}]
}
EOF
)
# Monitor the license plate
curl -X PUT "$API_URL/api/v1/lpr/monitor/$EXTERNAL_ID" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "$REQUEST"
# Define variables
$API_URL = "https://your-domain.com/eventsbridge"
$TOKEN = "your_token"
$EXTERNAL_ID = "12345"
# Check status
$statusResponse = Invoke-RestMethod -Uri "$API_URL/api/v1/lpr/monitor/$EXTERNAL_ID" -Method Get -Headers @{ "Authorization" = "Bearer $TOKEN" }
if ($statusResponse.enrolled) {
Invoke-RestMethod -Uri "$API_URL/api/v1/lpr/monitor/$EXTERNAL_ID" -Method Delete -Headers @{ "Authorization" = "Bearer $TOKEN" }
}
# Create request body
$requestBody = @{
plate = "ABC123"
monitorReason = "Example"
tags = @(
@{
tagName = "VIP"
}
)
additionalFields = @(
@{
fieldName = "Note"
fieldValue = "Important vehicle"
}
)
} | ConvertTo-Json
# Monitor the license plate
Invoke-RestMethod -Uri "$API_URL/api/v1/lpr/monitor/$EXTERNAL_ID" -Method Put -Headers @{ "Authorization" = "Bearer $TOKEN" } -Body $requestBody -ContentType "application/json"
Raw Sample
Here's an example of how to use the PUT method to monitor a license plate:
Request
PUT https://10.0.0.123:5022/api/v1/lpr/monitor/ABC123
Authorization: Bearer <your_jwt_token>
Content-Type: application/json
{
"plate": "ABC123",
"monitorReason": "Suspicious Activity",
"tags": [{ "tagName": "Banned" }],
"additionalFields": [
{
"fieldName": "TenantID",
"fieldValue": "XYZ987"
}
]
}
Response
- 200 OK: The license plate has been successfully enrolled for monitoring.
- 400 Bad Request: There was an issue with the provided data (e.g., invalid plate number or missing required fields).
- 401 Unauthorized: Missing or invalid JWT token.
- 500 Internal Server Error: An issue occurred on the server side. The reason is returned in the problem details body.
Example Response
{}
The success response body is an empty object by design — LprMonitorResponse carries no fields. Treat the 200 status code as the result, and do not expect any properties to read.
Additional Notes
- Ensure that the
externalIdprovided in the URL matches the one used in your system to identify the vehicle uniquely. It is case sensitive. - The
platefield must contain the correct license plate number for accurate monitoring. - This endpoint both creates and updates. Sending a second PUT for an
externalIdyou already enrolled replaces the stored record rather than creating a duplicate. - Enrollment is not necessarily instant across every connected server. Use Retrieve All Monitored License Plates to confirm the plate reached all of them.