(deprecated since 23.1, to be removed in 24.1) Export chart data in CSV or JSON format
curl --request POST \
--url http://10.2.4.166:8080/composer/api/export/chartdata/{file_name} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"startVis": {
"cid": "<string>",
"tags": {},
"sourceId": "<string>",
"sourceName": "<string>",
"queries": [
"<unknown>"
],
"time": {
"timeField": "<string>",
"from": "<string>",
"to": "<string>"
},
"player": {
"stopTime": "<string>",
"speed": 123,
"pauseAfterRead": true
},
"ttl": 123,
"auditInfo": {
"dashboardId": "<string>",
"visualId": "<string>",
"formula": "<string>",
"expression": "<string>"
},
"composite": true
},
"direction": "<string>"
}
'import requests
url = "http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}"
payload = {
"startVis": {
"cid": "<string>",
"tags": {},
"sourceId": "<string>",
"sourceName": "<string>",
"queries": ["<unknown>"],
"time": {
"timeField": "<string>",
"from": "<string>",
"to": "<string>"
},
"player": {
"stopTime": "<string>",
"speed": 123,
"pauseAfterRead": True
},
"ttl": 123,
"auditInfo": {
"dashboardId": "<string>",
"visualId": "<string>",
"formula": "<string>",
"expression": "<string>"
},
"composite": True
},
"direction": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startVis: {
cid: '<string>',
tags: {},
sourceId: '<string>',
sourceName: '<string>',
queries: ['<unknown>'],
time: {timeField: '<string>', from: '<string>', to: '<string>'},
player: {stopTime: '<string>', speed: 123, pauseAfterRead: true},
ttl: 123,
auditInfo: {
dashboardId: '<string>',
visualId: '<string>',
formula: '<string>',
expression: '<string>'
},
composite: true
},
direction: '<string>'
})
};
fetch('http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}",
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([
'startVis' => [
'cid' => '<string>',
'tags' => [
],
'sourceId' => '<string>',
'sourceName' => '<string>',
'queries' => [
'<unknown>'
],
'time' => [
'timeField' => '<string>',
'from' => '<string>',
'to' => '<string>'
],
'player' => [
'stopTime' => '<string>',
'speed' => 123,
'pauseAfterRead' => true
],
'ttl' => 123,
'auditInfo' => [
'dashboardId' => '<string>',
'visualId' => '<string>',
'formula' => '<string>',
'expression' => '<string>'
],
'composite' => true
],
'direction' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}"
payload := strings.NewReader("{\n \"startVis\": {\n \"cid\": \"<string>\",\n \"tags\": {},\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"queries\": [\n \"<unknown>\"\n ],\n \"time\": {\n \"timeField\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"player\": {\n \"stopTime\": \"<string>\",\n \"speed\": 123,\n \"pauseAfterRead\": true\n },\n \"ttl\": 123,\n \"auditInfo\": {\n \"dashboardId\": \"<string>\",\n \"visualId\": \"<string>\",\n \"formula\": \"<string>\",\n \"expression\": \"<string>\"\n },\n \"composite\": true\n },\n \"direction\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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("http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"startVis\": {\n \"cid\": \"<string>\",\n \"tags\": {},\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"queries\": [\n \"<unknown>\"\n ],\n \"time\": {\n \"timeField\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"player\": {\n \"stopTime\": \"<string>\",\n \"speed\": 123,\n \"pauseAfterRead\": true\n },\n \"ttl\": 123,\n \"auditInfo\": {\n \"dashboardId\": \"<string>\",\n \"visualId\": \"<string>\",\n \"formula\": \"<string>\",\n \"expression\": \"<string>\"\n },\n \"composite\": true\n },\n \"direction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startVis\": {\n \"cid\": \"<string>\",\n \"tags\": {},\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"queries\": [\n \"<unknown>\"\n ],\n \"time\": {\n \"timeField\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"player\": {\n \"stopTime\": \"<string>\",\n \"speed\": 123,\n \"pauseAfterRead\": true\n },\n \"ttl\": 123,\n \"auditInfo\": {\n \"dashboardId\": \"<string>\",\n \"visualId\": \"<string>\",\n \"formula\": \"<string>\",\n \"expression\": \"<string>\"\n },\n \"composite\": true\n },\n \"direction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body(deprecated since 23.1, to be removed in 24.1) Export chart data in CSV or JSON format
deprecated
If the “data” field is empty, data is requested from the data accumulator using the cid provided.
(deprecated since 23.1, to be removed in 24.1) Export chart data in CSV or JSON format
curl --request POST \
--url http://10.2.4.166:8080/composer/api/export/chartdata/{file_name} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"startVis": {
"cid": "<string>",
"tags": {},
"sourceId": "<string>",
"sourceName": "<string>",
"queries": [
"<unknown>"
],
"time": {
"timeField": "<string>",
"from": "<string>",
"to": "<string>"
},
"player": {
"stopTime": "<string>",
"speed": 123,
"pauseAfterRead": true
},
"ttl": 123,
"auditInfo": {
"dashboardId": "<string>",
"visualId": "<string>",
"formula": "<string>",
"expression": "<string>"
},
"composite": true
},
"direction": "<string>"
}
'import requests
url = "http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}"
payload = {
"startVis": {
"cid": "<string>",
"tags": {},
"sourceId": "<string>",
"sourceName": "<string>",
"queries": ["<unknown>"],
"time": {
"timeField": "<string>",
"from": "<string>",
"to": "<string>"
},
"player": {
"stopTime": "<string>",
"speed": 123,
"pauseAfterRead": True
},
"ttl": 123,
"auditInfo": {
"dashboardId": "<string>",
"visualId": "<string>",
"formula": "<string>",
"expression": "<string>"
},
"composite": True
},
"direction": "<string>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
startVis: {
cid: '<string>',
tags: {},
sourceId: '<string>',
sourceName: '<string>',
queries: ['<unknown>'],
time: {timeField: '<string>', from: '<string>', to: '<string>'},
player: {stopTime: '<string>', speed: 123, pauseAfterRead: true},
ttl: 123,
auditInfo: {
dashboardId: '<string>',
visualId: '<string>',
formula: '<string>',
expression: '<string>'
},
composite: true
},
direction: '<string>'
})
};
fetch('http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}",
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([
'startVis' => [
'cid' => '<string>',
'tags' => [
],
'sourceId' => '<string>',
'sourceName' => '<string>',
'queries' => [
'<unknown>'
],
'time' => [
'timeField' => '<string>',
'from' => '<string>',
'to' => '<string>'
],
'player' => [
'stopTime' => '<string>',
'speed' => 123,
'pauseAfterRead' => true
],
'ttl' => 123,
'auditInfo' => [
'dashboardId' => '<string>',
'visualId' => '<string>',
'formula' => '<string>',
'expression' => '<string>'
],
'composite' => true
],
'direction' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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 := "http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}"
payload := strings.NewReader("{\n \"startVis\": {\n \"cid\": \"<string>\",\n \"tags\": {},\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"queries\": [\n \"<unknown>\"\n ],\n \"time\": {\n \"timeField\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"player\": {\n \"stopTime\": \"<string>\",\n \"speed\": 123,\n \"pauseAfterRead\": true\n },\n \"ttl\": 123,\n \"auditInfo\": {\n \"dashboardId\": \"<string>\",\n \"visualId\": \"<string>\",\n \"formula\": \"<string>\",\n \"expression\": \"<string>\"\n },\n \"composite\": true\n },\n \"direction\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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("http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"startVis\": {\n \"cid\": \"<string>\",\n \"tags\": {},\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"queries\": [\n \"<unknown>\"\n ],\n \"time\": {\n \"timeField\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"player\": {\n \"stopTime\": \"<string>\",\n \"speed\": 123,\n \"pauseAfterRead\": true\n },\n \"ttl\": 123,\n \"auditInfo\": {\n \"dashboardId\": \"<string>\",\n \"visualId\": \"<string>\",\n \"formula\": \"<string>\",\n \"expression\": \"<string>\"\n },\n \"composite\": true\n },\n \"direction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/export/chartdata/{file_name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"startVis\": {\n \"cid\": \"<string>\",\n \"tags\": {},\n \"sourceId\": \"<string>\",\n \"sourceName\": \"<string>\",\n \"queries\": [\n \"<unknown>\"\n ],\n \"time\": {\n \"timeField\": \"<string>\",\n \"from\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"player\": {\n \"stopTime\": \"<string>\",\n \"speed\": 123,\n \"pauseAfterRead\": true\n },\n \"ttl\": 123,\n \"auditInfo\": {\n \"dashboardId\": \"<string>\",\n \"visualId\": \"<string>\",\n \"formula\": \"<string>\",\n \"expression\": \"<string>\"\n },\n \"composite\": true\n },\n \"direction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
HTTP Basic authentication using global administrator credentials (username and password).
Path Parameters
Query Parameters
Body
application/json
Response
200
OK
Was this page helpful?