When a Generic Event triggers, the system requires specific metadata to link that event to a physical device. If the deviceIds field is missing from the API request, the server cannot identify which camera needs to generate a thumbnail or record a bookmark.
This guide explains how to resolve this issue by adding device IDs directly to your API request, or by using a workaround for limited third-party devices.
Add device IDs to the API request
If you have control over the JSON body of the API request, the most direct solution is to include the deviceIds field.
API Endpoint
POST http://<serverIp>:7001/rest/v4/events/generic
Request Body Examples
For a single camera, use the following structure:
{
"deviceIds": [
"<deviceId1>"
]
}For multiple cameras, list all applicable IDs:
{
"deviceIds": [
"<deviceId1>",
"<deviceId2>"
]
}| NOTE: You can find the unique Device IDs via the Desktop Client or REST API. Detailed instructions can be found HERE |
Route metadata using an internal HTTPS request
Some third-party devices or applications use fixed fields (such as Source, Caption, or Description) and do not let you modify the JSON body.
To work around this limitation, create two separate rules in the Rules Engine triggered by the same generic event. The first rule acts as a proxy to send the required metadata back to the server, while the second rule handles the user notification.
Step 1: Create the identification and bookmarking rule
This rule intercepts the limited event and sends the missing device IDs back to the server.
Open the Rules Engine.
Set the Event to Generic Event and configure it to match your source or caption you used in the 3rd party application.
Set the Action to Internal HTTPS Request.
Configure the request using the
POSTmethod and JSON body structure shown in How to create HTTP Generic Events article.
Step 2: Create the user notification rule
This rule handles the visual alert for the operator. Because Step 1 successfully links the event to the correct cameras, this notification can now display the associated thumbnails.
Create a second rule in the Rules Engine.
Set the Event to Generic Event using the same criteria as Step 1.
Set the Action to Show Desktop Notification.
Optional: Select Force Acknowledgment if your workflow requires operators to dismiss the alert manually.
NOTE: Ensure the identifiers (Source, Caption, or Description) for your second rule are unique and distinct from the first rule. This allows the first rule to trigger the second sequentially. If the identifiers are identical, both rules will trigger simultaneously and the workaround will fail. |
Comments
0 comments
Article is closed for comments.