getSituationSeverityChanges
A Graze API GET request that returns the changes in severity for a Situation. The highest severity of any of the alerts in a Situation determines the severity of the Situation. This endpoint returns increases in severity and a change to a severity of 0 (Clear). If a Situation has closed, this endpoint returns a severity of 0 (Clear) and the timestamp when the Situation was closed. The endpoint does not return any further changes in severity after it has returned to 0 (Clear).
Back to Graze API EndPoint Reference.
Request arguments
Endpoint getSituationSeverityChanges
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Number | Yes | ID of the Situation you want to return severity changes for. |
Response
Endpoint getSituationSeverityChanges
returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| Number | The time when the severity change occurred. This is a Unix epoch timestamp in seconds. |
| Number | The new severity of the Situation: |
Examples
The following examples demonstrate typical use of endpoint getSituationSeverityChanges
:
Request example
Example cURL request to return the severity changes for Situation ID 234:
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationSeverityChanges" \ --data-urlencode "sitn_id=234"
Response example
Example response returning the severity changes for the Situation. The response shows increases in severity and the change to a severity of 0 (Clear).
[ { "timestamp": 1580193608, "severity": 4 }, { "timestamp": 1580193660, "severity": 5 }, { "timestamp": 1580193667, "severity": 0 } ]