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

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

sitn_id

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

timestamp

Number

The time when the severity change occurred. This is a Unix epoch timestamp in seconds.

severity

Number

The new severity of the Situation:

API update behavior

The behavior of this endpoint depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This endpoint updates the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

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
  }
]