curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/search/dashboards?token=' \
--header 'Content-Type: application/json' \
--data '
{
"dashboards": [
{
"name": "docs_per_user"
}
],
"restrictions": [
{}
]
}
'import requests
url = "https://sandbox.circularo.com/api/v1/search/dashboards?token="
payload = {
"dashboards": [{ "name": "docs_per_user" }],
"restrictions": [{}]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({dashboards: [{name: 'docs_per_user'}], restrictions: [{}]})
};
fetch('https://sandbox.circularo.com/api/v1/search/dashboards?token=', 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://sandbox.circularo.com/api/v1/search/dashboards?token=",
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([
'dashboards' => [
[
'name' => 'docs_per_user'
]
],
'restrictions' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sandbox.circularo.com/api/v1/search/dashboards?token="
payload := strings.NewReader("{\n \"dashboards\": [\n {\n \"name\": \"docs_per_user\"\n }\n ],\n \"restrictions\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/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://sandbox.circularo.com/api/v1/search/dashboards?token=")
.header("Content-Type", "application/json")
.body("{\n \"dashboards\": [\n {\n \"name\": \"docs_per_user\"\n }\n ],\n \"restrictions\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/search/dashboards?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboards\": [\n {\n \"name\": \"docs_per_user\"\n }\n ],\n \"restrictions\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"dashboards": [
{
"name": "docs_per_user",
"properties": {
"dataInteractive": {
"filterQuery": "create_user"
},
"datasetInteractive": [
{
"filterQuery": "document_state",
"filterValue": "completed"
}
],
"datasetLabels": [
"<string>"
],
"datasetTranslatePrefix": "<string>",
"datasetType": "<string>",
"labelsTranslatePrefix": "<string>",
"labelsType": "user"
},
"results": [
{
"key": "john.doe@example.com",
"parsed": "John Doe",
"values": [
{
"value": 42,
"parsed": "42"
}
]
}
]
}
]
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 500,
"type": "SYSTEM:INTERNAL_ERROR",
"message": "Internal error",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Run stored dashboards
POST /search/dashboards
Runs one or more of the tenant’s stored dashboards and answers with the figures they work out, shaped to be plotted straight away.
A dashboard is not a query written by the caller. It is a definition kept in the tenant’s settings that holds the aggregation to run over the documents and the instructions for turning its outcome into labelled series - what the categories are, how many series there are and how each value is to be read, be it a count, a size in bytes, a date, a translated term or a user. Which dashboards exist, and which of them an account may run, are both settings, so the names accepted here come from there rather than from this API: running a dashboard the account is not allowed to run is refused, and a name with nothing defined behind it is a bad request.
Every dashboard is computed over the documents of the caller’s organization - or of the whole tenant where the account belongs to none - with folders left out, and restrictions narrows that set further. The figures come back as rows and series: a row per category, carrying its label and one value per series, in the same order as the series labels. Each value arrives both raw and in display form, the raw one being what to plot and the display one what to write next to it.
Alongside them come the properties a chart needs to be drilled down from: they say which stored query a click on a category or on a series leads to, which is what turns a chart into a filtered document listing.
Token authorization: Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.
curl --request POST \
--url 'https://sandbox.circularo.com/api/v1/search/dashboards?token=' \
--header 'Content-Type: application/json' \
--data '
{
"dashboards": [
{
"name": "docs_per_user"
}
],
"restrictions": [
{}
]
}
'import requests
url = "https://sandbox.circularo.com/api/v1/search/dashboards?token="
payload = {
"dashboards": [{ "name": "docs_per_user" }],
"restrictions": [{}]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({dashboards: [{name: 'docs_per_user'}], restrictions: [{}]})
};
fetch('https://sandbox.circularo.com/api/v1/search/dashboards?token=', 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://sandbox.circularo.com/api/v1/search/dashboards?token=",
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([
'dashboards' => [
[
'name' => 'docs_per_user'
]
],
'restrictions' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://sandbox.circularo.com/api/v1/search/dashboards?token="
payload := strings.NewReader("{\n \"dashboards\": [\n {\n \"name\": \"docs_per_user\"\n }\n ],\n \"restrictions\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/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://sandbox.circularo.com/api/v1/search/dashboards?token=")
.header("Content-Type", "application/json")
.body("{\n \"dashboards\": [\n {\n \"name\": \"docs_per_user\"\n }\n ],\n \"restrictions\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.circularo.com/api/v1/search/dashboards?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboards\": [\n {\n \"name\": \"docs_per_user\"\n }\n ],\n \"restrictions\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"dashboards": [
{
"name": "docs_per_user",
"properties": {
"dataInteractive": {
"filterQuery": "create_user"
},
"datasetInteractive": [
{
"filterQuery": "document_state",
"filterValue": "completed"
}
],
"datasetLabels": [
"<string>"
],
"datasetTranslatePrefix": "<string>",
"datasetType": "<string>",
"labelsTranslatePrefix": "<string>",
"labelsType": "user"
},
"results": [
{
"key": "john.doe@example.com",
"parsed": "John Doe",
"values": [
{
"value": 42,
"parsed": "42"
}
]
}
]
}
]
}{
"status": 400,
"type": "VALIDATION:INPUT_INVALID",
"message": "Invalid input",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 401,
"type": "AUTH:UNAUTHORIZED",
"message": "Authentication failed",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 403,
"type": "AUTH:ACCESS_DENIED",
"message": "Access denied",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}{
"status": 500,
"type": "SYSTEM:INTERNAL_ERROR",
"message": "Internal error",
"requestId": "3fa85f6457174562b3fc2c963f66afa6"
}Authorizations
Body
Raw Elasticsearch clauses narrowing the documents every one of the dashboards is computed over, passed through untouched and all of which have to match. This is what shows the same dashboard for a chosen period, author or metadata definition; entries left empty are skipped, and what a dashboard aggregates cannot be changed this way.