Get Dashboard
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v2/dashboard/{dashboard_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v2/dashboard/{dashboard_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/dashboard/{dashboard_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"project_id": "<string>",
"widgets": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"tab_id": "<string>",
"config": {}
}
],
"layouts": {},
"created_at": {},
"updated_at": {}
}Get Dashboard
Retrieve a specific dashboard with its widgets and layouts
GET
/
v2
/
dashboard
/
{dashboard_id}
Get Dashboard
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v2/dashboard/{dashboard_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v2/dashboard/{dashboard_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/dashboard/{dashboard_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"project_id": "<string>",
"widgets": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"tab_id": "<string>",
"config": {}
}
],
"layouts": {},
"created_at": {},
"updated_at": {}
}← Dashboards API
Retrieve a specific dashboard by its ID, including all widgets and responsive grid layouts.
Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
UUID of the dashboardExample:
"550e8400-e29b-41d4-a716-446655440000"Response
Returns the dashboard object with HTTP 200.string
Dashboard UUID
string
UUID of the project this dashboard belongs to
array
object
Responsive grid layouts with breakpoints:
lg, md, sm, xs, xxs. Each contains an array of layout items with i (widget ID), x, y, w, h grid positions.datetime
Creation timestamp (ISO 8601)
datetime | null
Last update timestamp (ISO 8601)
Example
curl -X GET "https://api.dcycle.io/v2/dashboard/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
dashboard_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(
f"https://api.dcycle.io/v2/dashboard/{dashboard_id}",
headers=headers,
)
dashboard = response.json()
print(f"Project: {dashboard['project_id']}")
print(f"Widgets: {len(dashboard['widgets'])}")
for widget in dashboard["widgets"]:
print(f" - {widget['name']} ({widget['type']})")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
};
const dashboardId = '550e8400-e29b-41d4-a716-446655440000';
axios.get(`https://api.dcycle.io/v2/dashboard/${dashboardId}`, { headers })
.then(response => {
const { project_id, widgets } = response.data;
console.log(`Project: ${project_id}, Widgets: ${widgets.length}`);
});
Successful Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"project_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
"widgets": [
{
"id": "widget-1",
"name": "Carbon Footprint by Scope",
"type": "bar_chart",
"tab_id": "tab-general",
"config": {
"metrics": [
{
"id": "metric-1",
"category": "emissions",
"filters": [{ "type": "scope", "field": "scope", "value": "1" }],
"aggregation": {
"organizations": [{ "id": "org-uuid" }]
}
}
],
"periodicity": "monthly",
"periods": [{ "start_date": "2024-01-01", "end_date": "2024-12-31" }],
"unit": "tCO2e"
}
}
],
"layouts": {
"lg": [{ "i": "widget-1", "x": 0, "y": 0, "w": 6, "h": 4 }],
"md": [{ "i": "widget-1", "x": 0, "y": 0, "w": 6, "h": 4 }],
"sm": [{ "i": "widget-1", "x": 0, "y": 0, "w": 4, "h": 4 }],
"xs": [{ "i": "widget-1", "x": 0, "y": 0, "w": 2, "h": 4 }],
"xxs": [{ "i": "widget-1", "x": 0, "y": 0, "w": 1, "h": 4 }]
},
"created_at": "2024-11-24T10:30:00Z",
"updated_at": "2024-12-15T14:20:00Z"
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
404 Not Found
Cause: Dashboard does not exist or does not belong to your organization{
"detail": "Not found."
}
Related Endpoints
Update Dashboard
Modify dashboard widgets and layouts
List Dashboards
View all dashboards
Was this page helpful?