Currently the Milestone RestAPI supports configuration, the setup of alarm definitions, setup of user-defined events ao., you cannot use it to subscribe to event and alarms happening.
If using protocols (not using the MIP Library) you should look at the Alarm List sample.
In one of the developers; videos discussing the REST interface, it was mentioned that the long-term plan is to move all the APIs to REST.
We never developed for .NET and always stayed platform-agnostic using REST or SOAP.
We already successfully implemented the REST code to log in and retrieve certain information, now, we just need to retrieve alarms and perhaps events.
When do you plan to offer this? We have quite a bit of experience supporting similar functionality with other platforms and, if helpful, we could suggest common practices.
Hi,
Thank you for the response. I am currently working with an application (non .NET environment) that uses SOAP, and I am in the process of replacing it with a REST API to subscribe to events and retrieve alarms from the management server. I attempted to create an event session and an alarm session using a POST request with the endpoint URL below.
Thank you for your example. I am now able to retrieve the session ID and the list of events after adding the session ID to the URL, and this part is working correctly.
However, I would like to understand how to verify events when they are triggered from the server.
For example, in SOAP, I have subscribed to events using the session ID (via the SubscribeEventStatus method). When I navigate to user-defined events, select an event, and click “Test Event,” I receive a notification in my application indicating that the event has been triggered.
How can I receive or verify similar event notifications when using REST?
The sessions, as outlined above is not really a subscription, you simply run the GET at a regular interval and in this way you are following the changes.
For events there is another method, that I would like to recommend instead.
The REST Configuration and REST Events documentation are, confusingly, two separate pages based on different YAML files. Here is the Events documentation.
As far as I know, it isn’t technically possible to subscribe using REST, because REST has no communication beyond direct responses to your requests. The session endpoints are the closest alternative. Since eventSession works very similarly to alarmSession, it might be worth adjusting the experiment mentioned above.