Search documentation
karat

+

K

User Documentation ↗

Execute Query

POST/api/v2/ontologies/{ontology}/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

ontology
string

The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.

queryApiName
string

The API name of the Query to execute.

Query parameters

artifactRepository
string
optional

The repository associated with a marketplace installation.

packageName
string
optional

The package name of the generated SDK.

Request body

ExecuteQueryRequest
object
Hide child attributes

Hide child attributes

parameters
map<ParameterId, DataValue>
optional
Show child attributes

Show child attributes

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/v2/ontologies/palantir/queries/getEmployeesInCity/execute" \ -d '{"parameters":{"city":"New York"}}'

Response

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