REST APIs : Understanding dashboardResults : How to retrieve data from a dashboard
  
How to retrieve data from a dashboard
You need a dashboard to get data from Apex. Getting data from a dashboard uses the POST method.
An authenticated session
The dashboard ID
The business group ID
Video 3: Extracting data from a dashboard
Video 4: Parsing the extracted data from a dashboard
1. If you do not already know it, get the unique ID of the dashboard.
The list of dashboards returned includes all system and site dashboards, as well as any user dashboards for the person issuing the API request. More than likely, the dashboard from which you want to retrieve data is a site dashboard, so it is immaterial who is sending the API request, because site everyone has access to site dashboards.
Example: GET base-uri/dashboards
2. Send a request to get the dashboard results while passing in the parameters you want.
Even though you are retrieving the data from a dashboard, the method you use is POST.
Example: POST base-uri/dashboardResults
Figure 4: POST dashboardResults request body — Select All
{
"params" : {
"dashboardId" : "046110FC-D701-11E4-A203-000C29055050",
"businessGroupId":"52B06282-4A49-11E4-89AD-000C29055050",
"params" : {
"filter":"",
"startTime":"2015-02-20T16:00:00.000Z",
"endTime":"2015-02-21T00:00:00.000Z"
}
}
}
Element
Description
Required
dashboardId
The unique ID of the dashboard.
Yes
businessGroupId
The unique ID of the business group.
Yes
filter
A dashboard-level filter to apply to the results that are returned. This filter is applied in addition to any existing dashboard or widget filters. See Apex Filters. The filter element must be present, but its values are optional.
No
startTime
The beginning of the time range you wish to retrieve. All time values are specified in UTC using the ISO8601 time format: "2015-10-24T04:06:16Z". The Z at the end of the format indicates that there is no time offset from UTC. UTC does not observe summer time (daylight savings time). It is also possible that UTC may be several hours different from your local time. The web UI client uses its local browser time, but all API requests use UTC.
Yes
endTime
The end of the time range you wish to retrieve. All time values are specified in UTC using the ISO8601 time format: "2015-10-24T04:06:16Z". The Z at the end of the format indicates that there is no time offset from UTC. UTC does not observe summer time (daylight savings time). It is also possible that UTC may be several hours different from your local time. The web UI client uses its local browser time, but all API requests use UTC.
Yes
The results are returned in the response body and are available for you to process as you wish.
Figure 5: POST dashboardResults response body — Select All

{
"data": {
"results": {
"dashboard": {
"id": "046110FC-D701-11E4-A203-000C29055050",
"owner": {
"ownerType": "SITE"
},
"title": "Simple Dashboard",
"description": "This dashboard has good visibility for our department.",
"filter": "app http",
"tags": [
"foo"
],
"layout": {
"type": "NAMED",
"name": "1"
},
"children": [
{
"elementId": "31B1705C-CD85-4C14-8E83-21920DD566FB"
}
],
"elements": [
{
"id": "31B1705C-CD85-4C14-8E83-21920DD566FB",
"elementType": "REFERENCE",
"containerIndex": 0,
"widgetId": "480B4B3B-445D-11E4-A134-BCAEC5015590"
}
],
"widgets": [
{
"id": "480B4B3B-445D-11E4-A134-BCAEC5015590",
"title": "Traffic Volume by Time",
"category": "INTERVAL",
"widgetType": "GRAPH",
"maxItems": 2,
"owner": {
"ownerType": "SYSTEM"
},
"options": {
"numberFormat": "METRIC",
"graphType": "AREA",
"stacked": true,
"zoomControls": true
},
"fields": [
{
"fieldId": 51,
"flags": {
"legend": false,
"key": false,
"display": true,
"composite": false
},
"sortIndex": 1,
"sortOrder": "DESCENDING"
},
{
"fieldId": 52,
"flags": {
"legend": false,
"key": false,
"display": true,
"composite": false
}
}
],
"etag": "3C4B0B485D44E411A134BCAEC5015590"
}
],
"etag": "2EDB953C01D7E411A203000C29055050"
},
"status": {
"success": true
},
"results": [
{
"elementId": "31B1705C-CD85-4C14-8E83-21920DD566FB",
"status": {
"success": true
},
"data": {
"intervalData": {
"startTime": "2015-02-20T16:00:00Z",
"endTime": "2015-02-21T00:00:00Z",
"intervals": [
"2015-02-20T16:00:00Z",
"2015-02-20T17:00:00Z",
"2015-02-20T18:00:00Z",
"2015-02-20T19:00:00Z",
"2015-02-20T20:00:00Z",
"2015-02-20T21:00:00Z",
"2015-02-20T22:00:00Z",
"2015-02-20T23:00:00Z"
]
},
"series": [
{
"fieldData": [
{
"fieldId": 51,
"data": [
{
"status": "VALID",
"unsigned": 640
},
{
"status": "VALID",
"unsigned": 191694
},
{
"status": "VALID",
"unsigned": 152447
},
{
"status": "VALID",
"unsigned": 440324
},
{
"status": "VALID",
"unsigned": 839547
},
{
"status": "VALID",
"unsigned": 423212
},
{
"status": "VALID",
"unsigned": 222094
},
{
"status": "VALID",
"unsigned": 0
}
]
},
{
"fieldId": 52,
"data": [
{
"status": "VALID",
"unsigned": 640
},
{
"status": "VALID",
"unsigned": 159398
},
{
"status": "VALID",
"unsigned": 131188
},
{
"status": "VALID",
"unsigned": 303394
},
{
"status": "VALID",
"unsigned": 194304
},
{
"status": "VALID",
"unsigned": 145992
},
{
"status": "VALID",
"unsigned": 63014
},
{
"status": "VALID",
"unsigned": 0
}
]
}
]
}
],
"fieldGroups": []
}
}
]
}
},
"status": {
"code": 201,
"message": "Created"
}
}
 
You have the results from the dashboard and can import them into your external tool of choice where you can manipulate or massage the data as you see fit or use it for creating a unified reporting structure if you combine the data with other tools in your environment.