Problem triggering alarm from analytics event using XML API - "Event message not known"

Hi. I am trying to programmatically trigger an event which should subsequently trigger an alarm which will appear in the Alarm Manager. I manage to successfully trigger an event via the API, however, I get the warning message: “Event message not known”. The tag in my XML string corresponds with the Name of the Analytics Event I am trying to trigger, which is linked to the “source” an Alarm Definition - with the same name. Please see detailed steps I took.

  • In the management client, I created a new Analytics Event and named it ‘test_event’
  • I then created a new Alarm definition and set the “Triggering Event” to the “test_event” I had just created - I set the “Sources” to the first 3 camera channels on my NVR (Recording Server)
  • When I click the “Test Event” button on my Analytics Event, it successfully triggers the alarm and I can see it appear in the Alarm manager on the Smart Client

I then attempted to trigger the event programmatically using the XML Analytics Events API Trigger via a Socket. My request returns a Success with status code 200, however, the alarm does not appear in the alarm manager on the Smart Client, furthermore, the requests gives the warning message “Event message not known”. Please see below, the XML string I am using in my request

00000000-0000-0000-0000-000000000000

2023-07-20T09:14:39.7342498+01:00

test_event

test_event

192.168.10.55,0

As you can see, I am setting the tag to “test_event” which, according to the documentation, is supposed to correspond with the name of the Analytics Event that is linked to the alarm (in order to trigger the alarm). Under the tag, I am specifying the IP address of the NVR followed by the channel number (delimited by a comma)

According to the documentation, if the tag is not set correctly to correspond with the correct Analytics Event linked to the Alarm Definition, then the alarm will not be triggered. Furthermore, If I specify the wrong input source for the event that does not correspond to the list of sources on the alarm definition, then the event will not be triggered.

I just don’t see what I’m doing wrong. My tag aligns with my Event Name (I set the Alarm Name to the same thing, just in case) and then the IP address of the NVR along with the channel number is correct according to the alarm definition. I followed these documentation entries:

https://doc.developer.milestonesys.com/html/index.html?base=samples/protocolsamples/triggeranalyticseventxml/readme.html&tree=tree_3.html

http://download.milestonesys.com/MIPSDK/Samples/TriggerAlarmFromExternal-ConceptSolution.pdf

As a second problem, I wanted to try use the FQID in the tag as opposed to the NVR IP address + Channel number. However, I cannot seem to find any API endpoints in the documentation that will provide me with the UUIDs of all the cameras connected to a device. The only endpoint I found that is remotely close to this is: `api/rest/v1/hardware` - which seems to return the UUID of the recording server. How can I use this to get the list of UUIDs of the cameras on the recording server, so that I can insert the UUID into the / tags, I am unable to find concise API documentation that shows how to achieve this.

I appreciate any help or suggestions you can provide, perhaps I am missing the mark completely in my interpretation of the docs.

TIA

How to use a camera GUID is described here: https://developer.milestonesys.com/s/article/send-analytics-event-using-the-camera-GUID

I cannot reproduce any issue when trying to use the bit of XML you show here, it works for me. Double check that the Analytics Event is test_event, if recently renamed see if a restart of the Event Server makes a difference.

There might be an error message in the Event Server logs that could be a clue for why it malfunctions.

[C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) Event Server\logs

Hi. Thank you for the answer. I see how I can include the Camera UUID using the field. However, how do I actually get the camera UUID. I cannot seem to find an endpoint that can dump me a list of all the devices / cameras connected to a server. Where do I get this info using the REST API ?

GET /Cameras

https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/#tag/DeviceConfig/operation/getAllcameras

Tip: The link leads to the general documentation to the Rest API, if you haven’t already used it you should see the Introduction- Get started section.

I managed to solve it. It seemed that the Python XMLTree package was formatting my XML weirdly. When I send the xml as a raw string, it works.