updateClosedSituation
A Graze API POST request that updates the description and custom info of a closed Situation during the grace period. The grace period is when a Situation is closed and in the active database, before it is archived to the historic database. If a custom_info value is provided to the endpoint, it will overwrite any custom_info currently stored against the Situation.
The updateClosedSituation
endpoint returns an error if the Situation is open, or if it is closed and has been archived to the historic database.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint updateClosedSituation
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Number | Yes | ID of the closed Situation that you want to update. |
| String | No | New description of the Situation. |
| JSON Object | No | A JSON object containing the custom info values that you want to update. If the key already exists, the endpoint replaces the existing value. If the key does not exist, the endpoint adds it. |
Response
Endpoint updateClosedSituation
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 updateClosedSituation
:
Request examples
Request example to replace description and custom info
Example cURL request to update the description and custom info for Situation ID 555. The description
value "new_desc" replaces the previous value. If the custom info fields field1
and field2
did not exist, the endpoint adds them. If the custom info fields field1
and field2
did previously exist, the endpoint overwrites them with the values "value1" and "value2".
curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateClosedSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{ \ "sitn_id" : 555, \ "description":"new_desc", \ "custom_info": { \ "field1": "value1", \ "field2": "value2" \ } \ }'