Skip to content

Alerts

An alert is a notice to be sent to a user when a particular event occurs. The endpoints alert and alerts manage alerts.

Alert Object

AmpliFi represents alerts by a JSON object. This table lists properties that may be included in an alert object.

Property Type Required? (default) Description
alertTypeId string yes name of alert type
category string no (none) category of this alert
name string yes name of this alert
isEnabled boolean yes true if alert is enabled
descriptionOn string no (none) event that begins alert
descriptionOff string no (none) event that ends alert

List Alerts

GET /alerts/

This API gets an array of all alerts that are enabled for the current user.

Response Body:

  {
    "alerts": [ // array of alert objects
    ]
  }

Sync Alerts

POST /alerts/

Synchronize a set of alerts with the corresponding alerts on the user's device, to be sure the local device and the server have the latest alerts.

Request Body:

[ // array of alert objects to be synchronized
]

Response:

  {
    "alerts": [ // array of alert objects, possibly updated
    ]
  }

Modify Alert

GET /alert/:alertTypeId

Modify a specific alert. The alert type is identified by a path parameter. The request body specifies the properties to be changed.

Request Body example:

  {
    "isEnabled": true
  }

Response Body:

  {
    "success": true
  }