Re: How do I create event detectors using the Mango API?
Hi all,
I see that event-detectors is now part of the API :)
I'm trying to create multiple event detectors for the same multi-state data point; is that possible to do in one single step?
At the moment I'm trying to do a single event detector using the POST method through the API and using this code (obtained via GET for another data point, and changing the xid, dataSourceId and dataPointId) -- it doesn't work, though, and I get an error 500 back.
{
"xid": "socket_2026-vacant",
"name": "Socket 2026 is vacant",
"duration": 0,
"durationType": "SECONDS",
"alarmLevel": "INFORMATION",
"supportedDataTypes": [
"MULTISTATE"
],
"description": "Socket 2026 is vacant",
"alias": "Socket 2026 is vacant",
"eventType": {
"dataSourceId": 229,
"dataPointId": 400,
"duplicateHandling": "IGNORE",
"typeName": "DATA_POINT",
"rateLimited": false
},
"rtnApplicable": true,
"detectorSourceType": "DATA_POINT",
"validationMessages": [],
"detectorType": "MULTISTATE_STATE"
}
I want these event detectors to be created immediately after the data points are created, so I'm using response.data.id and response.data.dataSourceId to get this info.
I would think that these two ids are enough to link the event detector with the data point? What am I doing wrong here? And can I create multiple event detectors at once?
Thanks and sorry for so many questions ^^U
Silvia