Search documentation
karat

+

K

User Documentation ↗

Execute Query

POST/api/v1/ontologies/{ontologyRid}/queries/{queryApiName}/execute

Executes a Query using the given parameters. Optional parameters do not need to be supplied. Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Path parameters

ontologyRid
string

The unique Resource Identifier (RID) of the Ontology that contains the Query. To look up your Ontology RID, please use the List ontologies endpoint or check the Ontology Manager.

queryApiName
string

The API name of the Query to execute.

Request body

ExecuteQueryRequest
object
Hide child attributes

Hide child attributes

parameters
map<ParameterId, DataValue>
optional
Show child attributes

Show child attributes

ParameterId
string

The unique identifier of the parameter. Parameters are used as inputs when an action or query is applied. Parameters can be viewed and managed in the Ontology Manager.

DataValue
any

Represents the value of data in the following format. Note that these values can be nested, for example an array of structs.

TypeJSON encodingExample
Arrayarray["alpha", "bravo", "charlie"]
Attachmentstring"ri.attachments.main.attachment.2f944bae-5851-4204-8615-920c969a9f2e"
Booleanbooleantrue
Bytenumber31
DateISO 8601 extended local date string"2021-05-01"
Decimalstring"2.718281828"
Floatnumber3.14159265
Doublenumber3.14159265
Integernumber238940
Longstring"58319870951433"
Markingstring"MU"
Nullnullnull
Object Setstring OR the object set definitionri.object-set.main.versioned-object-set.h13274m8-23f5-431c-8aee-a4554157c57z
Ontology Object ReferenceJSON encoding of the object's primary key10033123 or "EMP1234"
Setarray["alpha", "bravo", "charlie"]
Shortnumber8739
Stringstring"Call me Ishmael"
StructJSON object{"name": "John Doe", "age": 42}
TwoDimensionalAggregationJSON object{"groups": [{"key": "alpha", "value": 100}, {"key": "beta", "value": 101}]}
ThreeDimensionalAggregationJSON object{"groups": [{"key": "NYC", "groups": [{"key": "Engineer", "value" : 100}]}]}
TimestampISO 8601 extended offset date-time string in UTC zone"2021-01-04T05:00:00Z"

Response body

ExecuteQueryResponse
object

Success response.

Hide child attributes

Hide child attributes

value
any

Represents the value of data in the following format. Note that these values can be nested, for example an array of structs.

TypeJSON encodingExample
Arrayarray["alpha", "bravo", "charlie"]
Attachmentstring"ri.attachments.main.attachment.2f944bae-5851-4204-8615-920c969a9f2e"
Booleanbooleantrue
Bytenumber31
DateISO 8601 extended local date string"2021-05-01"
Decimalstring"2.718281828"
Floatnumber3.14159265
Doublenumber3.14159265
Integernumber238940
Longstring"58319870951433"
Markingstring"MU"
Nullnullnull
Object Setstring OR the object set definitionri.object-set.main.versioned-object-set.h13274m8-23f5-431c-8aee-a4554157c57z
Ontology Object ReferenceJSON encoding of the object's primary key10033123 or "EMP1234"
Setarray["alpha", "bravo", "charlie"]
Shortnumber8739
Stringstring"Call me Ishmael"
StructJSON object{"name": "John Doe", "age": 42}
TwoDimensionalAggregationJSON object{"groups": [{"key": "alpha", "value": 100}, {"key": "beta", "value": 101}]}
ThreeDimensionalAggregationJSON object{"groups": [{"key": "NYC", "groups": [{"key": "Engineer", "value" : 100}]}]}
TimestampISO 8601 extended offset date-time string in UTC zone"2021-01-04T05:00:00Z"

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ -H "Content-type: application/json" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/queries/getEmployeesInCity/execute" \ -d '{"parameters":{"city":"New York"}}'

Response

Copied!
1 2 3 4 5 6 7 { "value": [ "EMP546", "EMP609", "EMP989" ] }