closeSituation

A Graze API POST request that closes a specified Situation which is currently open, and optionally closes alerts in the Situation.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint closeSituation 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

Situation ID.

resolution

Number

Yes

Determines what to do with the alerts in the Situation:

  • 0 = Close no alerts.

  • 1 = Close all alerts in this Situation.

  • 2 = Close only alerts unique to this Situation.

Response

Endpoint closeSituation returns the following response:

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 closeSituation:

Request example

Example cURL request to close Situation 7 and leave all its alerts open:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/closeSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{"sitn_id" : 7, "resolution" : 0 }'

Response example