Sheldon Nathan
01/24/2023, 3:38 PMJan Rehanek
01/25/2023, 8:15 AMJan Rehanek
01/25/2023, 8:15 AMJan Rehanek
01/25/2023, 10:18 AM{
"data": {
"id": "TestInsight1",
"type": "visualizationObject",
"attributes": {
"description": "",
"content": {
"buckets": [
{
"items": [
{
"attribute": {
"localIdentifier": "982a5e737fed4c7e8040884abf19412a",
"displayForm": {
"identifier": {
"id": "region",
"type": "label"
}
}
}
}
],
"localIdentifier": "attribute"
}
],
"filters": [],
"sorts": [
{
"attributeSortItem": {
"attributeIdentifier": "982a5e737fed4c7e8040884abf19412a",
"direction": "asc"
}
}
],
"properties": {},
"visualizationUrl": "local:table",
"version": "2"
},
"title": "TestInsight1",
"tags": []
}
}
}
2. Create a filter context with POST to /api/v1/entities/workspaces/:workspaceId/filterContexts (this is needed, as all dashboards contain at least the date filter). Make sure to save its `"id"`:
{
"data": {
"id": "TestFilter1",
"type": "filterContext",
"attributes": {
"content": {
"filters": [
{
"dateFilter": {
"from": "0",
"to": "0",
"granularity": "GDC.time.month",
"type": "relative"
}
}
],
"version": "2"
},
"title": "filterContext",
"description": ""
}
}
}
3. Create the actual dashboard with POST to api/v1/entities/workspaces/:workspaceId/analyticalDashboards (embed the previously created insight and filter context by "id"
inside the JSON structure):
{
"data": {
"id": "TestDashboard1",
"type": "analyticalDashboard",
"attributes": {
"content": {
"filterContextRef": {
"identifier": {
"id": "TestFilter1",
"type": "filterContext"
}
},
"layout": {
"type": "IDashboardLayout",
"sections": [
{
"type": "IDashboardLayoutSection",
"items": [
{
"type": "IDashboardLayoutItem",
"size": {
"xl": {
"gridWidth": 6
}
},
"widget": {
"type": "insight",
"title": "TestInsight1",
"description": "",
"ignoreDashboardFilters": [],
"dateDataSet": {
"identifier": {
"id": "date",
"type": "dataset"
}
},
"insight": {
"identifier": {
"id": "TestInsight1",
"type": "visualizationObject"
}
},
"drills": [],
"properties": {}
}
}
]
}
]
},
"version": "2"
},
"title": "TestDashboard1",
"description": ""
}
}
}
Is this helpful?Sheldon Nathan
01/25/2023, 6:22 PMJan Rehanek
01/26/2023, 8:47 AMProductboard
02/14/2023, 10:35 AM