Get a Query History request
curl --request GET \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cacheType": "<string>",
"id": "<string>",
"isPlayground": true,
"isSubscription": true,
"requestId": "<string>",
"spanId": "<string>",
"sqlQueries": [
{
"executor": "dataSource",
"params": [
"<unknown>"
],
"spanId": "<string>",
"timestamp": "<string>",
"durationMs": 123,
"error": "<string>",
"executionDurationMs": 123,
"queueDurationMs": 123,
"sql": "<string>"
}
],
"status": "success",
"timestamp": "<string>",
"usedPreAggregations": true,
"apiType": "<string>",
"durationMs": 123,
"error": "<string>",
"preAggregations": "<string>",
"query": "<string>",
"responseBytes": 123,
"securityContext": "<string>"
}Query History
Get a Query History request
GET
/
api
/
v1
/
deployments
/
{deploymentId}
/
query-history
/
requests
/
{id}
Get a Query History request
curl --request GET \
--url https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}', 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://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.cubecloud.dev/api/v1/deployments/{deploymentId}/query-history/requests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cacheType": "<string>",
"id": "<string>",
"isPlayground": true,
"isSubscription": true,
"requestId": "<string>",
"spanId": "<string>",
"sqlQueries": [
{
"executor": "dataSource",
"params": [
"<unknown>"
],
"spanId": "<string>",
"timestamp": "<string>",
"durationMs": 123,
"error": "<string>",
"executionDurationMs": 123,
"queueDurationMs": 123,
"sql": "<string>"
}
],
"status": "success",
"timestamp": "<string>",
"usedPreAggregations": true,
"apiType": "<string>",
"durationMs": 123,
"error": "<string>",
"preAggregations": "<string>",
"query": "<string>",
"responseBytes": 123,
"securityContext": "<string>"
}One API request with the SQL it generated, to the data source and to Cube Store, and how long each query waited and ran. Covers the deployment’s production API requests that queried data (REST, GraphQL, SQL and WebSocket), as the Query History page in Cube Cloud shows them; requests to development branches and metadata calls are left out. How far back it reaches is the deployment’s Query History retention.
Authorizations
Path Parameters
Response
200 - application/json