getSituationIds
A Graze API GET request that returns the total number of Situations, and a list of their Situation IDs, for a specified Situation filter and a limit.
Note
Take special care when using endpoint getSituationIds
. Overuse of this endpoint can have a negative impact on the backend datastore.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint getSituationIds
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| String | Yes | An SQL-like filter that Situations must match to be returned.. See Filter Search Data for more information on creating SQL-like filters. |
| Number | Yes | Maximum number of Situation IDs to return. |
Response
Endpoint getSituationIds
returns the following response:
Successful requests return a JSON object containing the following:
Name | Type | Description |
---|---|---|
| Number | Total number of Situations, or unique Situations. |
| List | A list of Situation IDs. |
Examples
The following examples demonstrate typical use of endpoint getSituationIds
:
Request example
Example cURL request to get the first 20 Situation IDs that match the query where the description is "lon_storage_636728" or the queue is 5:
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getSituationIds" \ --data-urlencode 'query=description="lon_storage_636728" or queue = 5' \ --data-urlencode 'limit=20'
Response example
Example response returning seven Situation IDs that match the query:
{ "total_situations":7, "sitn_ids":[87,121,128,278,523,1003,1519] }