Skip to main content

getNewAlertsStats

A GET request that returns the number of new alerts in the specified time range.

Back to Stats API.

Request arguments

Endpoint getNewAlertsStats takes the following request arguments.

Response

Endpoint getNewAlertsStats returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

target

String

"New Alerts"

datapoints

Number Array

An array of data points. Each data point is an array in the format [data point, timestamp]:

  1. Data point: Number of alerts

Examples

The following examples demonstrate typical use of endpoint getNewAlertsStats:

Request example

Example cURL request to retrieve the number of new alerts between Wednesday, January 17th and Thursday, January 18th 2018:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getNewAlertsStats" --data-urlencode 'from=1516216020' --data-urlencode 'to=1516282420'

Response example

Example response that indicates there were 28,542 new alerts over the 24 hour time period: :

[
        {"datapoints":[
                [28542.0,1523438216685]
        ],
        "target":"New Alerts"}
]