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} - 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.
Request Body
The PUT request requires the following data to be passed in the body of the request.
Required Fields
plate: The license plate number of the vehicle to be monitored.
Optional Fields
- monitorReason: The reason for monitoring the vehicle (e.g., "Security Alert", "VIP Monitoring", etc.).
- tags: An array of tags to categorize the vehicle (e.g., "VIP", "Banned", etc.).
- additionalFields: Any extra information that you would like to store alongside the plate, such as a TenantID or other custom data.
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: