rateSituation
A Graze API POST request that applies a rating to a specified Situation.
Back to Graze API EndPoint Reference.
Request arguments
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. |
Response
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. |
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 rateSituation
:
Request example
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"}'
Response example
Example response returning the rating, comment and Situation ID:
{"rating":4,"comment":"Rating 4","sitn_id":18}