Salesforce Analytics Rest API
Salesforce Analytics Rest API
@salesforcedocs
Last updated: January 28, 2016
Copyright 20002016 salesforce.com, inc. All rights reserved. Salesforce is a registered trademark of salesforce.com, inc.,
as are other names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
Chapter 1: Introducing the Salesforce Reports and Dashboards REST API . . . . . . . . . . . 1
Requirements and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
28
28
32
33
34
34
38
39
Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
CHAPTER 1
Requirements and
Limitations
Run Reports
Synchronously or
Asynchronously
List Asynchronous
Runs of a Report
Filter Reports on
Demand
Save Changes to
Reports
Clone Reports
Delete Reports
The Reports and Dashboards REST API is designed to let you query report data easily. Use the API to:
Run Reports Synchronously or Asynchronously.
Run a report immediately or asynchronously to get summary data with or without details. We
recommend that you run reports asynchronously to avoid report timeouts and other API limits.
Get Report Metadata.
Get information about fields in the report and report type. This includes information about fields
used for report groupings, summaries, detailed data, and filters.
List Asynchronous Runs of a Report.
Get a list of all instances of a report run asynchronously.
Filter Reports on Demand.
Get specific data back by running a report with filter changes in the metadata.
List Recently Viewed Reports
Get most recently viewed reports that you have permission to access.
Decode the Fact Map.
Get a visualized view of your report data.
Save Changes to Reports
Save changes to reports.
Clone Reports
Make copies of existing reports.
Delete Reports
Clean up unused and obsolete reports.
{ "label"
"value"
{ "label"
{ "label"
{ "label"
{ "label"
{ "label"
{ "label"
{ "label"
{ "label"
:
:
:
:
:
:
:
:
:
:
"$16,000.01",
{ "amount" : 16000.01, "currency" : null } },
"Word of mouth", "value" : "Word of mouth" },
"Need estimate", "value" : "Need estimate" },
"60%", "value" : 60},
"Q3-2015", "value" : "Q3-2015" },
"12", "value" : 12 },
"7/31/2015", "value" : "2015-07-31" },
"Fred Wiliamson", "value" : "005R0000000Hv5rIAC" },
"-", "value" : null } ]
} ]
},
"T!0" : {
"aggregates" : [
{ "label" : "$32,021.01", "value" : 32021.00999999999839928932487964630126953125
},
{ "label" : "$16,010.51", "value" : 16010.504999999999199644662439823150634765625
},
{ "label" : "2", "value" : 2 } ],
"rows" : [ ]
},
...
"T!T" : {
"aggregates" : [
{ "label" : "$153,042.01", "value" : 153042.01000000000931322574615478515625 },
{ "label" : "$25,507.00", "value" : 25507.00166666666700621135532855987548828125
},
{ "label" : "6", "value" : 6 } ],
"rows" : [ ]
},
...
"groupingsAcross" : {
"groupings" : [
{
"groupings" : [
{ "groupings" : [ ], "key"
"Existing Business" } ],
"key" : "0",
"label" : "July 2015",
"value" : "2015-07-01"
},
{
"groupings" : [
{ "groupings" : [ ], "key"
"Existing Business" },
{ "groupings" : [ ], "key"
Business" } ],
"key" : "1",
"label" : "August 2015",
"value" : "2015-08-01"
},
{
"groupings" : [
{ "groupings" : [ ], "key"
"Existing Business" } ],
"key" : "2",
"label" : "September 2015",
"value" : "2015-09-01"
}
]
},
"groupingsDown" : {
"groupings" : [
{ "groupings" : [ ], "key" : "0", "label" : "Acme", "value" : "001R0000002GuzsIAC"
},
{ "groupings" : [ ], "key" : "1", "label" : "Facebook", "value" : "001R0000001nUAmIAM"
},
{ "groupings" : [ ], "key" : "2", "label" : "Home Depot", "value" :
"001R0000002Gv5zIAC" },
{ "groupings" : [ ], "key" : "3", "label" : "Mircosoft", "value" : "001R0000002Gv5QIAS"
} ]
},
"hasDetailRows" : true,
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"s!AMOUNT" : {
"acrossGroupingContext" : null,
"dataType" : "currency",
"downGroupingContext" : null,
"label" : "Sum of Amount" },
"a!AMOUNT" : {
"acrossGroupingContext" : null,
"dataType" : "currency",
"downGroupingContext" : null,
"label" : "Average Amount" },
"RowCount" : {
"acrossGroupingContext" : null,
"dataType" : "int",
"downGroupingContext" : null,
"label" : "Record Count" }
},
"detailColumnInfo" : {
"OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" },
"AMOUNT" : { "dataType" : "currency", "label" : "Amount" },
"LEAD_SOURCE" : { "dataType" : "picklist", "label" : "Lead Source" },
"NEXT_STEP" : { "dataType" : "string", "label" : "Next Step" },
"PROBABILITY" : { "dataType" : "percent", "label" : "Probability (%)" },
"FISCAL_QUARTER" : { "dataType" : "string", "label" : "Fiscal Period" },
"AGE" : { "dataType" : "int", "label" : "Age" },
"CREATED_DATE" : { "dataType" : "datetime", "label" : "Created Date" },
"FULL_NAME" : { "dataType" : "string", "label" : "Opportunity Owner" },
"ROLLUP_DESCRIPTION" : { "dataType" : "string", "label" : "Owner Role" }
},
"groupingColumnInfo" : {
"ACCOUNT_NAME" : { "dataType" : "string", "groupingLevel" : 0, "label" : "Account
Name" },
"CLOSE_DATE" : { "dataType" : "date", "groupingLevel" : 0, "label" : "Close Date"
},
"TYPE" : { "dataType" : "picklist", "groupingLevel" : 1, "label" : "Type" }
}
},
"reportMetadata" : {
"aggregates" : [ "s!AMOUNT", "a!AMOUNT", "RowCount" ],
"chart" : {
"chartType" : "Donut",
"groupings" : [ "CLOSE_DATE" ],
"hasLegend" : true,
"showChartValues" : false,
"summaries" : [ "s!AMOUNT" ],
"summaryAxisLocations" : [ "Y" ],
"title" : "Pipeline by Stage and Type"
},
"currency" : null,
"description" : null,
"detailColumns" : [ "OPPORTUNITY_NAME", "AMOUNT", "LEAD_SOURCE","NEXT_STEP",
"PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE", "FULL_NAME",
"ROLLUP_DESCRIPTION" ],
"developerName" : "Deals_Closing_This_Quarter",
"division" : null,
"folderId" : "00lR0000000M8IiIAK",
"groupingsAcross" : [
{ "dateGranularity" : "Month", "name" : "CLOSE_DATE", "sortAggregate" : null,
"sortOrder" : "Asc"},
{ "dateGranularity" : "None", "name" : "TYPE", "sortAggregate" : null, "sortOrder"
: "Asc" } ],
"groupingsDown" : [
{ "dateGranularity" : "None", "name" : "ACCOUNT_NAME", "sortAggregate" : null,
"sortOrder" : "Asc" } ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OR0000000K2UeMAK",
"name" : "Deals Closing This Quarter",
"reportBooleanFilter" : null,
"reportFilters" : [
{ "column" : "BucketField_36625466", "isRunPageEditable" : true, "operator" : "equals",
"value" : "Early,Late" },
{ "column" : "TYPE", "isRunPageEditable" : true, "operator" : "equals", "value" :
"Existing Business,New Business" } ],
"reportFormat" : "MATRIX",
"reportType" : { "label" : "Opportunities", "type" : "Opportunity" },
"scope" : "organization",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CLOSE_DATE",
"durationValue" : "THIS_FISCAL_QUARTER",
"endDate" : "2015-09-30",
"startDate" : "2015-07-01" },
"standardFilters" : [
"reportFilters": [
{
"column": "BucketField_36625466",
"isRunPageEditable": true,
"operator": "equals",
"value": "Early,Late" },
{
"column": "TYPE",
"isRunPageEditable": true,
"operator": "equals",
"value": "Existing Business,New Business" } ],
"reportFormat": "MATRIX",
"reportType": { "label": "Opportunities", "type": "Opportunity" },
"scope": "organization",
"sortBy": [],
"standardDateFilter": {
"column": "CLOSE_DATE",
"durationValue": "THIS_FISCAL_QUARTER",
"endDate": "2015-09-30",
"startDate": "2015-07-01" },
"standardFilters": [
{ "name": "open", "value": "all" },
{ "name": "probability", "value": ">0" } ]
}
}
The response to the POST request returns the instance handle that stores the summary results of the run.
{
"completionDate" : null,
"hasDetailRows" : true,
"id" : "0LGR00000000He3OAE",
"ownerId" : "005R0000000Hv5rIAC",
"queryable" : false,
"requestDate" : "2015-08-12T16:05:43Z",
"status" : "New",
"url" :
"/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances/0LGR00000000He3OAE"
}
2. A GET request,
/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances/0LGR00000000He3OAE,
to the Instance Results resource for the instance handle fetches the report results.
{
"attributes" : {
"completionDate" : "2015-08-12T16:05:44Z",
"id" : "0LGR00000000He3OAE",
"ownerId" : "005R0000000Hv5rIAC",
"queryable" : false,
"reportId" : "00OR0000000K2UeMAK",
"reportName" : "Deals Closing This Quarter",
"requestDate" : "2015-08-12T16:05:43Z",
"status" : "Success",
"type" : "ReportInstance" },
"allData" : true,
"factMap" : {
"2!0_0" : {
"aggregates" : [
{ "label" : "$16,000.01", "value" : 16000.010000000000218278728425502777099609375
},
{ "label" : "$16,000.01", "value" : 16000.010000000000218278728425502777099609375
},
{ "label" : "1", "value" : 1 } ],
"rows" : [ {
"dataCells" : [
{ "label" : "Acme - 200 Widgets", "value" : "006R00000023IDYIA2" },
{ "label" : "$16,000.01",
"value" : { "amount" : 16000.01,
"currency" : null } },
{ "label" : "Word of mouth", "value" : "Word of mouth" },
{ "label" : "Need estimate", "value" : "Need estimate" },
{ "label" : "60%", "value" : 60 },
{ "label" : "Q3-2015", "value" : "Q3-2015" },
{ "label" : "12", "value" : 12 },
{ "label" : "7/31/2015", "value" : "2015-07-31" },
{ "label" : "Fred Wiliamson", "value" : "005R0000000Hv5rIAC" },
{ "label" : "-", "value" : null } ]
} ]
},
...
"groupingsAcross" : {
"groupings" : [
...
]
},
"groupingsDown" : {
"groupings" : [
...
]
},
"hasDetailRows" : true,
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"s!AMOUNT" : {
"acrossGroupingContext" : null,
"dataType" : "currency",
"downGroupingContext" : null,
"label" : "Sum of Amount" },
"a!AMOUNT" : {
"acrossGroupingContext" : null,
"dataType" : "currency",
"downGroupingContext" : null,
"label" : "Average Amount" },
"RowCount" : {
"acrossGroupingContext" : null,
"dataType" : "int",
"downGroupingContext" : null,
"label" : "Record Count" }
10
},
"detailColumnInfo" :
{ "OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" },
"AMOUNT" : { "dataType" : "currency", "label" : "Amount"},
"LEAD_SOURCE" : { "dataType" : "picklist", "label" : "Lead Source" },
"NEXT_STEP" : { "dataType" : "string", "label" : "Next Step" },
"PROBABILITY" : { "dataType" : "percent", "label" : "Probability (%)" },
"FISCAL_QUARTER" : { "dataType" : "string", "label" : "Fiscal Period" },
"AGE" : { "dataType" : "int", "label" : "Age" },
"CREATED_DATE" : { "dataType" : "datetime", "label" : "Created Date" },
"FULL_NAME" : { "dataType" : "string", "label" : "Opportunity Owner" },
"ROLLUP_DESCRIPTION" : { "dataType" : "string", "label" : "Owner Role" } },
"groupingColumnInfo" : {
"ACCOUNT_NAME" : { "dataType" : "string", "groupingLevel" : 0, "label" : "Account
Name" },
"CLOSE_DATE" : { "dataType" : "date", "groupingLevel" : 0, "label" : "Close Date"
},
"TYPE" : { "dataType" : "picklist", "groupingLevel" : 1, "label" : "Type" }}
},
"reportMetadata" : {
"aggregates" : [ "s!AMOUNT", "a!AMOUNT", "RowCount" ],
"chart" : {
"chartType" : "Donut",
"groupings" : [ "CLOSE_DATE" ],
"hasLegend" : true,
"showChartValues" : false,
"summaries" : [ "s!AMOUNT" ],
"summaryAxisLocations" : [ "Y" ],
"title" : "Pipeline by Stage and Type" },
"currency" : null,
"description" : null,
"detailColumns" : [ "OPPORTUNITY_NAME", "AMOUNT", "LEAD_SOURCE", "NEXT_STEP",
"PROBABILITY",
"FISCAL_QUARTER", "AGE", "CREATED_DATE", "FULL_NAME", "ROLLUP_DESCRIPTION" ],
"developerName" : "Deals_Closing_This_Quarter",
"division" : null,
"folderId" : "00lR0000000M8IiIAK",
"groupingsAcross" : [
{ "dateGranularity" : "Month", "name" : "CLOSE_DATE", "sortAggregate" : null,
"sortOrder" : "Asc" },
{ "dateGranularity" : "None", "name" : "TYPE", "sortAggregate" : null, "sortOrder"
: "Asc" } ],
"groupingsDown" : [
{ "dateGranularity" : "None", "name" : "ACCOUNT_NAME", "sortAggregate" : null,
"sortOrder" : "Asc" } ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OR0000000K2UeMAK",
"name" : "Deals Closing This Quarter",
11
"reportBooleanFilter" : null,
"reportFilters" : [
{ "column" : "BucketField_36625466", "isRunPageEditable" : false, "operator" :
"equals", "value" : "Early,Late" },
{ "column" : "TYPE", "isRunPageEditable" : false, "operator" : "equals", "value"
: "Existing Business,New Business" } ],
"reportFormat" : "MATRIX",
"reportType" : { "label" : "Opportunities", "type" : "Opportunity" },
"scope" : "organization",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CLOSE_DATE",
"durationValue" : "THIS_FISCAL_QUARTER",
"endDate" : "2015-09-30",
"startDate" : "2015-07-01" },
"standardFilters" : [
{ "name" : "open", "value" : "all" },
{ "name" : "probability", "value" : ">0" } ]
}
}
SEE ALSO:
Execute Sync
Instances List
Instance Results
Example
This GET request, /services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/describe, to the Describe
resource returns metadata for a matrix report. This includes a bucket field, groupings, summaries, and a custom summary formula.
{
"reportTypeMetadata": {
"categories": [
{
"label": "Opportunity Information",
"columns": {
12
"CREATED": {
"filterValues": [],
"label": "Created By",
"dataType": "string",
"filterable": true
},
...
"TYPE": {
"filterValues": [
{
"name": "Add-On Business",
"label": "Add-On Business"
},
{
"name": "New Business",
"label": "New Business"
},
{
"name": "Services",
"label": "Services"
}
],
"label": "Type",
"dataType": "picklist",
"filterable": true
},
}
...
},
"reportExtendedMetadata": {
"detailColumnInfo": {
"OPPORTUNITY_NAME": {
"label": "Opportunity Name",
"dataType": "string"
},
"PROBABILITY": {
"label": "Probability (%)",
"dataType": "percent"
},
"EXP_AMOUNT": {
"label": "Expected Revenue",
"dataType": "currency"
},
"NEXT_STEP": {
"label": "Next Step",
"dataType": "string"
},
"BucketField_34840671": {
"label": "Industry",
"dataType": "string"
}
},
"aggregateColumnInfo": {
"RowCount": {
13
14
"sortOrder": "Desc",
"dateGranularity": "FiscalQuarter"
}
],
"groupingsAcross": [
{
"name": "STAGE_NAME",
"sortOrder": "Desc",
"dateGranularity": "None"
},
{
"name": "ACCOUNT_LAST_ACTIVITY",
"sortOrder": "Asc",
"dateGranularity": "Week"
}
],
"reportType": {
"type": "Opportunity",
"label": "Opportunities"
},
"aggregates": [
"s!EXP_AMOUNT",
"FORMULA1",
"RowCount"
],
"reportFormat": "MATRIX",
"reportBooleanFilter": null,
"reportFilters": [
{
"value": "Closed Won,Closed Lost",
"column": "STAGE_NAME",
"operator": "notEqual"
},
{
"value": "50",
"column": "PROBABILITY",
"operator": "greaterThan"
}
],
"detailColumns": [
"OPPORTUNITY_NAME",
"PROBABILITY",
"EXP_AMOUNT",
"NEXT_STEP",
"BucketField_34840671"
]
}
}
SEE ALSO:
Describe
15
Example
A GET request, /services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/instances, to the Instances
List resource returns two instances of the report that was run asynchronously. Each URL handle stores report results for that instance.
[
{
"id": "0LGD000000000IyOAI",
"requestDate": "2013-08-12T19:06:47Z",
"status": "Success",
"url":
"/services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/instances/0LGD000000000IyOAI",
"ownerId": "005D0000001KvxRIAS",
"queryable" : false,
"hasDetailRows": false,
"completionDate": "2013-08-12T19:06:48Z"
},
{
"id": "0LGD000000000IjOAI",
"requestDate": "2013-08-12T18:39:06Z",
"status": "Success",
"url":
"/services/data/v29.0/analytics/reports/00OD0000001ZbP7MAK/instances/0LGD000000000IjOAI",
"ownerId": "005D0000001KvxRIAS",
"queryable" : false,
"hasDetailRows": false,
"completionDate": "2013-08-12T18:39:07Z"
}
]
SEE ALSO:
Instances List
16
filterValues
dataTypeFilterOperatorMap
reportFilters
You can filter reports during synchronous or asynchronous report runs by making a POST request to the Execute Sync or Execute Async
resource.
Example
In a POST request, an accounts report is filtered synchronously by these passing filters with filter logic in the metadata to the Execute
Sync resource.
1. Account Name not equal to Data Mart
2. Account Owner not equal to Admin User
3. Annual Revenue greater than "100,000"
4. Industry not equal to Manufacturing,Recreation
Filter logic: (1 OR 4) AND 2 AND 3.
{
"reportMetadata": {
"name": "FilterAcctsReport",
"id": "00OD0000001cw27MAA",
"reportFormat": "SUMMARY",
"reportBooleanFilter": "(1OR4)AND2AND3",
"reportFilters": [
{
"value": "DataMart",
"operator": "notEqual",
"column": "ACCOUNT.NAME"
},
{
"value": "AdminUser",
"operator": "notEqual",
"column": "USERS.NAME"
},
{
"value": "\"100,000\"",
"operator": "greaterThan",
"column": "SALES"
},
{
"value": "Manufacturing,Recreation",
"operator": "notEqual",
"column": "INDUSTRY"
}
],
"detailColumns": [
"RATING",
"LAST_UPDATE",
"SALES"
],
"developerName": "Filter_Accts_Report",
17
"reportType": {
"type": "AccountList",
"label": "Accounts"
},
"currency": null,
"aggregates": [
"s!SALES",
"RowCount"
],
"groupingsDown": [
{
"name": "USERS.NAME",
"sortAggregate": "s!SALES",
"sortOrder": "Desc",
"dateGranularity": "None"
},
{
"name": "ACCOUNT.NAME",
"sortAggregate": null,
"sortOrder": "Asc",
"dateGranularity": "None"
},
{
"name": "DUE_DATE",
"sortAggregate": null,
"sortOrder": "Asc",
"dateGranularity": "Month"
}
],
"groupingsAcross": []
}
}
In response to the POST request, the report returns data that meets the given criteria.
{
"hasDetailRows": false,
"attributes": {
"describeUrl": "/services/data/v29.0/analytics/reports/00OD0000001cw27MAA/describe",
"instancesUrl":
"/services/data/v29.0/analytics/reports/00OD0000001cw27MAA/instances",
"type": "Report",
"reportName": "Filter Accts Report",
"reportId": "00OD0000001cw27MAA"
},
"factMap": {
"1_0!T": {
"aggregates": [
{
"value": 56000000,
"label": "$56,000,000"
},
{
"value": 1,
18
"label": "1"
}
]
},
"7_1!T": {
"aggregates": [
{
"value":
"label":
},
{
"value":
"label":
}
]
},
24000000,
"$24,000,000"
1,
"1"
...
"allData": true,
"reportMetadata": {
"name": "Filter Accts Report",
"id": "00OD0000001cw27MAA",
"reportFormat": "SUMMARY",
"reportBooleanFilter": "(1 OR 4) AND 2 AND 3",
"reportFilters": [
{
"value": "Data Mart",
"operator": "notEqual",
"column": "ACCOUNT.NAME"
},
{
"value": "Admin User",
"operator": "notEqual",
"column": "USERS.NAME"
},
{
"value": "\"100,000\"",
"operator": "greaterThan",
"column": "SALES"
},
{
"value": "Manufacturing,Recreation",
"operator": "notEqual",
"column": "INDUSTRY"
}
],
"detailColumns": [
"RATING",
"LAST_UPDATE",
"SALES"
],
...
19
}
}
SEE ALSO:
Execute Sync
Example
This GET request /services/data/v35.0/analytics/reports to the Report List resource returns a list of 5 recently
viewed reports.
[
{
"describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2OmMAK/describe",
"id" : "00OR0000000K2OmMAK",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2OmMAK/instances",
"name" : "Pipeline By Industry",
"url" : "/services/data/v35.0/analytics/reports/00OR0000000K2OmMAK" },
{
"describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO/describe",
"id" : "00OR0000000OFXeMAO",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO/instances",
"name" : "My Open Pipeline",
"url" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO" },
{
"describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/describe",
"id" : "00OR0000000K2UeMAK",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances",
"name" : "Deals Closing This Quarter",
"url" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK" },
{
"describeUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFHoMAO/describe",
"id" : "00OR0000000OFHoMAO",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFHoMAO/instances",
20
SEE ALSO:
Report List
Tabular
T!T: The grand total of a report. Both record data values and the grand total are represented by this key.
Summary
Matrix
Each item in a row or column grouping is numbered starting with 0. Here are some examples of fact map keys:
Fact Map
Key
Description
0!T
1!T
0_0!T
The first item in the first-level grouping and the first item in the second-level grouping.
0_1!T
The first item in the first-level grouping and the second item in the second-level grouping.
Lets look at examples of how fact map keys represent data as it appears in a Salesforce tabular, summary, or matrix report.
21
Description
0!T
22
1_0!T
Summary of the probabilities for the Manufacturing opportunities in the Needs Analysis stage.
Description
0!0
0_0!0_0
Total opportunity amount in the Prospecting stage in the Manufacturing sector in October 2010.
2_1!1_1
Total value of opportunities in the Value Proposition stage in the Technology sector in February 2011.
T!T
SEE ALSO:
Execute Sync
Execute Async
Example
For report 00OD0000001cxIE, you want to change the report name to myUpdatedReport and change the folder that contains the
report. You save the changes to the report.
23
The response to the PATCH request returns the following details about the updated, saved report.
{
"reportExtendedMetadata" : {
...
},
"reportMetadata" : {
"aggregates" : [ "RowCount" ],
"chart" : null,
"currency" : null,
"description" : null,
"detailColumns" : [
"USERS.NAME",
"ACCOUNT.NAME",
"TYPE",
"DUE_DATE",
"LAST_UPDATE",
"ADDRESS1_STATE" ],
"developerName" : "myreport",
"division" : null,
"folderId" : "00DD00000007enHMAQ",
"groupingsAcross" : [ ],
"groupingsDown" : [ ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OD0000001cxIEMAY",
"name" : "myUpdatedReport",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
"reportFormat" : "TABULAR",
"reportType" : {
"label" : "Accounts",
"type" : "AccountList" },
"scope" : "user",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CREATED_DATE",
"durationValue" : "CUSTOM",
"endDate" : null,
"startDate" : null },
"standardFilters" : null },
"reportTypeMetadata" : {
...
24
Clone Reports
}
}
Clone Reports
Creates a copy of a custom, standard, or public report by sending a POST request to the Report List resource.
Example
You want to clone report 00OD0000001cxIE and name the cloned report as "myNewReport."
This POST request /services/data/v34.0/analytics/reports?cloneId=00OD0000001cxIE to the Report List
resource clones the report.
{ "reportMetadata" :
{"name":"myNewReport"}
}
The response to the POST request returns the following details about the cloned report.
{
"reportExtendedMetadata" : {
...
},
"reportMetadata" : {
"aggregates" : [ "RowCount" ],
"chart" : null,
"currency" : null,
"description" : null,
"detailColumns" : [
"USERS.NAME",
"ACCOUNT.NAME",
"TYPE",
"DUE_DATE",
"LAST_UPDATE",
"ADDRESS1_STATE" ],
"developerName" : "myreport2",
"division" : null,
"folderId" : "005D0000001UlszIAC",
"groupingsAcross" : [ ],
"groupingsDown" : [ ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OD0000001jabSMAQ",
"name" : "myNewReport",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
"reportFormat" : "TABULAR",
"reportType" : {
"label" : "Accounts",
"type" : "AccountList" },
"scope" : "user",
25
Delete Reports
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CREATED_DATE",
"durationValue" : "CUSTOM",
"endDate" : null,
"startDate" : null },
"standardFilters" : null },
"reportTypeMetadata" : {
...
}
}
Delete Reports
Delete a report by sending a DELETE request to the Report resource. Deleted reports are moved to the Recycle Bin.
Note: Deleting a report also cancels any running async report jobs and deletes all scheduled notifications.
Example
This DELETE request /services/data/v34.0/analytics/reports/00OD0000001cxIE to the Report resource deletes
the report and returns a 204 HTTP response code with no content in the response body.
26
Get Dashboard
Results
Filter Dashboard
Results
Get Dashboard
Status
Refresh a Dashboard
Save a Dashboard
Clone a Dashboard
Delete a Dashboard
The Dashboards API is designed to let you access and refresh dashboards easily. Use the API to:
Get List of Recently Used Dashboards
Get a list of dashboards with URLs to access status and results.
Get Dashboard Results
Get dashboard metadata, data, and status.
Filter Dashboard Results
Filter dashboard results, status, or refresh requests.
Get Dashboard Status
Get dashboard refresh status.
Refresh a Dashboard
Trigger a dashboard refresh.
Save a Dashboard
Save changes to a dashboard.
Clone a Dashboard
Make a copy of an existing dashboard.
Delete a Dashboard
Clean up unused and obsolete dashboards.
27
SEE ALSO:
Dashboard List
28
"componentId" : "01aD0000000a36LIAQ",
"reportResult" : {
"attributes" : null,
"allData" : true,
"factMap" : {
"T!T" : {
"aggregates" : [ {
"label" : "USD 67,043,365.50",
"value" : 67043365.50166918337345123291015625
} ]
},
"0!T" : {
"aggregates" : [ {
"label" : "USD 10,083.33",
"value" : 10083.333333333333939663134515285491943359375
} ]
},
"1!T" : {
"aggregates" : [ {
"label" : "USD 25,016,768.67",
"value" : 25016768.670066006481647491455078125
} ]
},
"2!T" : {
"aggregates" : [ {
"label" : "USD 42,016,513.50",
"value" : 42016513.49826984107494354248046875
} ]
}
},
"groupingsAcross" : null,
"groupingsDown" : {
"groupings" : [ {
"groupings" : [ ],
"key" : "0",
"label" : "-",
"value" : null
}, {
"groupings" : [ ],
"key" : "1",
"label" : "Existing Business",
"value" : "Existing Business"
}, {
"groupings" : [ ],
"key" : "2",
"label" : "New Business",
"value" : "New Business"
} ]
},
"hasDetailRows" : false,
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"s!AMOUNT" : {
"acrossGroupingContext" : null,
29
"dataType" : "currency",
"downGroupingContext" : null,
"label" : "Sum of Amount"
}
},
"detailColumnInfo" : { },
"groupingColumnInfo" : {
"TYPE" : {
"dataType" : "picklist",
"groupingLevel" : 0,
"label" : "Type"
}
}
},
"reportMetadata" : {
"aggregates" : [ "s!AMOUNT" ],
"chart" : null,
"currency" : "USD",
"description" : null,
"detailColumns" : [ ],
"developerName" : "Simple_Test",
"division" : null,
"folderId" : "00lR0000000M8IiIAK",
"groupingsAcross" : [ ],
"groupingsDown" : [ {
"dateGranularity" : "None",
"name" : "TYPE",
"sortAggregate" : null,
"sortOrder" : "Asc"
} ],
"hasDetailRows" : false,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OD0000001g2nWMAQ",
"name" : "Simple Test",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
"reportFormat" : "SUMMARY",
"reportType" : {
"label" : "Opportunities",
"type" : "Opportunity"
},
"scope" : "organization",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM",
"endDate" : null, "startDate" : null },
"standardFilters" : [
{ "name" : "open", "value" : "all" },
{ "name" : "probability", "value" : ">0" } ]
}
},
"status" : {
30
"dataStatus" : "DATA",
"errorCode" : null,
"errorMessage" : null,
"errorSeverity" : null,
"refreshDate" : "2014-04-09T00:28:16.000+0000",
"refreshStatus" : "IDLE"
}
} ],
"dashboardMetadata" : {
"attributes" : {
"dashboardId" : "01ZD00000007S89MAE",
"dashboardName" : "Simple Dashboard",
"statusUrl" : "/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE/status",
"type" : "Dashboard"
},
"canChangeRunningUser" : false,
"components" : [ {
"componentData" : 0,
"footer" : null,
"header" : null,
"id" : "01aD0000000a36LIAQ",
"properties" : {
"aggregates" : [ { "name" : "s!AMOUNT" } ],
"autoSelectColumns" : false,
"groupings" : null,
"maxRows" : null,
"sort" : { "column" : "TYPE", "sortOrder" : "asc" },
"useReportChart" : false,
"visualizationProperties" : {
"breakPoints" : [ {
"aggregateName" : "s!AMOUNT",
"breaks" : [
{ "color" : "000000", "lowerBound" : null, "upperBound" : -1 },
{ "color" : "000000", "lowerBound" : -1, "upperBound" : 0 },
{ "color" : "000000", "lowerBound" : 0, "upperBound" : null } ]
} ],
"metricLabel" : null },
"visualizationType" : "Metric" },
"reportId" : "00OD0000001g2nWMAQ",
"title" : null,
"type" : "Report"
} ],
"description" : null,
"developerName" : "Simple_Dashboard",
"filters" : [ {
"name" : "Amount",
"options" : [ {
"alias" : null,
"endValue" : null,
"id" : "0ICD00000004CBiOAM",
"operation" : "greaterThan",
"startValue" : null,
31
SEE ALSO:
Dashboard Results
32
"id" : "0ICxx0000000002GAA",
"alias" : "Canada",
"operation" : "equals",
"value" : "CA",
"startValue" : null,
"endValue" : null
} ],
...
}
To retrieve dashboard results with a filter of "Country equals Canada" you could make the following GET request:
/services/data/v31.0/analytics/dashboards/01Zxx0000000000000?filter1=0ICxx0000000002GAA
SEE ALSO:
Dashboard Results
Dashboard Status
: [ {
"01aD0000000J7M7",
"2014-03-10T17:26:07.000+0000",
: "IDLE"
"01aD0000000J7M9",
"2014-03-10T17:26:08.000+0000",
: "IDLE"
"01aD0000000J7MB",
"2014-03-10T17:26:09.000+0000",
: "IDLE"
33
Refresh a Dashboard
} ]
}
SEE ALSO:
Dashboard Status
Refresh a Dashboard
You can refresh a dashboard by using a PUT Dashboard Results request.
Use a PUT request on the Dashboard Results resource to trigger a refresh of a dashboard. The refresh response returns the URL of the
status resource after the refresh is triggered. If filter parameters are included in the PUT request, only the filtered data will be refreshed.
For more information on filtering, see Filter Dashboard Results.
Example Usage
The following PUT request refreshes the dashboard with the ID of 01ZD00000007S89MAE.
/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE
SEE ALSO:
Dashboard Results
Save a Dashboard
You can save changes to a dashboard by sending a PATCH request to the Dashboard Results resource.
Use a PATCH request on the Dashboard Results resource to save changes to a dashboard.
Example Usage
/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE
34
Save a Dashboard
35
Save a Dashboard
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"s!AMOUNT" : {
"acrossGroupingContext" : null,
"dataType" : "currency",
"downGroupingContext" : null,
"label" : "Sum of Amount"
}
},
"detailColumnInfo" : { },
"groupingColumnInfo" : {
"TYPE" : {
"dataType" : "picklist",
"groupingLevel" : 0,
"label" : "Type"
}
}
},
"reportMetadata" : {
"aggregates" : [ "s!AMOUNT" ],
"chart" : null,
"currency" : "USD",
"description" : null,
"detailColumns" : [ ],
"developerName" : "Simple_Test",
"division" : null,
"folderId" : "00lR0000000M8IiIAK",
"groupingsAcross" : [ ],
"groupingsDown" : [ {
"dateGranularity" : "None",
"name" : "TYPE",
"sortAggregate" : null,
"sortOrder" : "Asc"
} ],
"hasDetailRows" : false,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OD0000001g2nWMAQ",
"name" : "Simple Test",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
"reportFormat" : "SUMMARY",
"reportType" : {
"label" : "Opportunities",
"type" : "Opportunity"
},
"scope" : "organization",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : { "column" : "CLOSE_DATE", "durationValue" : "CUSTOM",
"endDate" : null, "startDate" : null },
"standardFilters" : [
{ "name" : "open", "value" : "all" },
36
Save a Dashboard
37
Clone a Dashboard
"endValue" : null,
"id" : "0ICD00000004CBiOAM",
"operation" : "greaterThan",
"startValue" : null,
"value" : "USD 2000000"
} ],
"selectedOption" : null
} ],
"folderId" : "00lR0000000DrojIAC",
"id" : "01ZD00000007S89MAE",
"layout" : {
"columns" : [ {
"components" : [ 0 ]
} ]
},
"name" : "Simple Dashboard",
"runningUser" : {
"displayName" : "Allison Wheeler",
"id" : "005D00000016V2qIAE"
}
}
}
Clone a Dashboard
Creates a copy of a dashboard by sending a POST request to the Dashboard List resource.
Example
You want to clone dashboard 01ZR00000008gkvMAA and save it in a new folder with ID 00lR0000000DnRZIA0.
This POST request /services/data/v35.0/analytics/dashboards/?cloneId=01ZR00000008gkvMAA to the
Dashboard List resource clones the dashboard.
{"folderId":"00lR0000000DnRZIA0"}
The response to the POST request returns the following details about the cloned dashboard.
{ "attributes" :
{ "dashboardId" : "01ZR00000004SZZMA2",
"dashboardName" : "Sales Manager Dashboard",
"statusUrl" : "/services/data/v35.0/analytics/dashboards/01ZR00000004SZZMA2/status",
"type" : "Dashboard" },
...
"folderId" : "00lR0000000DnRZIA0",
"id" : "01ZR00000004SZZMA2",
"layout" : {
"columns" : [
{ "components" : [ 0, 1, 2, 3 ] },
{ "components" : [ 4, 5, 6 ] },
{ "components" : [ 7 ] } ],
"gridLayout" : false },
38
Delete a Dashboard
Delete a Dashboard
Delete a dashboard by sending a DELETE request to the Dashboard Results resource. Deleted dashboards are moved to the Recycle Bin.
Example
This DELETE request /services/data/v34.0/analytics/dashboards/01ZD00000007S89MAE to the Dashboard
Results resource deletes the dashboard and returns a 204 HTTP response code with no content in the response body.
39
Report
Describe
Execute Sync
Execute Async
Instances List
Instance Results
Report List
Supported Description
HTTP
Method
Report
PATCH
DELETE
Deletes a report.
Describe
GET
Execute Sync
GET
POST
Execute Async
POST
Instances List
GET
Instance Results
GET
Report List
GET
POST
40
Report
Report
Saves changes to a report or deletes a report.
Resource URL
Data
Summary
URL
/services/data/<latest API version>/analytics/reports/<report ID>
Formats
JSON
HTTP Methods
Method
Description
PATCH
DELETE
Type
Description
aggregates
Array of strings
buckets
Bucket field
chart
Chart[]
crossFilters
41
Report
Property
Type
Description
customSummaryFormula
Custom summary
formula
currency
String
Report currency, such as USD, EUR, GBP, for an organization that has
Multi-Currency enabled. Value is null if the organization does not
have Multi-Currency enabled.
detailColumns
Array of strings
Unique API names for the fields that have detailed data.
developerName
String
division
String
folderId
String
groupingsAcross
Groupings across[]
Unique identities for each column grouping in a report. The identity is:
An empty array for reports in summary format as it cant have
column groupings.
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for a column
grouping.
groupingsDown
Groupings down[]
Unique identities for each row grouping in a report. The identity is:
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for grouping.
hasDetailRows
Boolean
hasRecordCount
Boolean
id
String
name
String
reportBooleanFilter
String
Logic to parse custom field filters. Value is null when filter logic is
not specified.
This is an example of a report filtered to show opportunities for accounts
that are either of customer or partner type OR their annual revenue
42
Property
Report
Type
Description
exceeds 100K AND they are medium or large sized businesses. The
filters are processed by the logic, (1 OR 2) AND 3.
{
...
"reportBooleanFilter": "(1 OR 2) AND
3",
"reportFilters": [
{
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
{
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
reportFilters
Filter details[]
List of each custom filter in the report along with the field name, filter
operator, and filter value.
reportFormat
String
reportType
Report type
Unique API name and display name for the report type.
type: Of type string, this is the unique identifier of the report type.
label: Of type string, this is the display name of the report type.
scope
String
Defines the scope of the data on which you run the report. For example,
you can run the report against all opportunities, opportunities you own,
or opportunities your team owns. Valid values depend on the report
type.
showGrandTotal
Boolean
showSubtotals
Boolean
43
Report
Property
Type
Description
sortBy
String
API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
standardDateFilter
Array of strings
Array of strings
List of filters that show up in the report by default. The filters vary by
report type. For example, standard filters for reports on the Opportunity
object are Show, Opportunity Status, and Probability. This list appears
as name-value string pairs.
topRows
Top rows
Type
Description
reportMetadata
Report metadata
reportTypeMetadata
Fields in each section of a report type plus filter information for those
fields.
metadata
Report metadata
Property
Type
Description
aggregates
Array of strings
44
Property
Report
Type
Description
s!<customfieldID> represents the sum of a custom field
column. For custom fields and custom report types, the identity
is a combination of the summary type and the field ID.
buckets
Bucket field
chart
Chart[]
crossFilters
customSummaryFormula
Custom summary
formula
currency
String
Report currency, such as USD, EUR, GBP, for an organization that has
Multi-Currency enabled. Value is null if the organization does not
have Multi-Currency enabled.
detailColumns
Array of strings
Unique API names for the fields that have detailed data.
developerName
String
division
String
folderId
String
groupingsAcross
Groupings across[]
groupingsDown
Groupings down[]
Unique identities for each row grouping in a report. The identity is:
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for grouping.
hasDetailRows
Boolean
45
Report
Property
Type
Description
hasRecordCount
Boolean
id
String
name
String
reportBooleanFilter
String
Logic to parse custom field filters. Value is null when filter logic is
not specified.
This is an example of a report filtered to show opportunities for
accounts that are either of customer or partner type OR their annual
revenue exceeds 100K AND they are medium or large sized
businesses. The filters are processed by the logic, (1 OR 2) AND 3.
{
...
"reportBooleanFilter": "(1 OR 2) AND
3",
"reportFilters": [
{
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
{
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
reportFilters
Filter details[]
List of each custom filter in the report along with the field name, filter
operator, and filter value.
reportFormat
String
reportType
Report type
Unique API name and display name for the report type.
type: Of type string, this is the unique identifier of the report type.
46
Property
Report
Type
Description
label: Of type string, this is the display name of the report type.
scope
String
Defines the scope of the data on which you run the report. For
example, you can run the report against all opportunities,
opportunities you own, or opportunities your team owns. Valid values
depend on the report type.
showGrandTotal
Boolean
showSubtotals
Boolean
sortBy
String
API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
standardDateFilter
Array of strings
data.
durationValue: The range for which you want to run the report.
Array of strings
List of filters that show up in the report by default. The filters vary by
report type. For example, standard filters for reports on the
Opportunity object are Show, Opportunity Status, and Probability.
This list appears as name-value string pairs.
topRows
Top rows
Property
Type
Description
chartType
String
Type of chart.
groupings
String
Report grouping.
hasLegend
Boolean
showChartValues
Boolean
summaries
Array of strings
Chart
47
Property
Report
Type
Description
m!Amount represents the minimum value of the Amount
column.
x!Amount represents the maximum value of the Amount
column.
s!<customfieldID> represents the sum of a custom field
column. For custom fields and custom report types, the identity
is a combination of the summary type and the field ID.
summaryAxisLocations
String
Specifies the axis that shows the summary values. Valid values are X
and Y.
title
String
Property
Type
Description
name
String
sortOrder
String
Order in which data is sorted within a row grouping. Value can be:
Groupings down
String
Interval set on a date field thats used as a row grouping. Value can
be:
Day
Calendar Week
Calendar Month
Calendar Quarter
Calendar Year
Fiscal Quarter
Fiscal Year
Calendar Month in Year
Calendar Day in Month
sortAggregate
String
48
Property
Report
Type
Description
{
"name": "USERS.NAME",
"sortOrder": "Desc",
"dateGranularity": "None",
"sortAggregate": "s!SALES"
}
]
}
Groupings across
Property
Type
Description
name
String
sortOrder
String
dateGranularity
String
Interval set on a date field used as a column grouping. Value can be:
Day
Calendar Week
Calendar Month
Calendar Quarter
Calendar Year
Fiscal Quarter
Fiscal Year
Calendar Month in Year
Calendar Day in Month
Filter details
Property
Type
Description
column
String
isRunPageEditable
Boolean
operator
String
Unique API name for the condition used to filter a field such as
greater than or not equal to. Filter conditions depend on the data
type of the field.
value
String
Value by which a field is filtered. For example, the field Age can be
filtered by a numeric value.
49
Report
Type
Description
categories
Categories[]
dataTypeFilterOperatorMap
Filter operator
reference
Lists all the possible field data types that can be used to filter
the report. Each data type, such as phone, percent, currency,
or picklist has two properties:
name: Of type string, this is a unique API name for each field
Division info[]
scopeInfo
Scope info[]
Scope of the data on which you run the report. For example,
you can run the report against all opportunities, opportunities
you own, or opportunities your team owns. Valid values
depend on the report type.
standardDateFilterDurationGroups Standard date filter List of standard date filters available in reports.
duration groups[]
Array of strings
standardFilterInfos
Categories
Property
Type
Description
label
String
Display name of a section in the report type under which fields are
organized. For example, in an Accounts with Contacts custom report
type, Account General is the display name of the section that
has fields on general account information.
columns
Column map
Information for all fields in the report type organized under a particular
sections unique API name.
50
Report
Column map
Property
Type
Description
label
String
filterValues
String array
All filter values for a field, if the field data type is of picklist, multi-select
picklist, boolean, or checkbox. For example, checkbox fields always
have a value of True or False. For fields of other data types, the
filter value is an empty array because their values cant be determined.
Filter values have two properties:
name: Unique API name for a filter value. Of type string.
label: Display name of a filter value. Of type string.
dataType
String
filterable
Boolean
False means that the field is of a type that cant be filtered. For
example, fields of the type Encrypted Text cant be filtered.
Property
Type
Description
defaultValue
String
Users are assigned a default division that applies to their newly created
accounts, leads, and custom objects that are enabled for divisions.
values
String
Division info
Scope Info
Property
Type
Description
defaultValue
String
values
Array of strings
All scope values. Valid values depend on the report type. Scope values
have the following properties:
allowsDivision: Allows you to segment the report by this scope.
label: Display name of the scope.
value: Value of the scope.
51
Report
Type
Description
label
String
durations[]
Details about each possible relative date filter defined under the
standard date filter grouping.
Type
Description
endDate
String
label
String
Display name of a date filter. Valid date filters are relative date
filterslike Current FY and Current FQand custom date
filters.
startDate
String
value
String
API name of a date filter. Valid date filters are relative date filterslike
THIS_FISCAL_YEAR and NEXT_FISCAL_QUARTERand
custom date filters.
Property
Type
Description
aggregateColumnInfo
Aggregate column
information
detailColumnInfo
Detail column
information
Two properties for each field that has detailed data identified by its
unique API name. The detailed data fields are also listed in the report
metadata.
groupingColumnInfo
Grouping column
information
Type
Description
label
String
52
Report
Property
Type
Description
dataType
String
acrossGroupingContext
String
downGroupingContext
String
53
Property
Report
Type
Description
Property
Type
Description
label
String
dataType
String
The data type of the field that has detailed data. Possible values are:
string
boolean
double
int
percent
currency
date
datetime
time
picklist
multipicklist
id
reference
textarea
phone
combobox
url
email
html
Type
Description
label
String
54
Report
Property
Type
Description
dataType
String
Data type of the field used for grouping. Possible values are:
string
boolean
double
int
percent
currency
date
datetime
time
picklist
multipicklist
id
reference
textarea
phone
combobox
url
email
html
groupingLevel
Integer
Bucket field
Property
Type
Description
bucketType
BucketType
developerName
String
label
String
nullTreatedAsZero
Boolean
55
Report
Property
Type
Description
otherBucketLabel
String
sourceColumnName
String
values
Array of
BucketTypeValues
Property
Type
Description
label
String
sourceDimensionValues
String
A list of the values from the source field included in this bucket
category (in buckets of type PICKLIST and buckets of type TEXT).
rangeUpperBound
Double
The greatest range limit under which values are included in this
bucket category (in buckets of type NUMBER).
Property
Type
Description
criteria
Array of Filter details[] Information about how to filter the relatedEntity. Use to relate
the primary entity with a subset of the relatedEntity.
includesObject
Boolean
primaryEntityField
String
relatedEntity
String
relatedEntityJoinField
String
Property
Type
Description
label
String
description
String
formulaType
String
decimalPlaces
Integer
Cross filter
56
Describe
Property
Type
Description
downGroup
String
downGroupType
String
acrossGroup
String
acrossGroupType
String
formula
String
Property
Type
Description
rowLimit
Integer
direction
String
Top rows
Describe
Retrieves report, report type, and related metadata for a tabular, summary, or matrix report.
Report metadata gives information about the report as a whole. Tells you such things as, the report type, format, the fields that are
summaries, row or column groupings, filters saved to the report, and so on.
Report type metadata tells you about all the fields available in the report type, those you can filter, and by what filter criteria.
Report extended metadata tells you about the fields that are summaries, groupings, and contain record details in the report. A
property that displays null indicates that its value is not available.
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>/describe
Formats
JSON
HTTP Methods
Method
Description
GET
Retrieves report, report type, and related metadata for a tabular, summary, or matrix report. See this example.
57
Describe
Response Body
Property
Type
Description
reportMetadata
Report metadata
reportTypeMetadata
Fields in each section of a report type plus filter information for those
fields.
metadata
Report metadata
Property
Type
Description
aggregates
Array of strings
buckets
Bucket field
chart
Chart[]
crossFilters
customSummaryFormula
Custom summary
formula
currency
String
Report currency, such as USD, EUR, GBP, for an organization that has
Multi-Currency enabled. Value is null if the organization does not
have Multi-Currency enabled.
detailColumns
Array of strings
Unique API names for the fields that have detailed data.
developerName
String
division
String
58
Property
Describe
Type
Description
have the Affected by Divisions permission, your reports include
records in all divisions.
folderId
String
groupingsAcross
Groupings across[]
groupingsDown
Groupings down[]
Unique identities for each row grouping in a report. The identity is:
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for grouping.
hasDetailRows
Boolean
hasRecordCount
Boolean
id
String
name
String
reportBooleanFilter
String
Logic to parse custom field filters. Value is null when filter logic is
not specified.
This is an example of a report filtered to show opportunities for
accounts that are either of customer or partner type OR their annual
revenue exceeds 100K AND they are medium or large sized
businesses. The filters are processed by the logic, (1 OR 2) AND 3.
{
...
"reportBooleanFilter": "(1 OR 2) AND
3",
"reportFilters": [
{
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
{
59
Property
Describe
Type
Description
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
reportFilters
Filter details[]
List of each custom filter in the report along with the field name, filter
operator, and filter value.
reportFormat
String
reportType
Report type
Unique API name and display name for the report type.
type: Of type string, this is the unique identifier of the report type.
label: Of type string, this is the display name of the report type.
scope
String
Defines the scope of the data on which you run the report. For
example, you can run the report against all opportunities,
opportunities you own, or opportunities your team owns. Valid values
depend on the report type.
showGrandTotal
Boolean
showSubtotals
Boolean
sortBy
String
API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
standardDateFilter
Array of strings
data.
durationValue: The range for which you want to run the report.
60
Describe
Property
Type
Description
standardFilters
Array of strings
List of filters that show up in the report by default. The filters vary by
report type. For example, standard filters for reports on the
Opportunity object are Show, Opportunity Status, and Probability.
This list appears as name-value string pairs.
topRows
Top rows
Property
Type
Description
chartType
String
Type of chart.
groupings
String
Report grouping.
hasLegend
Boolean
showChartValues
Boolean
summaries
Array of strings
Chart
String
Specifies the axis that shows the summary values. Valid values are X
and Y.
title
String
Property
Type
Description
name
String
sortOrder
String
Order in which data is sorted within a row grouping. Value can be:
Groupings down
61
Describe
Property
Type
Description
dateGranularity
String
Interval set on a date field thats used as a row grouping. Value can
be:
Day
Calendar Week
Calendar Month
Calendar Quarter
Calendar Year
Fiscal Quarter
Fiscal Year
Calendar Month in Year
Calendar Day in Month
sortAggregate
String
Groupings across
Property
Type
Description
name
String
sortOrder
String
dateGranularity
String
Interval set on a date field used as a column grouping. Value can be:
Day
Calendar Week
62
Property
Describe
Type
Description
Calendar Month
Calendar Quarter
Calendar Year
Fiscal Quarter
Fiscal Year
Calendar Month in Year
Calendar Day in Month
Filter details
Property
Type
Description
column
String
isRunPageEditable
Boolean
operator
String
Unique API name for the condition used to filter a field such as
greater than or not equal to. Filter conditions depend on the data
type of the field.
value
String
Value by which a field is filtered. For example, the field Age can be
filtered by a numeric value.
Type
Description
categories
Categories[]
dataTypeFilterOperatorMap
Filter operator
reference
Lists all the possible field data types that can be used to filter
the report. Each data type, such as phone, percent, currency,
or picklist has two properties:
name: Of type string, this is a unique API name for each field
Division info[]
scopeInfo
Scope info[]
Scope of the data on which you run the report. For example,
you can run the report against all opportunities, opportunities
63
Describe
Property
Type
Description
you own, or opportunities your team owns. Valid values
depend on the report type.
standardDateFilterDurationGroups Standard date filter List of standard date filters available in reports.
duration groups[]
Array of strings
standardFilterInfos
Categories
Property
Type
Description
label
String
Display name of a section in the report type under which fields are
organized. For example, in an Accounts with Contacts custom report
type, Account General is the display name of the section that
has fields on general account information.
columns
Column map
Information for all fields in the report type organized under a particular
sections unique API name.
Property
Type
Description
label
String
filterValues
String array
All filter values for a field, if the field data type is of picklist, multi-select
picklist, boolean, or checkbox. For example, checkbox fields always
have a value of True or False. For fields of other data types, the
filter value is an empty array because their values cant be determined.
Filter values have two properties:
Column map
String
filterable
Boolean
False means that the field is of a type that cant be filtered. For
example, fields of the type Encrypted Text cant be filtered.
64
Describe
Division info
Property
Type
Description
defaultValue
String
Users are assigned a default division that applies to their newly created
accounts, leads, and custom objects that are enabled for divisions.
values
String
Scope Info
Property
Type
Description
defaultValue
String
values
Array of strings
All scope values. Valid values depend on the report type. Scope values
have the following properties:
allowsDivision: Allows you to segment the report by this scope.
label: Display name of the scope.
value: Value of the scope.
Type
Description
label
String
durations[]
Details about each possible relative date filter defined under the
standard date filter grouping.
Type
Description
endDate
String
label
String
Display name of a date filter. Valid date filters are relative date
filterslike Current FY and Current FQand custom date
filters.
startDate
String
65
Describe
Property
Type
Description
value
String
API name of a date filter. Valid date filters are relative date filterslike
THIS_FISCAL_YEAR and NEXT_FISCAL_QUARTERand
custom date filters.
Property
Type
Description
aggregateColumnInfo
Aggregate column
information
detailColumnInfo
Detail column
information
Two properties for each field that has detailed data identified by its
unique API name. The detailed data fields are also listed in the report
metadata.
groupingColumnInfo
Grouping column
information
Type
Description
label
String
dataType
String
acrossGroupingContext
String
66
Describe
Property
Type
Description
downGroupingContext
String
Type
Description
label
String
dataType
String
The data type of the field that has detailed data. Possible values are:
string
boolean
double
int
percent
currency
67
Property
Describe
Type
Description
date
datetime
time
picklist
multipicklist
id
reference
textarea
phone
combobox
url
email
html
Type
Description
label
String
dataType
String
Data type of the field used for grouping. Possible values are:
string
boolean
double
int
percent
currency
date
datetime
time
picklist
multipicklist
id
reference
textarea
phone
combobox
url
email
68
Property
Describe
Type
Description
html
groupingLevel
Integer
Bucket field
Property
Type
Description
bucketType
BucketType
developerName
String
label
String
nullTreatedAsZero
Boolean
otherBucketLabel
String
sourceColumnName
String
values
Array of
BucketTypeValues
Property
Type
Description
label
String
sourceDimensionValues
String
A list of the values from the source field included in this bucket
category (in buckets of type PICKLIST and buckets of type TEXT).
rangeUpperBound
Double
The greatest range limit under which values are included in this
bucket category (in buckets of type NUMBER).
Property
Type
Description
criteria
Array of Filter details[] Information about how to filter the relatedEntity. Use to relate
the primary entity with a subset of the relatedEntity.
Cross filter
69
Describe
Property
Type
Description
includesObject
Boolean
primaryEntityField
String
relatedEntity
String
relatedEntityJoinField
String
Property
Type
Description
label
String
description
String
formulaType
String
decimalPlaces
Integer
downGroup
String
downGroupType
String
acrossGroup
String
acrossGroupType
String
formula
String
Property
Type
Description
rowLimit
Integer
direction
String
Top rows
SEE ALSO:
Execute Sync
Execute Async
70
Execute Sync
Execute Sync
Runs a report immediately with or without changing filters, groupings, or aggregates and returns the latest summary data with or without
details for your level of access.
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>
Formats
JSON
HTTP Methods
Method
Description
GET
POST
Get specific results by passing dynamic filters, groupings, and aggregates in the report metadata. See this example.
Type
Description
aggregates
Array of strings
buckets
Bucket field
chart
Chart[]
crossFilters
customSummaryFormula
Custom summary
formula
71
Execute Sync
Property
Type
Description
currency
String
Report currency, such as USD, EUR, GBP, for an organization that has
Multi-Currency enabled. Value is null if the organization does not
have Multi-Currency enabled.
detailColumns
Array of strings
Unique API names for the fields that have detailed data.
developerName
String
division
String
folderId
String
groupingsAcross
Groupings across[]
Unique identities for each column grouping in a report. The identity is:
An empty array for reports in summary format as it cant have
column groupings.
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for a column
grouping.
groupingsDown
Groupings down[]
Unique identities for each row grouping in a report. The identity is:
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for grouping.
hasDetailRows
Boolean
hasRecordCount
Boolean
id
String
name
String
reportBooleanFilter
String
Logic to parse custom field filters. Value is null when filter logic is
not specified.
This is an example of a report filtered to show opportunities for accounts
that are either of customer or partner type OR their annual revenue
72
Property
Execute Sync
Type
Description
exceeds 100K AND they are medium or large sized businesses. The
filters are processed by the logic, (1 OR 2) AND 3.
{
...
"reportBooleanFilter": "(1 OR 2) AND
3",
"reportFilters": [
{
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
{
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
reportFilters
Filter details[]
List of each custom filter in the report along with the field name, filter
operator, and filter value.
reportFormat
String
reportType
Report type
Unique API name and display name for the report type.
type: Of type string, this is the unique identifier of the report type.
label: Of type string, this is the display name of the report type.
scope
String
Defines the scope of the data on which you run the report. For example,
you can run the report against all opportunities, opportunities you own,
or opportunities your team owns. Valid values depend on the report
type.
showGrandTotal
Boolean
showSubtotals
Boolean
73
Execute Sync
Property
Type
Description
sortBy
String
API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
standardDateFilter
Array of strings
Array of strings
List of filters that show up in the report by default. The filters vary by
report type. For example, standard filters for reports on the Opportunity
object are Show, Opportunity Status, and Probability. This list appears
as name-value string pairs.
topRows
Top rows
Response Body
Property
Type
Description
attributes
Attributes
allData
Boolean
factMap
Fact map
Summary level data or both summary and detailed data for each row
or column grouping. Detailed data is available if hasDetailRows
is true.
Each row or column grouping is represented by combination of row
and column grouping keys defined in Groupings down and
Groupings across.
See these examples of fact map keys.
groupingsAcross
Groupings across
groupingsDown
Groupings down
hasDetailRows
Boolean
When true,the fact map returns values for both summary level
and record level data.
74
Property
Execute Sync
Type
Description
When false, the fact map returns summary values.
reportExtendedMetadata
Report extended
metadata
reportMetadata
Report metadata
Attributes
Property
Type
Description
describeUrl
String
instancesUrl
String
type
String
reportName
String
reportId
String
Property
Type
Description
rows
Data cells[]
aggregates
Aggregates[]
Property
Type
Description
value
label
String
Property
Type
Description
value
Number
Fact map
Data cells
Aggregates
75
Execute Sync
Property
Type
Description
label
String
Property
Type
Description
groupings
Groupings[]
Property
Type
Description
value
String
Groupings across
Groupings
Currency fields:
amount: Of type currency. Value of a data cell.
currency: Of type picklist. The ISO 4217 currency code,
if available; for example, USD for US dollars or CNY for
Chinese yuan. (If the grouping is on the converted
currency, this is the currency code for the report and not
for the record.)
Picklist fields: API name. For example, a custom picklist field,
Type of Business with values 1, 2, 3 for Consulting,
Services, and Add-On Business, has 1, 2, or 3 as the grouping
value.
ID fields: API name.
Record type fields: API name.
Date and time fields: Date or time in ISO-8601 format.
Lookup fields: Unique API name. For example, for the
Opportunity Owner lookup field, the ID of each
opportunity owners Chatter profile page can be a grouping
value.
key
String
label
String
groupings
Array
dategroupings
Array
76
Execute Async
Groupings down
Property
Type
Description
groupings
Groupings[]
SEE ALSO:
Describe
Execute Async
Execute Async
Runs an instance of a report asynchronously with or without filters and returns a handle that stores the results of the run. The results can
contain summary data with or without details.
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>/instances
Formats
JSON
HTTP Methods
Method
Description
POST
Runs an instance of a report asynchronously. See this example. Also see this example of a GET request that returns a
list of asynchronous runs of a report.
Type
Description
aggregates
Array of strings
77
Property
Execute Async
Type
Description
s!<customfieldID> represents the sum of a custom field
column. For custom fields and custom report types, the identity is
a combination of the summary type and the field ID.
buckets
Bucket field
chart
Chart[]
crossFilters
customSummaryFormula
Custom summary
formula
currency
String
Report currency, such as USD, EUR, GBP, for an organization that has
Multi-Currency enabled. Value is null if the organization does not
have Multi-Currency enabled.
detailColumns
Array of strings
Unique API names for the fields that have detailed data.
developerName
String
division
String
folderId
String
groupingsAcross
Groupings across[]
Unique identities for each column grouping in a report. The identity is:
An empty array for reports in summary format as it cant have
column groupings.
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for a column
grouping.
groupingsDown
Groupings down[]
Unique identities for each row grouping in a report. The identity is:
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for grouping.
hasDetailRows
Boolean
hasRecordCount
Boolean
78
Property
Execute Async
Type
Description
List of historical snapshot dates.
id
String
name
String
reportBooleanFilter
String
Logic to parse custom field filters. Value is null when filter logic is
not specified.
This is an example of a report filtered to show opportunities for accounts
that are either of customer or partner type OR their annual revenue
exceeds 100K AND they are medium or large sized businesses. The
filters are processed by the logic, (1 OR 2) AND 3.
{
...
"reportBooleanFilter": "(1 OR 2) AND
3",
"reportFilters": [
{
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
{
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
reportFilters
Filter details[]
List of each custom filter in the report along with the field name, filter
operator, and filter value.
reportFormat
String
reportType
Report type
Unique API name and display name for the report type.
type: Of type string, this is the unique identifier of the report type.
label: Of type string, this is the display name of the report type.
79
Execute Async
Property
Type
Description
scope
String
Defines the scope of the data on which you run the report. For example,
you can run the report against all opportunities, opportunities you own,
or opportunities your team owns. Valid values depend on the report
type.
showGrandTotal
Boolean
showSubtotals
Boolean
sortBy
String
API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
standardDateFilter
Array of strings
Array of strings
List of filters that show up in the report by default. The filters vary by
report type. For example, standard filters for reports on the Opportunity
object are Show, Opportunity Status, and Probability. This list appears
as name-value string pairs.
topRows
Top rows
Response Body
Property
Type
Description
id
String
status
String
New if the report run has just been triggered through a request.
Success if the report ran.
Running if the report is being run.
Error if the report run failed. The instance of a report run can return an error if, for
example, your permission to access the report has been removed since you requested
the run.
url
String
URL where results of the report run for that instance are stored. The value is null if the
report couldnt be run because of an error.
ownerId
String
80
Instances List
Property
Type
Description
completionDate
Date, time
string
Date, time when the instance of the report run finished. Only available if the report instance
ran successfully or couldnt be run because of an error. Date-time information is in ISO-8601
format.
hasDetailRows
Boolean
When false, indicates that summary level data was requested for the report instance.
When true, indicates that detailed data, which includes summary level data, was
requested for the report instance.
requestDate
Date, time
string
Date and time when an instance of the report run was requested. Date-time information
is in ISO-8601 format.
SEE ALSO:
Describe
Execute Sync
Instances List
Returns a list of instances for a report that you requested to be run asynchronously. Each item in the list is treated as a separate instance
of the report run with metadata in that snapshot of time.
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>/instances
Formats
JSON
HTTP Methods
Method
Description
GET
Response Body
Property
Type
Description
id
String
Unique ID for a report instance that was requested for a run. The ID is used to
obtain results of the report run for that instance.
status
String
New if the report run has just been triggered through a POST request.
81
Property
Instance Results
Type
Description
Success if the report ran.
Running if the report is being run.
Error if the report run failed. The instance of a report run can return an
error if, for example, your permission to access the report has been removed
since you requested the run.
url
String
URL where results of the report run for that instance are stored. The value is
null if the report couldnt be run because of an error.
ownerId
String
hasDetailRows
Boolean
When false, indicates that summary level data was requested for the
report run.
When true, indicates that detailed data, which includes summary level
data, was requested for the report run.
completionDate
Date, time when the instance of the report run finished. Only available if the
report instance ran successfully or couldnt be run because of an error. Date-time
information is in ISO-8601 format.
requestDate
Date and time when an instance of the report run was requested. Date-time
information is in ISO-8601 format.
SEE ALSO:
Execute Async
Instance Results
Instance Results
Retrieves results for an instance of a report run asynchronously with or without filters. Depending on your asynchronous report run
request, data can be at the summary level or include details.
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>/instances/<instance
ID>
Formats
JSON
82
Instance Results
HTTP Methods
Method
Description
GET
Response Body
Property
Type
Description
hasDetailRows
Boolean
allData
Boolean
reportMetadata
Report metadata
factMap
Fact map
Collection of summary level data or both detailed and summary level data.
attributes
Attributes
metadata
groupingsDown
Groupings down
groupingsAcross
Groupings across
Attributes
Property
Type
Description
id
String
status
String
New if the report run has just been triggered through a request.
Success if the report ran.
Running if the report is being run.
Error if the report run failed. The instance of a report run can return
an error if, for example, your permission to access the report has been
removed since you requested the run.
ownerId
String
completionDate
Date, time when the instance of the report run finished. Only available if
the report instance ran successfully or couldnt be run because of an error.
Date-time information is in ISO-8601 format.
83
Report List
Property
Type
Description
requestDate
Date and time when an instance of the report run was requested. Date-time
information is in ISO-8601 format.
type
String
reportId
String
reportName
String
SEE ALSO:
Execute Async
Instances List
Report List
Displays a list of up to 200 tabular, matrix, or summary reports that you recently viewed. To get a full list of reports by format, name, and
other fields, use a SOQL query on the Report object. The resource can also be used to make a copy of a report.
Resource URL
Task
List reports
Copy report
URL
/services/data/<latest API version>/analytics/reports
Formats
JSON
HTTP Methods
Method
Description
GET
List of reports that were recently viewed by the API user. See this example.
POST
84
Report List
Type
Description
name
String
id
String
url
String
describeUrl
String
instancesUrl
String
Information for each instance of the report that was run asynchronously.
Type
Description
aggregates
Array of strings
buckets
Bucket field
chart
Chart[]
crossFilters
customSummaryFormula
Custom summary
formula
currency
String
Report currency, such as USD, EUR, GBP, for an organization that has
Multi-Currency enabled. Value is null if the organization does not
have Multi-Currency enabled.
detailColumns
Array of strings
Unique API names for the fields that have detailed data.
developerName
String
division
String
85
Property
Report List
Type
Description
Available only if your organization uses divisions to segment data and
you have the Affected by Divisions permission. If you do not have the
Affected by Divisions permission, your reports include records in all
divisions.
folderId
String
groupingsAcross
Groupings across[]
Unique identities for each column grouping in a report. The identity is:
An empty array for reports in summary format as it cant have
column groupings.
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for a column
grouping.
groupingsDown
Groupings down[]
Unique identities for each row grouping in a report. The identity is:
BucketField_(ID) for bucket fields.
ID of a custom field when the custom field is used for grouping.
hasDetailRows
Boolean
hasRecordCount
Boolean
id
String
name
String
reportBooleanFilter
String
Logic to parse custom field filters. Value is null when filter logic is
not specified.
This is an example of a report filtered to show opportunities for accounts
that are either of customer or partner type OR their annual revenue
exceeds 100K AND they are medium or large sized businesses. The
filters are processed by the logic, (1 OR 2) AND 3.
{
...
"reportBooleanFilter": "(1 OR 2) AND
3",
"reportFilters": [
{
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
86
Property
Report List
Type
Description
{
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
reportFilters
Filter details[]
List of each custom filter in the report along with the field name, filter
operator, and filter value.
reportFormat
String
reportType
Report type
Unique API name and display name for the report type.
type: Of type string, this is the unique identifier of the report type.
label: Of type string, this is the display name of the report type.
scope
String
Defines the scope of the data on which you run the report. For example,
you can run the report against all opportunities, opportunities you own,
or opportunities your team owns. Valid values depend on the report
type.
showGrandTotal
Boolean
showSubtotals
Boolean
sortBy
String
API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
standardDateFilter
Array of strings
87
Property
Type
Description
standardFilters
Array of strings
List of filters that show up in the report by default. The filters vary by
report type. For example, standard filters for reports on the Opportunity
object are Show, Opportunity Status, and Probability. This list appears
as name-value string pairs.
topRows
Top rows
Error Message
400
The specified start date of <column name> specified for the standard date filter is invalid.
400
The specified end date of <column name> specified for the standard date filter is invalid.
400
The column <column name> specified for the standard date filter is invalid.
400
The column <column name> cannot be a standard date filter because it is not a date column.
400
The duration <value> specified for the standard date filter is invalid.
400
400
400
400
400
400
400
400
A snapshot date is not in the correct format. Accepted formats are one of the rolling dates defined or yyyy-MM-dd.
400
The request is invalid because reports that are not historical trending reports cannot have historical snapshot dates.
400
The request is invalid because there are no historical snapshot dates in the request body. Specify historical snapshot
dates, or set historical snapshot dates as an empty array to omit them.
400
Only a report with fewer than 100 columns can be run. The columns are fields specified as detail columns, summaries,
or custom summary formulas. Remove unneeded columns from the report and try again.
400
Cant run the report because it doesnt have any columns selected. Be sure to add fields as columns to the report
through the user interface.
400
The request is invalid because there are no filters. Specify filters or set filters as an empty array to omit them.
88
HTTP
Response
Code
Error Message
400
The filter value for ID <value> is incorrect. Specify an ID that is 15 or 18 characters long, such as 006D000000CrRLw
or 005U0000000Rg2CIAS.
400
400
400
Filter the date in the correct format. Accepted formats are yyyy-MM-dd'T'HH:mm:ss'Z' and yyyy-MM-dd.
400
400
The request is invalid because there is no metadata. Specify metadata in the request body.
400
403
The report can't be deleted because there are one or more dashboards referencing it.
403
403
403
The report definition is obsolete. Your administrator has disabled all reports for the custom object, or its relationships
have changed.
403
You dont have permission to run reports. Check that you have the Run Reports user permission.
403
403
Reports and Dashboards REST API can't process the request because it can accept only as many as <number> requests
at a time to get results of reports run asynchronously.
403
Reports and Dashboards REST API can't process the request because it can accept only as many as <number> requests
at a time to run reports synchronously.
403
You can't run more than <number> reports synchronously every 60 minutes. Try again later.
404
404
415
The Reports and Dashboards REST API only supports JSON content type in both request and response bodies. Specify
requests with content type as application/json.
500
We ran into an error when fetching this reports metadata. Try to re-submit your query.
500
We ran into an error when running this report. Try to re-submit your query.
500
500
Results for this instance are unavailable because the report's metadata has changed from when the report was last
run. To get results, run the report again or undo changes to the report's metadata.
500
500
89
HTTP
Response
Code
Error Message
500
501
501
Historical trend data is unavailable in the report format requested. Change the report format to matrix and try again.
90
Dashboard List
Dashboard Results
Dashboard Status
Dashboard and
Component Error
Codes
The Dashboards API provides several resources for accessing and refreshing dashboards.
Resources for the Dashboards API are available at /services/data/<latest API
version>/analytics/dashboards. You can query each resource with an HTTP method (such
as GET). Use these resources to integrate dashboard data directly into your applications.
Resource
Supported Description
HTTP
Method
Dashboard List
GET
POST
Returns the metadata, data, and status for the specified dashboard.
PUT
PATCH
Saves a dashboard.
DELETE
Deletes a dashboard.
91
Dashboard List
Dashboard List
Returns a list of recently used dashboards or clones a dashboard.
Syntax
URI
/vXX.X/analytics/dashboards
Formats
JSON
HTTP methods
Method
Description
GET
Returns a list of dashboards that were recently viewed by the API user. See this example.
POST
Authentication
Authorization: Bearer token
Type
Description
id
String
name
String
statusUrl
String
url
String
Dashboard Results
Can return metadata, data, and status for the specified dashboard. Can also refresh, save, or delete a dashboard.
Syntax
URI
/vXX.X/analytics/dashboards/dashboardID
92
Dashboard Results
Formats
JSON
HTTP methods
Method
Description
GET
Returns metadata, data, and status for the specified dashboard. See this example.
PUT
PATCH
DELETE
Authentication
Authorization: Bearer token
Parameters
The following optional parameters can be used with the GET and PUT methods:
Parameter Name
Description
runningUser
Identifier of the running user. Gives an error if the user is not allowed to change the running
user, or if the selected running user is invalid.
filter1
Identifier of the selected filter option for the first filter. Gives an error if the filter option is
invalid.
filter2
Identifier of the selected filter option for the second filter. Gives an error if the filter option is
invalid.
filter3
Identifier of the selected filter option for the third filter. Gives an error if the filter option is
invalid.
Type
Description
componentData
Component data[]
Ordered array containing data and status for each component of the dashboard.
93
Dashboard Results
Component data
Property
Type
Description
componentId
String
reportResult
Report results
Report metadata and summary data for the dashboard component. Uses
the same data format as the Report API.
status
Component status
Property
Type
Description
dataStatus
String
Component status
NODATA: The data set was never generated or is invalid due to a change
in the report.
DATA: The data set is available and was last refreshed at the
refreshDate.
ERROR: A component error has occurred. Details can be found in
errorCode, errorMessage, and errorSeverity.
errorCode
String
errorMessage
String
errorSeverity
String
refreshDate
refreshStatus
String
Dashboard metadata
Property
Type
Description
attributes
Attributes
canChangeRunningUser Boolean
94
Dashboard Results
Property
Type
Description
components
Component[]
description
String
Dashboard description.
developerName
String
filters
Filter[]
Ordered array of filters for this dashboard. The dashboard can have 0-3
filters.
folderId
String
id
String
layout
Layout
name
String
Dashboard name.
runningUser
Running user
Attributes
Property
Type
Description
dashboardId
String
dashboardName
String
Dashboard name.
statusUrl
Url
type
String
Property
Type
Description
componentData
Integer
footer
String
header
String
id
String
properties
Component
String
95
Dashboard Results
Property
Type
Description
title
String
type
String
Filter
Property
Type
Description
name
String
options
Filter option
selectedOption
Integer
Index of the selected option from the options array. This matches the
selection that was made based on the filter1, filter2, or filter3
parameter. Value is null if no option is selected.
Property
Type
Description
alias
String
id
String
Unique identifier of the filter option. Used as a value for the filter1,
filter2, and filter3 parameters.
operation
String
Unique API name for the filter operation. Valid filter operations depend on
the data type of the filter field. Value can be:
Filter option
equals
notEqual
lessThan
greaterThan
lessOrEqual
greaterOrEqual
contains
notContain
startsWith
includes
excludes
within
between
96
Dashboard Results
Property
Type
Description
value
String
startValue
String
Start value when using a between operation. Not set for all other
operations.
endValue
String
End value when using a between operation. Not set for all other operations.
Property
Type
Description
columns
Columns[]
components
Components
Layout for dashboards. This property is available only if the dashboard was
created using Lightning Experience.
Property
Type
Description
components
Integer[]
Property
Type
Description
colspan
Integer
rowspan
Integer
column
String
row
String
Property
Type
Description
displayName
String
id
String
Layout
Columns
Components
Running user
97
Dashboard Results
Type
Description
aggregates
Array of strings
autoSelectColumns
Boolean
groupings
String
maxRows
Number
sort
Sort
useReportChart
Boolean
(Chart)
Visualization properties
(Table)
Visualization properties
(Metric)
Visualization properties
(Gauge)
visualizationType
String
98
Dashboard Results
Type
Description
axisRange
String
groupByType
String
legendPosition
String
Position of legend on the grid. Valid values are bottom, right, and none.
showValues
Boolean
Indicates whether to include values in the chart. Valid values are true and
false.
Type
Description
breakPoints
Break point[]
tableColumns
Table column[]
Type
Description
breakPoints
Break point[]
metricLabel
String
Type
Description
breakPoints
Break point[]
Property
Type
Description
column
String
sortOrder
String
Sort
asc
desc
99
Dashboard Results
Break point
Property
Type
Description
aggregateName
String
Aggregate column developer name that the break points have been applied
to.
breaks
Break[]
Property
Type
Description
color
String
Break
Number
upperBound
Number
Property
Type
Description
column
String
isPercent
Boolean
scale
Number
showTotal
Boolean
type
String
Table column
aggregate
grouping
Type
Description
pageName
String
height
String
100
Dashboard Status
Type
Description
statusUrl
String
Dashboard Status
Returns the status for the specified dashboard.
Syntax
URI
/vXX.X/analytics/dashboards/dashboardID/status
Formats
JSON
HTTP methods
GET
Authentication
Authorization: Bearer token
Parameters
The following optional parameters can be used with the GET method:
Parameter Name
Description
runningUser
ID of the running user. Gives an error if the user is not allowed to change the running user,
or if the selected running user is invalid.
filter1
ID of the selected filter option for the first filter. Gives an error if the filter option is invalid.
filter2
ID of the selected filter option for the second filter. Gives an error if the filter option is invalid.
filter3
ID of the selected filter option for the third filter. Gives an error if the filter option is invalid.
Response body
Property
Type
Description
componentStatus
Status for each component of the dashboard. The order of the array is the same
as in previous calls, unless the dashboard has changed in the meantime.
101
Type
Description
componentId
String
refreshDate
refreshStatus
String
Dashboard-level errors
When a dashboard-level error occurs, the response header contains an HTTP response code and one of the following error messages:
HTTP
Response
Code
Error Message
400
The running user for this dashboard doesn't have permission to run reports. Your system administrator should select
a different running user for this dashboard.
400
The running user for this dashboard is inactive. Your system administrator should select an active user for this
dashboard.
400
400
Your organization has reached the limit for dynamic dashboards, or doesn't have access. Ask your administrator to
enable dynamic dashboards or convert them to dashboards with a specific running user.
400
400
Component-level errors
If an error occurs at the component level, the errorCode, errorMessage, and errorSeverity properties of the component
status field are populated. The errorSeverity property distinguishes between errors and warnings. Errors are blocking issues that
prevent the query from returning any data. Warnings are non-blocking issues; queries will finish, but they might return incomplete data.
The following table shows the possible values for the error fields.
102
errorCode
errorMessage
errorSeverity
201
Error
202
The source report isn't available; it's been deleted or isn't in a folder accessible to the dashboard's Error
running user.
203
This report can no longer be edited or run. Your administrator has disabled all reports for the
custom object, or its relationships have changed.
205
The source report is based on a report type that is inaccessible to the dashboard's running user. Error
208
209
This report cannot be used as the source for this component. If it is a summary or matrix report, Error
add one or more groupings in the report. If it is a tabular report with a row limit, specify the
Dashboard Settings in the report.
210
This row-limited tabular report cannot be used as the source for this component. Use the
Error
dashboard component editor to specify the data you want to display, or specify the Dashboard
Settings in the report.
211
To use this row-limited tabular report as the source, edit the report and specify the Name and Error
Value under Dashboard Settings. When updating the report, make sure you are the running user
of the dashboard.
212
Groupings and combination charts are not available for a row-limited tabular report. Set Group Error
By to None and deselect Plot Additional Values.
300
The results below may be incomplete because the underlying report produced too many summary Error
rows, and the sort order of the component is different from the sort order in the underlying
report. Try adding filters to the report to reduce the number of rows returned.
301
Results may be incomplete because the source report had too many summary rows. Try filtering Warning
the report to reduce the number of rows returned.
302
The component can't be displayed because the source report exceeded the time limit.
Warning
303
The component can't be displayed because the source report failed to run.
Error
304
The component can't be displayed because the dashboard filter raises the number of source
report filters above the limit. Reduce the number of report filters and try again.
Error
305
The component can't be displayed because the field(s) you chose for the filter are unavailable.
Error
308
You cant filter this component because data is in the joined report format. To filter the component, Error
change its report format.
309
103
Error
Error
Error
INDEX
Introduction 1
Resources (continued)
GET dashboard status 101
Get extended report metadata 57
Get recent reports list 84
GET report data 21, 71
GET report instance results 82
GET report instances 81
PATCH report 41
POST report data 21, 71
POST report instance 77, 81
run report asynchronously 77
Summary level results 21, 71
D
Dashboards API
filtering results 32
getting list of dashboards 28
getting results 28
getting status 33
refreshing 34
saving a dashboard 34
Reference
Dashboard error codes 102
Dashboard List 91
Dashboard Results 91
Dashboard Status 91
Report Describe 40
Report Execute 40
Report Instances 40
Report List 40
Reports and Dashboards REST API
report-level errors 88
Requirements and limitations 2
Resources
DELETE report 41
Detailed results 21, 71
Fact map 21
Filter report results 21, 71
Get basic report metadata 57
GET dashboard list 92
GET dashboard results 92
W
When to use Reports API 3
When to use the Dashboards API 27
104