Alerts
You can raise alerts on a farm whenever you need to get a user's attention.
The following method is available over the Web API:
Method | Description |
---|---|
alerts.raise |
Create a new alert |
Web API alerts.raise
Creates a new alert on the farm.
Method URI | https://api.fieldmargin.com/v1/alerts.raise
|
---|---|
HTTP Method | POST |
Required scopes | alerts:write |
Request
Example request
{
"alert": {
"message": "Temperature in grain store out of acceptable range",
"timestamp": "2018-03-07T07:20:12Z",
"level": "medium"
}
}
The following fields may be set on an alert:
Field | Required | Description |
---|---|---|
message |
Required | Human readable message to be shown to the user |
timestamp |
Required | When the alert was raised |
level |
Required | The severity of the alert |
sensor_id |
Optional | If the alert relates to a sensor, the ID of it |
vehicle_id |
Optional | If the alert relates to a vehicle, the ID of it |
The alert level should be one of the following:
Level | Description | Example |
---|---|---|
low |
There is no urgency to this issue | Tractor is low on fuel |
medium |
Work will be disrupted and action needs to be taken soon | Tractor broken down |
high |
A high urgency issue that requires immediate attention | Tractor on fire |
Response
The response will contain the request with the addition of an alert ID we have generated. The timestamp
field accepts a time zone but will be converted to UTC in the response.