Searching:
0 results foundAlarmInstances/Post
Description
In order to create a new AlarmInstance, see the following for request and response details:
See Also
Request ‒ AlarmInstances/Post
Property | Type | Description | Mandatory |
deviceId | String | The unique identifier of the Device on which the AlarmInstance occurred. | Y |
typeCode | Integer | The typeCode of the event that triggered the AlarmInstance. See Defining a Device Event Manifest for more information. | Y |
value | String | The value of the Event that triggered the AlarmInstance. | Y |
readingDateTime | DateTime | The timestamp of the Event (reading) that triggered the Alarm. | |
readingDateTimeOffset | DateTimeOffset | Same as readingDateTime with a different date structure. | Y |
ruleId | String | The unique identifier of the Rule that created this AlarmInstance when its conditions were met. | Y |
eventName | String | The name of the Event that triggered the Alarm. | |
severity | String/Enum | The severity defined by the Rule:
|
Y |
status | String/Enum | The status of the AlarmInstance:
After an AlarmInstance is triggered by a Rule, its status is Open (0). An AlarmInstance can then be Closed (1) in the Axonize Portal or through the API. |
Y |
snoozeExpirationDate | DateTime | Until this date has passed, the Rule does not send repeat notifications.
This initial recurrence is described in the Rule in the actions/ruleRecurrenceSettings/repeatFrequency property. |
|
message | String | A free-text message describing what occurred. For example, Temperature Is Too High. | |
appId | String | A unique Application identifier that is automatically generated by Axonize. This is the identifier of the Application to which this AlarmInstance is assigned.
This identifier is automatically generated by Axonize when the Applications/Post request is used. |
Y |
Example JSON AlarmInstances/Post Request
curl -X POST \
https://api.stg.axonize.com/odata/alarminstances \
-H ‘Cache-Control: no-cache’ \
-H ‘Authorization: Token’ \
-H ‘Content-Type: application/json’ \
-H ‘appId: 801A048A-9F23-429F-BF0D-B6D35B212345’ \
-d ‘{
“deviceId”: “5b06684c21b5bc27d4412345”,
“typeCode”: 7,
“value”: “10”,
“readingDateTime”: “2018-06-21T15:04:36.70395Z”,
“readingDateTimeOffset”: “2018-06-21T15:04:36.70395+00:00”,
“ruleId”: “5b2bb87e21b5c318fc743fd0”,
“eventName”: “Temperature”,
“severity”: “Warning”,
“status”: “Open”,
“message”: “msg_default_alarmInstance_message”,
“appId”: “1aaf017c-b987-4f53-94d6-ad9af4fd2767”
}’
Response ‒ AlarmInstances/Post
All the same properties in the request are returned in the response. In addition, the response that is returned also contains the following properties –
Property | Type | Description |
id | String | A unique identifier for this AlarmInstance that is automatically generated by Axonize. |
appId | String | A unique Application identifier that is automatically generated by Axonize. This is the identifier of the Application to which this AlarmInstance is assigned.
This identifier is automatically generated by Axonize when the Applications/Post request is used. |
createDate, createUser, updateDate, updateUser |
See Common Response Properties. |
Example JSON AlarmInstances/Post Response
Status 201 – Created
{
“@odata.context”: “https://stg-axonizeapi-axonize.dev-ase-axonize.p.azurewebsites.net/odata/$metadata#AlarmInstances/$entity“,
“deviceId”: “5b06684c21b5bc27d4439f53”,
“typeCode”: 7,
“value”: “10”,
“readingDateTime”: “2018-06-21T15:04:36.70395Z”,
“readingDateTimeOffset”: “2018-06-21T15:04:36.70395Z”,
“ruleId”: “5b2bb87e21b5c318fc743fd0”,
“eventName”: “Temperature”,
“severity”: “Warning”,
“status”: “Open”,
“snoozeExpirationDate”: null,
“message”: “Warning alarm from Doneness – Soil Humidity = 50 on value 50”,
“id”: “5b58681619ec0c1a684b96a0”,
“appId”: “801A048A-9F23-429F-BF0D-B6D35B212345”,
“createDate”: “2018-07-25T12:07:50.909888Z”,
“createUser”: null,
“updateDate”: “0001-01-01T00:00:00Z”,
“updateUser”: null
}