Moogsoft Docs

rateSituation

A MoogDb v2 method that applies a rating to a specified Situation.

Request arguments

Method rateSituation takes the following request arguments.

Name

Type

Required

Description

situationId

Number

Yes

ID of the Situation you want to rate.

rating

Number

Yes

comment

String

No

A comment about the rating you are applying to the Situation.

Response

Method rateSituation returns the following response:

Type

Description

Object

A Javascript object containing rating, comment, and sig_id of the rated Situation.

API update behavior

The behavior of this method depends on whether the relevant Situation is open, closed and still in the active database, or closed and archived to the historic database. This method updates the Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method rateSituation:

Request example

Example request to apply a rating of 4 to Situation ID 18 with a comment "Rating 4":

var success = moogdb.rateSituation(18, 4, "Rating 4");
Response example

Example response returning the rating number, comment and ID of the rated Situation:

{"rating":4,"comment":"Rating 4","sig_id":18}