Query Workers
Import custom query workers
Import custom queries.
post/_fabric/{fabric}/_api/restql/import
Request
- The document declares no server URL.
- Auth
- API key in header Authorization
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
fabricstring string required
Fabric name for which to import queries.
Request body
Example request
{
"queries": [
{
"name": "testQueryName",
"value": "for u in testCollection return u",
"parameter": {},
"type": "c8ql"
}
]
}Response
Successfully imported queries.
If there are any errors, an additional header X-C8-Error-Codes is set, that contains a map of the error codes that occurred together with their multiplicities, as in: 1205:10,1210:17 which means that in 10 cases the error 1205 "illegal document handle" and in 17 cases the error 1210 "unique constraint violated" has happened. The response body has additional failed document details in details object.
Example response
{
"code": 200,
"result": {
"created": 10,
"details": {
"errors": [
{
"errorNumber": 102022,
"errorMessage": "The error message"
}
]
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.