This repository was archived by the owner on Oct 11, 2023. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 35
Showing all the open alerts
        Hector Garcia Tellado edited this page Oct 31, 2017 
        ·
        1 revision
      
    To show the open alerts in the user interface, the client should show them in pages, starting from the most recent.
To retrieve all the alerts regardless of the device, the UI invokes the Device Telemetry web service without passing a list of devices. On the other hand, it's also possible to request alerts for a list of devices, using the same syntax used to retrieve telemetry.
In this example, the UI retrieves the 10 most recent alerts. If there are more alerts, the $metadata field will contain a link to the next page.
Request with GET:
GET {Device Telemetry endpoint}/alerts?status=!closed&from={time}&to={time}&order=desc&limit=10
Content-Type: application/json; charset=utf-8
{
    Count: ...
    Items: [
        {
            deviceid
            time
            description
            status (open | acknowledged)
            $metadata
        },
        {
            deviceid
            time
            description
            status (open | acknowledged)
            $metadata
        },
        ...
    ]
    "$metadata": {
        $type: AlertsList;1
        $uri: ...
        $next: {Device Telemetry endpoint}/alerts?status=!closed&from={time}&to={time}&order=desc&limit=10&skip={...}
    }
}