Moogsoft Docs

mergeSituations

A Graze API POST request that merges multiple specified Situations. You can configure whether or not the new Situation supersedes the original Situations using the supersede_original parameter.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint mergeSituations takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. See the authenticate endpoint for more information.

situations

List

Yes

An array of the Situation IDs you want to merge. Specify using Situation IDs, separating each item with a comma.

supersede_original

Boolean

Yes

Determines whether or not the original merged Situations are superseded by the new Situation.

Response

Endpoint mergeSituations returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

sitn_id

Number

ID of the new merged Situation.

API update behavior

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

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of endpoint mergeSituations:

Request example

Example cURL request to merge Situations 31, 32, and 33 without superseding the original Situations by the new one:

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/mergeSituations?auth_token=c4316d2cac524b96a1e4c787b68f7e3f&situations=%5B31%2C32%2C33%5D&supersede_original=false"
Response example

Example response returning the ID of the new merged Situation:

{"sitn_id":30}