Search documentation
karat

+

K

User Documentation ↗
Version 2.0

Get Query

GET/api/v2/functions/queries/{queryApiName}
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Gets a specific query type with the given API name. By default, this gets the latest version of the query.

Third-party applications using this endpoint via OAuth2 must request the following operation scope: api:functions-read.

Path parameters

queryApiName
string

The name of the Query in the API.

Query parameters

version
stringoptional

The version of the given Function, written <major>.<minor>.<patch>-<tag>, where -<tag> is optional. Examples: 1.2.3, 1.2.3-rc1.

preview
booleanoptional

Enables the use of preview functionality.

Response body

Query
object
Hide child attributes

Hide child attributes

apiName
string

The name of the Query in the API.

description
stringoptional
displayName
stringoptional

The display name of the entity.

parameters
map<ParameterId, Parameter>optional
Show child attributes

Show child attributes

output
union

A union of all the types supported by Query parameters or outputs.

Show child attributes

Show child attributes

rid
string

The unique resource identifier of a Function, useful for interacting with other Foundry APIs.

version
string

The version of the given Function, written <major>.<minor>.<patch>-<tag>, where -<tag> is optional. Examples: 1.2.3, 1.2.3-rc1.

typeReferences
map<TypeReferenceIdentifier, QueryDataType>optional
Show child attributes

Show child attributes

Examples

Request

Copied!
1 2 3 curl \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v2/functions/queries/myQueryFunction?version=1.2.3&preview=true"

Response

Copied!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "output": { "type": "integer" }, "apiName": "myQueryFunction", "displayName": "My Entity", "rid": "ri.function-registry.main.function.8cb2d957-f0e6-4e0c-81de-e701bd54b18c", "typeReferences": { "MyTypeReference": { "type": "integer" } }, "parameters": { "price": { "dataType": { "type": "integer" } } }, "version": "1.2.3" }

Error responses

Error Name
QueryNotFoundError CodeNOT_FOUND
Status Code404
DescriptionThe given Query could not be found.
ParametersqueryApiName