Create alerts
Use the POST v1/alerts/inventory web service to create alerts for your account.
URI
https://<hostname>/ws/v1/alerts/inventory
API Usage
There are no parameters for the POST ws/v1/alerts/inventory API.
Specify an HTTP header of Content-Type: application/json and post json payload describing the alert or alerts.
Request Payload
To create multiple alerts, use a list syntax. For a single alert, the list syntax is not required.
[
{ ...alert1 },
{ ...alert2 },
...
{ ...alertN }
]
Successful Response
Upon success, the alert is returned. The returned alert may differ from the input alert because default values are supplied in the returned alert. A list response is returned whether the POST created single or multiple alerts.
{
"count": N,
"list" : [
{ ...alert1 },
{ ...alert2 },
...
{ ...alertN },
]
}
Error Response
When creating multiple alerts, if any alert is successfully created, a response of 207 and error information for the failed responses are returned.
In the following example response payload, the second alert failed. The HTTP response is 207 because one alert (alert1) was created successfully, and the second item in the list has error values indicating the problem with the second alert (alert2).
{
"count": N,
"list": [
{ ...alert1 },
{
"error_context": { ...alert2 },
"error_message": "The error message",
"error_status": 400
},
{ ...alertN }
]
}
Sample Alert Definitions
The following sample payloads represent the different alert types.
Dia channel data point condition match
Missing Smart Energy DataPoint
Smart energy data point condition match