A Graze API POST request that applies a rating to a specified Situation.
Back to Graze API EndPoint Reference.
Endpoint rateSituation
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Long | Yes | ID of the Situation you want to rate. |
| Integer | Yes | |
| String | No | A comment about the rating you are applying to the Situation. |
Endpoint rateSituation
returns the following response:
Successful requests return a JSON object containing the following:
Name | Type | Description |
---|---|---|
| Number | Rating number applied to the Situation. |
| String | Comment applied to the Situation. |
| Number | ID of the Situation that the rating was applied to. |
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.
The following examples demonstrate typical use of endpoint rateSituation
:
Example cURL request to apply a rating of 4 to Situation ID 18 with a comment "Rating 4":
curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/rateSituation" -H "Content-Type: application/json; charset=UTF-8" -d '{"sig_id" : 18, "rating" : "4", "comment" : "Rating 4"}'
Example response returning the rating, comment and Situation ID:
{"rating":4,"comment":"Rating 4","sitn_id":18}