curl --request POST \
--url https://api.ctrl-hub.com/v3/queries/preview \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Session-Token: <api-key>' \
--data '
{
"data": {
"type": "queries",
"attributes": {
"name": "<string>",
"dataset": "form-submissions",
"description": "<string>",
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"decimals": 5,
"resolution": {
"projections": [
{
"path": [
"<string>"
],
"attribute": "<string>",
"label": "<string>"
}
]
}
}
],
"group_by": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"bin": {
"from": 123,
"width": 123,
"to": 123,
"thresholds": [
123
]
}
}
],
"measures": [
{
"key": "<string>",
"type": "<string>",
"percentile": 50,
"decimals": 5,
"label": "<string>"
}
],
"filters": [
{
"key": "<string>",
"op": "<string>",
"values": [
"<string>"
]
}
],
"sort": [
{
"key": "<string>"
}
],
"column_order": [
"<string>"
]
},
"relationships": {
"organisation": {
"data": {
"type": "organisations",
"id": "<string>"
}
},
"form": {
"data": {
"type": "forms",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}
}
}
'import requests
url = "https://api.ctrl-hub.com/v3/queries/preview"
payload = { "data": {
"type": "queries",
"attributes": {
"name": "<string>",
"dataset": "form-submissions",
"description": "<string>",
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"decimals": 5,
"resolution": { "projections": [
{
"path": ["<string>"],
"attribute": "<string>",
"label": "<string>"
}
] }
}
],
"group_by": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"bin": {
"from": 123,
"width": 123,
"to": 123,
"thresholds": [123]
}
}
],
"measures": [
{
"key": "<string>",
"type": "<string>",
"percentile": 50,
"decimals": 5,
"label": "<string>"
}
],
"filters": [
{
"key": "<string>",
"op": "<string>",
"values": ["<string>"]
}
],
"sort": [{ "key": "<string>" }],
"column_order": ["<string>"]
},
"relationships": {
"organisation": { "data": {
"type": "organisations",
"id": "<string>"
} },
"form": { "data": {
"type": "forms",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
} }
}
} }
headers = {
"X-Session-Token": "<api-key>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Session-Token': '<api-key>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'queries',
attributes: {
name: '<string>',
dataset: 'form-submissions',
description: '<string>',
fields: [
{
key: '<string>',
label: '<string>',
type: '<string>',
decimals: 5,
resolution: {projections: [{path: ['<string>'], attribute: '<string>', label: '<string>'}]}
}
],
group_by: [
{
key: '<string>',
label: '<string>',
type: '<string>',
bin: {from: 123, width: 123, to: 123, thresholds: [123]}
}
],
measures: [
{
key: '<string>',
type: '<string>',
percentile: 50,
decimals: 5,
label: '<string>'
}
],
filters: [{key: '<string>', op: '<string>', values: ['<string>']}],
sort: [{key: '<string>'}],
column_order: ['<string>']
},
relationships: {
organisation: {data: {type: 'organisations', id: '<string>'}},
form: {data: {type: 'forms', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}}
}
}
})
};
fetch('https://api.ctrl-hub.com/v3/queries/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ctrl-hub.com/v3/queries/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'queries',
'attributes' => [
'name' => '<string>',
'dataset' => 'form-submissions',
'description' => '<string>',
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => '<string>',
'decimals' => 5,
'resolution' => [
'projections' => [
[
'path' => [
'<string>'
],
'attribute' => '<string>',
'label' => '<string>'
]
]
]
]
],
'group_by' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => '<string>',
'bin' => [
'from' => 123,
'width' => 123,
'to' => 123,
'thresholds' => [
123
]
]
]
],
'measures' => [
[
'key' => '<string>',
'type' => '<string>',
'percentile' => 50,
'decimals' => 5,
'label' => '<string>'
]
],
'filters' => [
[
'key' => '<string>',
'op' => '<string>',
'values' => [
'<string>'
]
]
],
'sort' => [
[
'key' => '<string>'
]
],
'column_order' => [
'<string>'
]
],
'relationships' => [
'organisation' => [
'data' => [
'type' => 'organisations',
'id' => '<string>'
]
],
'form' => [
'data' => [
'type' => 'forms',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+json",
"X-Session-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ctrl-hub.com/v3/queries/preview"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"queries\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"dataset\": \"form-submissions\",\n \"description\": \"<string>\",\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"decimals\": 5,\n \"resolution\": {\n \"projections\": [\n {\n \"path\": [\n \"<string>\"\n ],\n \"attribute\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"group_by\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"bin\": {\n \"from\": 123,\n \"width\": 123,\n \"to\": 123,\n \"thresholds\": [\n 123\n ]\n }\n }\n ],\n \"measures\": [\n {\n \"key\": \"<string>\",\n \"type\": \"<string>\",\n \"percentile\": 50,\n \"decimals\": 5,\n \"label\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"key\": \"<string>\",\n \"op\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"sort\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"column_order\": [\n \"<string>\"\n ]\n },\n \"relationships\": {\n \"organisation\": {\n \"data\": {\n \"type\": \"organisations\",\n \"id\": \"<string>\"\n }\n },\n \"form\": {\n \"data\": {\n \"type\": \"forms\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Session-Token", "<api-key>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ctrl-hub.com/v3/queries/preview")
.header("X-Session-Token", "<api-key>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"queries\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"dataset\": \"form-submissions\",\n \"description\": \"<string>\",\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"decimals\": 5,\n \"resolution\": {\n \"projections\": [\n {\n \"path\": [\n \"<string>\"\n ],\n \"attribute\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"group_by\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"bin\": {\n \"from\": 123,\n \"width\": 123,\n \"to\": 123,\n \"thresholds\": [\n 123\n ]\n }\n }\n ],\n \"measures\": [\n {\n \"key\": \"<string>\",\n \"type\": \"<string>\",\n \"percentile\": 50,\n \"decimals\": 5,\n \"label\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"key\": \"<string>\",\n \"op\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"sort\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"column_order\": [\n \"<string>\"\n ]\n },\n \"relationships\": {\n \"organisation\": {\n \"data\": {\n \"type\": \"organisations\",\n \"id\": \"<string>\"\n }\n },\n \"form\": {\n \"data\": {\n \"type\": \"forms\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ctrl-hub.com/v3/queries/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Session-Token"] = '<api-key>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"queries\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"dataset\": \"form-submissions\",\n \"description\": \"<string>\",\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"decimals\": 5,\n \"resolution\": {\n \"projections\": [\n {\n \"path\": [\n \"<string>\"\n ],\n \"attribute\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"group_by\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"bin\": {\n \"from\": 123,\n \"width\": 123,\n \"to\": 123,\n \"thresholds\": [\n 123\n ]\n }\n }\n ],\n \"measures\": [\n {\n \"key\": \"<string>\",\n \"type\": \"<string>\",\n \"percentile\": 50,\n \"decimals\": 5,\n \"label\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"key\": \"<string>\",\n \"op\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"sort\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"column_order\": [\n \"<string>\"\n ]\n },\n \"relationships\": {\n \"organisation\": {\n \"data\": {\n \"type\": \"organisations\",\n \"id\": \"<string>\"\n }\n },\n \"form\": {\n \"data\": {\n \"type\": \"forms\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{}{
"id": "98ca4a78-b66f-4234-9719-aaf832ee6669",
"status": "400",
"title": "A validation error was encountered",
"source": {
"parameter": "include"
},
"meta": {
"resource": "wrong_value"
}
}{
"id": "05fc9c8d-73b9-4697-9337-57f7a567a48f",
"status": "401",
"title": "You are not authorised to access this resource",
"detail": "In order to access this resource, you need the 'admin' role.",
"code": "AUTH.001"
}{
"id": "fe9d9a69-f0a7-4fdc-bb2c-176027f316c5",
"status": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server."
}Preview a query
Execute an unsaved query definition and return its result rows, without persisting it (used by the data explorer for ad-hoc queries). Served by a custom handler (not generated), so this operation intentionally carries no x-ctrl-hub domain tag; it exists in the spec so the operation middleware admits the path.
curl --request POST \
--url https://api.ctrl-hub.com/v3/queries/preview \
--header 'Content-Type: application/vnd.api+json' \
--header 'X-Session-Token: <api-key>' \
--data '
{
"data": {
"type": "queries",
"attributes": {
"name": "<string>",
"dataset": "form-submissions",
"description": "<string>",
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"decimals": 5,
"resolution": {
"projections": [
{
"path": [
"<string>"
],
"attribute": "<string>",
"label": "<string>"
}
]
}
}
],
"group_by": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"bin": {
"from": 123,
"width": 123,
"to": 123,
"thresholds": [
123
]
}
}
],
"measures": [
{
"key": "<string>",
"type": "<string>",
"percentile": 50,
"decimals": 5,
"label": "<string>"
}
],
"filters": [
{
"key": "<string>",
"op": "<string>",
"values": [
"<string>"
]
}
],
"sort": [
{
"key": "<string>"
}
],
"column_order": [
"<string>"
]
},
"relationships": {
"organisation": {
"data": {
"type": "organisations",
"id": "<string>"
}
},
"form": {
"data": {
"type": "forms",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
}
}
}
'import requests
url = "https://api.ctrl-hub.com/v3/queries/preview"
payload = { "data": {
"type": "queries",
"attributes": {
"name": "<string>",
"dataset": "form-submissions",
"description": "<string>",
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"decimals": 5,
"resolution": { "projections": [
{
"path": ["<string>"],
"attribute": "<string>",
"label": "<string>"
}
] }
}
],
"group_by": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"bin": {
"from": 123,
"width": 123,
"to": 123,
"thresholds": [123]
}
}
],
"measures": [
{
"key": "<string>",
"type": "<string>",
"percentile": 50,
"decimals": 5,
"label": "<string>"
}
],
"filters": [
{
"key": "<string>",
"op": "<string>",
"values": ["<string>"]
}
],
"sort": [{ "key": "<string>" }],
"column_order": ["<string>"]
},
"relationships": {
"organisation": { "data": {
"type": "organisations",
"id": "<string>"
} },
"form": { "data": {
"type": "forms",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
} }
}
} }
headers = {
"X-Session-Token": "<api-key>",
"Content-Type": "application/vnd.api+json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Session-Token': '<api-key>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'queries',
attributes: {
name: '<string>',
dataset: 'form-submissions',
description: '<string>',
fields: [
{
key: '<string>',
label: '<string>',
type: '<string>',
decimals: 5,
resolution: {projections: [{path: ['<string>'], attribute: '<string>', label: '<string>'}]}
}
],
group_by: [
{
key: '<string>',
label: '<string>',
type: '<string>',
bin: {from: 123, width: 123, to: 123, thresholds: [123]}
}
],
measures: [
{
key: '<string>',
type: '<string>',
percentile: 50,
decimals: 5,
label: '<string>'
}
],
filters: [{key: '<string>', op: '<string>', values: ['<string>']}],
sort: [{key: '<string>'}],
column_order: ['<string>']
},
relationships: {
organisation: {data: {type: 'organisations', id: '<string>'}},
form: {data: {type: 'forms', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'}}
}
}
})
};
fetch('https://api.ctrl-hub.com/v3/queries/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ctrl-hub.com/v3/queries/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'queries',
'attributes' => [
'name' => '<string>',
'dataset' => 'form-submissions',
'description' => '<string>',
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => '<string>',
'decimals' => 5,
'resolution' => [
'projections' => [
[
'path' => [
'<string>'
],
'attribute' => '<string>',
'label' => '<string>'
]
]
]
]
],
'group_by' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => '<string>',
'bin' => [
'from' => 123,
'width' => 123,
'to' => 123,
'thresholds' => [
123
]
]
]
],
'measures' => [
[
'key' => '<string>',
'type' => '<string>',
'percentile' => 50,
'decimals' => 5,
'label' => '<string>'
]
],
'filters' => [
[
'key' => '<string>',
'op' => '<string>',
'values' => [
'<string>'
]
]
],
'sort' => [
[
'key' => '<string>'
]
],
'column_order' => [
'<string>'
]
],
'relationships' => [
'organisation' => [
'data' => [
'type' => 'organisations',
'id' => '<string>'
]
],
'form' => [
'data' => [
'type' => 'forms',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+json",
"X-Session-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ctrl-hub.com/v3/queries/preview"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"queries\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"dataset\": \"form-submissions\",\n \"description\": \"<string>\",\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"decimals\": 5,\n \"resolution\": {\n \"projections\": [\n {\n \"path\": [\n \"<string>\"\n ],\n \"attribute\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"group_by\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"bin\": {\n \"from\": 123,\n \"width\": 123,\n \"to\": 123,\n \"thresholds\": [\n 123\n ]\n }\n }\n ],\n \"measures\": [\n {\n \"key\": \"<string>\",\n \"type\": \"<string>\",\n \"percentile\": 50,\n \"decimals\": 5,\n \"label\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"key\": \"<string>\",\n \"op\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"sort\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"column_order\": [\n \"<string>\"\n ]\n },\n \"relationships\": {\n \"organisation\": {\n \"data\": {\n \"type\": \"organisations\",\n \"id\": \"<string>\"\n }\n },\n \"form\": {\n \"data\": {\n \"type\": \"forms\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Session-Token", "<api-key>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ctrl-hub.com/v3/queries/preview")
.header("X-Session-Token", "<api-key>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"queries\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"dataset\": \"form-submissions\",\n \"description\": \"<string>\",\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"decimals\": 5,\n \"resolution\": {\n \"projections\": [\n {\n \"path\": [\n \"<string>\"\n ],\n \"attribute\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"group_by\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"bin\": {\n \"from\": 123,\n \"width\": 123,\n \"to\": 123,\n \"thresholds\": [\n 123\n ]\n }\n }\n ],\n \"measures\": [\n {\n \"key\": \"<string>\",\n \"type\": \"<string>\",\n \"percentile\": 50,\n \"decimals\": 5,\n \"label\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"key\": \"<string>\",\n \"op\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"sort\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"column_order\": [\n \"<string>\"\n ]\n },\n \"relationships\": {\n \"organisation\": {\n \"data\": {\n \"type\": \"organisations\",\n \"id\": \"<string>\"\n }\n },\n \"form\": {\n \"data\": {\n \"type\": \"forms\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ctrl-hub.com/v3/queries/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Session-Token"] = '<api-key>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"queries\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"dataset\": \"form-submissions\",\n \"description\": \"<string>\",\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"decimals\": 5,\n \"resolution\": {\n \"projections\": [\n {\n \"path\": [\n \"<string>\"\n ],\n \"attribute\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"group_by\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"<string>\",\n \"bin\": {\n \"from\": 123,\n \"width\": 123,\n \"to\": 123,\n \"thresholds\": [\n 123\n ]\n }\n }\n ],\n \"measures\": [\n {\n \"key\": \"<string>\",\n \"type\": \"<string>\",\n \"percentile\": 50,\n \"decimals\": 5,\n \"label\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"key\": \"<string>\",\n \"op\": \"<string>\",\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"sort\": [\n {\n \"key\": \"<string>\"\n }\n ],\n \"column_order\": [\n \"<string>\"\n ]\n },\n \"relationships\": {\n \"organisation\": {\n \"data\": {\n \"type\": \"organisations\",\n \"id\": \"<string>\"\n }\n },\n \"form\": {\n \"data\": {\n \"type\": \"forms\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{}{
"id": "98ca4a78-b66f-4234-9719-aaf832ee6669",
"status": "400",
"title": "A validation error was encountered",
"source": {
"parameter": "include"
},
"meta": {
"resource": "wrong_value"
}
}{
"id": "05fc9c8d-73b9-4697-9337-57f7a567a48f",
"status": "401",
"title": "You are not authorised to access this resource",
"detail": "In order to access this resource, you need the 'admin' role.",
"code": "AUTH.001"
}{
"id": "fe9d9a69-f0a7-4fdc-bb2c-176027f316c5",
"status": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred on the server."
}Authorizations
Session token for authentication.
Query Parameters
Limit the number of resources returned by the API
x >= 1Offset the resources returned by the API
x >= 0Optional created_at range operator AND-ed onto the query as an additional constraint (a dashboard's global date range applied to a card). Relative presets (today, yesterday, last_n_days, this_week, this_month, this_quarter, this_year) are resolved live against the fixed Europe/London timezone at run time, including DST-sensitive boundaries; between/before/after take concrete bound(s). Omit for no additional constraint. Pair with date_values when the operator needs parameters.
today, yesterday, last_n_days, this_week, this_month, this_quarter, this_year, between, before, after Parameter values for date_op (e.g. 30 for last_n_days, or the two ends of a between). Repeat the parameter for multiple values. Ignored when date_op is absent.
Body
The query to create.
Show child attributes
Show child attributes
Response
The query result rows, as a JSON:API collection of query-result-rows (dynamic attributes, with column descriptors and pagination in meta).
The response is of type object.