Skip to main content

getSimilarSituations

A Graze API GET request that returns the details of similar Situations for a specified Situation and a limit.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getSimilarSituations 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.

sitn_id

Number

Yes

ID of the Situation that you want to retrieve similar Situations for.

limit

Number

No

Maximum number of Situations to return. Default is 100.

Response

Endpoint getSimilarSituations returns the following response:

Successful requests return an array of JSON objects containing the following:

Name

Type

Description

similarities

Array

A list of Situations with similarity details. For each similar Situation:

  • sim_sig_id: ID of the similar situation.

  • similarity: Similarity value.

  • resolving_steps_count: Number of resolving steps that the similar Situation has.

similar_count

Number

Number of similar Situations.

sig_id

Number

ID of the Situation that you requested to retrieve similar Situations for.

Examples

The following examples demonstrate typical use of endpoint getSimilarSituations:

Request example

Example cURL request to return Situations that are similar to Situation ID 38:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSimilarSituations" \ --data-urlencode "sitn_id=38" \ --data-urlencode "limit=20"

Response example

Example response returning details of two Situations, IDs 39 and 40, that are similar to Situation ID 38:

{
    "similarities":[
    {
        "sim_sig_id":39,
        "similarity":1.0,
        "resolving_steps_count":0
    },
    {
        "sim_sig_id":40,
        "similarity":1.0,
        "resolving_steps_count":0
    }],
    "similar_count":2,
    "sig_id":38
}