Skip to main content

getSimilarSituationIds

A Graze API GET request that returns a list of IDs of similar Situations, for a specified Situation ID and a limit.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint getSimilarSituationIds 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 Situation IDs to return. Defaults to 100.

Response

Endpoint getSimilarSituationIds returns the following response:

Successful requests return a JSON object containing the following:

Name

Type

Description

similarity_ids

Array of Numbers

List of IDs 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 getSimilarSituationIds:

Request example

Example cURL request to return the first 10 Situation IDs that are similar to Situation ID 1043:

curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSimilarSituationIds" \
--data-urlencode "sitn_id=1043" \
--data-urlencode "limit=10"

Response example

Example response returning the Situation IDs that are similar to Situation ID 1043:

{
    "similarity_ids": [ 43,156,177,221,576,1026,1327 ], 
    "sig_id": 1043
}