Get a dashboard
curl --request GET \
--url https://api.datalyr.com/v1/dashboards/{dashboardId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.datalyr.com/v1/dashboards/{dashboardId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datalyr.com/v1/dashboards/{dashboardId}', 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.datalyr.com/v1/dashboards/{dashboardId}",
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://api.datalyr.com/v1/dashboards/{dashboardId}"
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://api.datalyr.com/v1/dashboards/{dashboardId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/dashboards/{dashboardId}")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"layout": {
"v": 1,
"cards": [
{
"report_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"size": "sm"
}
]
},
"date_range": {
"from": "<string>",
"to": "<string>"
},
"filters": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"created_via": "dashboard",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cards": [
{
"report_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"size": "sm",
"report": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "metric",
"source": "catalog"
}
}
],
"created_by": {
"type": "user",
"id": "<string>",
"client_id": "<string>"
},
"deleted_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Dashboards, analyses and share links
Get a dashboard
One dashboard with its range, filters, layout and resolved cards. Needs datalyr:read. A card whose report was deleted reads report: null.
GET
/
dashboards
/
{dashboardId}
Get a dashboard
curl --request GET \
--url https://api.datalyr.com/v1/dashboards/{dashboardId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.datalyr.com/v1/dashboards/{dashboardId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datalyr.com/v1/dashboards/{dashboardId}', 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.datalyr.com/v1/dashboards/{dashboardId}",
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://api.datalyr.com/v1/dashboards/{dashboardId}"
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://api.datalyr.com/v1/dashboards/{dashboardId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datalyr.com/v1/dashboards/{dashboardId}")
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{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"layout": {
"v": 1,
"cards": [
{
"report_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"size": "sm"
}
]
},
"date_range": {
"from": "<string>",
"to": "<string>"
},
"filters": [
{
"dimension": "<string>",
"op": "eq",
"value": "<string>"
}
],
"created_via": "dashboard",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cards": [
{
"report_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"size": "sm",
"report": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "metric",
"source": "catalog"
}
}
],
"created_by": {
"type": "user",
"id": "<string>",
"client_id": "<string>"
},
"deleted_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>"
}{
"error": "<string>",
"code": "insufficient_scope",
"required_scope": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Response
Successful response.
Required string length:
1 - 120Show child attributes
Show child attributes
The one range every card runs over. A custom range spans at most 400 days.
- Option 1
- Option 2
Show child attributes
Show child attributes
Applied to query reports whose metrics accept the dimension. Other cards run unfiltered.
Maximum array length:
10Show child attributes
Show child attributes
dashboard means the Datalyr app.
Available options:
dashboard, chat, mcp, api One entry per layout card. Present on get, create and update; not on list.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?