Skip to main content

Read from Query

Motivation

Read from a query function using API

Functional design

GET /api/v2/apps/{owner}/{app}/workspaces/{wsid}/queries/{pkg}.{query}

Headers

KeyValue
AuthorizationBearer {PrincipalToken}

Parameters

ParameterTypeDescription
Path
ownerstringname of a user who owns the application
appstringname of an application
wsidint64the ID of workspace
pkg, querystringidentifies a query
Query
constraintsOptional query constraints
argsURL-encoded JSON-objectOptional query function arguments
Headers
PrincipalTokenstringToken returned by login

Result

CodeDescriptionBody
200OKSON object that contains a results field with a JSON array that lists the objects. When the error happens during the read, the error property is added in the response
401Unauthorizederror object
403Forbiddenerror object
404Query Function Not Founderror object

Example

Example execution of the sys.Echo query function with arguments: {"Text": "Hello world"} :

GET /api/v2/apps/test1/app1/workspaces/140737488486402/queries/sys.Echo?args=%7B%22Text%22%3A%22Hello+world%22%7D

Response:

{ 
"results": [
{
"Res":"Hello world",
"sys.Container":"Hello world",
"sys.QName":"sys.EchoResult"
}
]
}