Hi,
I was able to create a new alarm definition using Milestone VMS Restful API with empty id in sourceList Json array, but I’m also need to assign the corresponding id that comes from defined UserDefinedEvents that was automatically created when I’m creating a new Generic Event through same API. How to get these ID?
Please, see the screenshot attached using POSTMAN for more information.
Best regards,
Ramzi
You can get all the generic events by a GET -
/API/rest/v1/genericevents
or you can get all the user-defined events by a GET -
/API/rest/v1/userdefinedevents
From your question I have a feeling you might mix Generic Event and User-defined Event, the two are not the same and that is why I have presented two get statements above.
Hi Mr. Anderson,
Thanks for your reply.
I understood your point of view, but my issue is not the same. Let me explain it more in details.
I have one of our plugin that already use Generic Events from Milestone. The tool that I’ve developed automatically create Generic Events in Milestone Management server and Read them back using HTTPS GET command. This works great.
Now I’ve discovered each time you create a new Generic Event, it will automatically create a hidden UserDefinedEvent that is not listed in the UserDefinedEvent menu in the management server of Milestone, but we can have the list when you try to create a new Alarm Definition and specify in the sourceList, the external event type.
I need to get that UserDefinedEvent list to be able to retreive the Ids and be able to create new Alarm Definition using HTTPS POST command from REST API.
I’ve tested the GET command of userdefinedevents using POSTMAN and I’ve got only Milestone system userdefined Events, not the ones that I’m looking for. Please see the different screenshots for more details.
Thanks in advance for your support.
Best regards,
Ramzi
The necessary information is not exposed when asking for generic events. I will be opening a case with Milestone Development so that this can be corrected for future versions.
There is a way to get the information in place, please use as a workaround.
When starting to create a rule, like:
POST https://serverurl/api/rest/v1/rules?definitions
With content
{
“name” : “test”,
“startRuleType” : “Event”,
“startEventGroup” : “GenericEvents”
}
You will get a response – look way down in the definitions, and see the list of available Generic Events:
“startEventType”: {
"canSet": true,
"options": \[
{
"value": "047d12c3-f69a-4fc9-a8b7-ed3acb853608",
"displayName": "ABCsGen - nr 2"
},
{
"value": "eaec8d68-020d-420e-ac83-e9189092dcbd",
"displayName": "ABCsGen"
}
\],
"valueType": "enum",
"translationId": "PropertyRuleStartEventType"
}
Hi M. Anderson,
Thanks for your feedback on this topic. It is appreciate.
I’ve tested with POSTMAN and it works great as expected. See below the results.
Thanks again for your support,
Best regards,
Ramzi