Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Showing a KPI with the number of open alerts

Devis Lucato edited this page Jun 27, 2017 · 5 revisions

Step 1: Get the list of alerts

Get the total count of open or acknoledged alerts, without actually fetching the alerts data, i.e. use totalcount=y and limit=0.

Request

GET {Device Telemetry endpoint}/alerts?status=!closed&limit=0&totalcount=y

Response

Content-Type: application/json; charset=utf-8

{
    Count: 0
    TotalCount: ...
    Items: []
    "$metadata": {
        $type: AlertsList;1
        $uri: ...
    }
}

Step 1: Render the KPI in the UI

Use the TotalCount property from the response to show the KPI.