Skip to main content

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

auth_token

String

Yes

A valid auth_token returned from the authenticate request. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

sig_id

Long

Yes

ID of the Situation you want to rate.

rating

Integer

Yes

comment

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

rating

Number

Rating number applied to the Situation.

comment

String

Comment applied to the Situation.

sitn_id

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}