Salesforce Analytics Rest API
Salesforce Analytics Rest API
Salesforce Analytics Rest API
@salesforcedocs
Last updated: August 18, 2022
© Copyright 2000–2022 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: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Build the Resource URL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Requirements and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
API End-of-Life . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Chapter 2: Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Reports Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Create a New Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Run Reports Synchronously or Asynchronously . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Get Report Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Get a List of Report Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Download Formatted Excel Reports Using the Reports REST API . . . . . . . . . . . . . . . . . . . 51
List Asynchronous Runs of a Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Filter Reports on Demand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
List Recently Viewed Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Decode the Fact Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Get Report Data without Saving Changes to or Creating a Report . . . . . . . . . . . . . . . . . 60
Save Changes to Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Clone Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Delete Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Dashboards Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Get List of Recently Used Dashboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Get Dashboard Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Filter Dashboard Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Get Dashboard Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Refresh a Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Save a Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Set a Sticky Dashboard Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Return Details About Dashboard Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Get Dashboard Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Clone a Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Delete a Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Downloads Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Download a CRM Analytics Dashboard as a PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Download a CRM Analytics Lens as a PNG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Download a Lightning Experience Dashboard as a PNG . . . . . . . . . . . . . . . . . . . . . . . 111
Download a Lightning Experience Report as a PNG . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Notifications Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Get Analytics Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Contents
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
CHAPTER 1 Overview
In this chapter ... The Reports and Dashboards REST API gives you programmatic access to your report and dashboard
data as defined in the report builder and dashboard builder. The API lets you integrate the data into any
• Build the Resource web or mobile application, inside or outside the Salesforce platform. For example, you might use the
URL API to trigger a Chatter post with a snapshot of top-performing reps each quarter.
• Requirements and
The Reports and Dashboards REST API will revolutionize the way you access and visualize your data. You
Limitations
can:
• API End-of-Life
• Integrate report data into custom objects.
• Define rich visualizations on top of the API to animate the data.
• Build custom dashboards.
• Automate reporting tasks.
At a high level, the API resources let you query and filter report data. You can:
• Run tabular, summary, or matrix reports synchronously or asynchronously.
• Filter for specific data on the fly.
• Query report metadata.
You can also work with dashboard resources to:
• Get a list of recently used dashboards.
• Get dashboard metadata and data.
• Query dashboard status.
• Refresh dashboards.
1
Overview Build the Resource URL
https://MyDomainName.my.salesforce.com
https://MyDomainName.my.salesforce.com/services/data/v56.0/analytics/reports
Some resources, such as notifications, often require one or more URL parameters without which API requests return an error:
https://MyDomainName.my.salesforce.com/services/data/v56.0/analytics/notifications?source=lightningReportSubscribe
Note: Responses and requests are in JSON. While using the Reports and Dashboards REST API with a POST request body, you
must use content-type: application/json. You might get unexpected results if you don’t use this content type.
Reports Limits
• Cross filters, standard report filters, and filtering by row limit are unavailable when filtering data.
• Historical tracking reports are only supported for matrix reports.
• Subscriptions aren't supported for historical tracking reports.
• The API can process only reports that contain up to 100 fields selected as columns.
• A list of up to 200 recently viewed reports can be returned.
• Your org can request up to 500 synchronous report runs per hour.
• The API supports up to 20 synchronous report run requests at a time.
• A list of up to 2,000 instances of a report that was run asynchronously can be returned.
• The API supports up to 200 requests at a time to get results of asynchronous report runs.
• Your organization can request up to 1,200 asynchronous requests per hour.
• Asynchronous report run results are available within a 24-hour rolling period.
2
Overview API End-of-Life
• The API returns up to the first 2,000 report rows. You can narrow results using filters.
• You can add up to 20 custom field filters when you run a report.
• If a report is run on a standard or custom object as an automated process user from an Apex test class, only the required custom
fields are returned. Non-required custom fields aren’t shown in the results.
• – Your org can request up to 200 dashboard refreshes per hour.
– Your org can request results for up to 5,000 dashboards per hour.
Dashboards Limits
• Your org can request up to 200 dashboard refreshes per hour.
• Your org can request results for up to 5,000 dashboards per hour.
Analytics Notification Limits
• Each user can subscribe to up to 5 reports.
• Each user can create up to 5 Analytics notifications.
Note: All limits that apply to reports created in the report builder also apply to the API, as do limits for dashboards created in the
dashboard builder. For more information, see “Salesforce Reports and Dashboards Limits” in the Salesforce online help.
Analytics Download Limits
• Each user can make 3 concurrent requests to download Analytics assets.
API End-of-Life
Salesforce is committed to supporting each API version for a minimum of three years from the date of first release. In order to mature
and improve the quality and performance of the API, versions that are more than three years old might cease to be supported.
When an API version is to be deprecated, advance notice is given at least one year before support ends. Salesforce will directly notify
customers using API versions planned for deprecation.
3
CHAPTER 2 Examples
In this chapter ... Learn how to run a report, refresh dashboard data, and send analytic notifications with these hands-on
Reports and Dashboards REST API examples.
• Reports Examples
• Dashboards
Examples
• Downloads
Examples
• Notifications
Examples
4
Examples Reports Examples
Reports Examples
Learn how to run, create, edit, or delete reports with the Reports REST API. Running a report returns a fact map that describes report
data. Learn how to read report fact maps.
5
Examples Create a New Report
"dataType" : "picklist",
"label" : "Stage"
},
"FISCAL_QUARTER" : {
"dataType" : "string",
"label" : "Fiscal Period"
},
"AMOUNT" : {
"dataType" : "currency",
"label" : "Amount"
},
"PROBABILITY" : {
"dataType" : "percent",
"label" : "Probability (%)"
},
"AGE" : {
"dataType" : "int",
"label" : "Age"
},
"CLOSE_DATE" : {
"dataType" : "date",
"label" : "Close Date"
},
"CREATED_DATE" : {
"dataType" : "datetime",
"label" : "Created Date"
},
"NEXT_STEP" : {
"dataType" : "string",
"label" : "Next Step"
},
"LEAD_SOURCE" : {
"dataType" : "picklist",
"label" : "Lead Source"
},
"TYPE" : {
"dataType" : "picklist",
"label" : "Type"
}
},
"groupingColumnInfo" : { }
},
"reportMetadata" : {
"aggregates" : [ "RowCount" ],
"chart" : null,
"crossFilters" : [ ],
"currency" : null,
"description" : null,
"detailColumns" : [ "ROLLUP_DESCRIPTION", "FULL_NAME", "ACCOUNT_NAME",
"OPPORTUNITY_NAME", "STAGE_NAME", "FISCAL_QUARTER", "AMOUNT", "PROBABILITY", "AGE",
"CLOSE_DATE", "CREATED_DATE", "NEXT_STEP", "LEAD_SOURCE", "TYPE" ],
"developerName" : "DocTest2_mG",
"division" : null,
"folderId" : "005R0000000Kg8cIAC",
6
Examples Create a New Report
"groupingsAcross" : [ ],
"groupingsDown" : [ ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OR0000000PYkiMAG",
"name" : "DocTest2",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
"reportFormat" : "TABULAR",
"reportType" : {
"label" : "Opportunities",
"type" : "Opportunity"
},
"scope" : "organization",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CLOSE_DATE",
"durationValue" : "THIS_FISCAL_QUARTER",
"endDate" : "2016-12-31",
"startDate" : "2016-10-01"
},
"standardFilters" : [ {
"name" : "open",
"value" : "all"
}, {
"name" : "probability",
"value" : ">0"
} ],
"supportsRoleHierarchy" : true,
"userOrHierarchyFilterId" : null
},
"reportTypeMetadata" : {
"categories" : [ {
"columns" : {
"CREATED" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Created By"
},
"CREATED_ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Created Alias"
},
"LAST_UPDATE_BY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Last Modified By"
7
Examples Create a New Report
},
"LAST_UPDATE_BY_ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Last Modified Alias"
},
"OPPORTUNITY_NAME" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Name"
},
"TYPE" : {
"dataType" : "picklist",
"filterValues" : [ {
"label" : "Existing Business",
"name" : "Existing Business"
}, {
"label" : "New Business",
"name" : "New Business"
} ],
"filterable" : true,
"label" : "Type"
},
"LEAD_SOURCE" : {
"dataType" : "picklist",
"filterValues" : [ {
"label" : "Advertisement",
"name" : "Advertisement"
}, {
"label" : "Employee Referral",
"name" : "Employee Referral"
}, {
"label" : "External Referral",
"name" : "External Referral"
}, {
"label" : "Partner",
"name" : "Partner"
}, {
"label" : "Public Relations",
"name" : "Public Relations"
}, {
"label" : "Seminar - Internal",
"name" : "Seminar - Internal"
}, {
"label" : "Seminar - Partner",
"name" : "Seminar - Partner"
}, {
"label" : "Trade Show",
"name" : "Trade Show"
}, {
"label" : "Web",
"name" : "Web"
8
Examples Create a New Report
}, {
"label" : "Word of mouth",
"name" : "Word of mouth"
}, {
"label" : "Other",
"name" : "Other"
} ],
"filterable" : true,
"label" : "Lead Source"
},
"PARTNER_NAME" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Primary Partner"
},
"AMOUNT" : {
"dataType" : "currency",
"filterValues" : [ ],
"filterable" : true,
"label" : "Amount"
},
"CLOSED" : {
"dataType" : "boolean",
"filterValues" : [ {
"label" : "True",
"name" : "True"
}, {
"label" : "False",
"name" : "False"
} ],
"filterable" : true,
"label" : "Closed"
},
"WON" : {
"dataType" : "boolean",
"filterValues" : [ {
"label" : "True",
"name" : "True"
}, {
"label" : "False",
"name" : "False"
} ],
"filterable" : true,
"label" : "Won"
},
"CLOSE_DATE" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"label" : "Close Date"
},
"CLOSE_DATE2" : {
"dataType" : "date",
9
Examples Create a New Report
"filterValues" : [ ],
"filterable" : true,
"label" : "Close Date (2)"
},
"CLOSE_MONTH" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"label" : "Close Month"
},
"LAST_STAGE_CHANGE_DATE" : {
"dataType" : "datetime",
"filterValues" : [ ],
"filterable" : true,
"label" : "Last Stage Change Date"
},
"NEXT_STEP" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Next Step"
},
"STAGE_NAME" : {
"dataType" : "picklist",
"filterValues" : [ {
"label" : "Prospecting",
"name" : "Prospecting"
}, {
"label" : "Qualification",
"name" : "Qualification"
}, {
"label" : "Needs Analysis",
"name" : "Needs Analysis"
}, {
"label" : "Value Proposition",
"name" : "Value Proposition"
}, {
"label" : "Id. Decision Makers",
"name" : "Id. Decision Makers"
}, {
"label" : "Perception Analysis",
"name" : "Perception Analysis"
}, {
"label" : "Proposal/Price Quote",
"name" : "Proposal/Price Quote"
}, {
"label" : "Negotiation/Review",
"name" : "Negotiation/Review"
}, {
"label" : "Closed Won",
"name" : "Closed Won"
}, {
"label" : "Closed Lost",
"name" : "Closed Lost"
10
Examples Create a New Report
} ],
"filterable" : true,
"label" : "Stage"
},
"PROBABILITY" : {
"dataType" : "percent",
"filterValues" : [ ],
"filterable" : true,
"label" : "Probability (%)"
},
"FISCAL_QUARTER" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Fiscal Period"
},
"FISCAL_YEAR" : {
"dataType" : "int",
"filterValues" : [ ],
"filterable" : true,
"label" : "Fiscal Year"
},
"AGE" : {
"dataType" : "int",
"filterValues" : [ ],
"filterable" : true,
"label" : "Age"
},
"STAGE_DURATION" : {
"dataType" : "int",
"filterValues" : [ ],
"filterable" : true,
"label" : "Stage Duration"
},
"FORECAST_CATEGORY" : {
"dataType" : "picklist",
"filterValues" : [ {
"label" : "Omitted",
"name" : "Omitted"
}, {
"label" : "Pipeline",
"name" : "Pipeline"
}, {
"label" : "Best Case",
"name" : "Best Case"
}, {
"label" : "Commit",
"name" : "Commit"
}, {
"label" : "Closed",
"name" : "Closed"
} ],
"filterable" : true,
"label" : "Forecast Category"
11
Examples Create a New Report
},
"OPPORTUNITY_ID" : {
"dataType" : "id",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity ID"
},
"LAST_ACTIVITY" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"label" : "Last Activity"
},
"DESCRIPTION" : {
"dataType" : "textarea",
"filterValues" : [ ],
"filterable" : true,
"label" : "Description"
},
"HASOPPLINEITEM" : {
"dataType" : "boolean",
"filterValues" : [ {
"label" : "True",
"name" : "True"
}, {
"label" : "False",
"name" : "False"
} ],
"filterable" : true,
"label" : "Has Products"
},
"CREATED_DATE" : {
"dataType" : "datetime",
"filterValues" : [ ],
"filterable" : true,
"label" : "Created Date"
},
"LAST_UPDATE" : {
"dataType" : "datetime",
"filterValues" : [ ],
"filterable" : true,
"label" : "Last Modified Date"
}
},
"label" : "Opportunity Information"
}, {
"columns" : {
"FULL_NAME" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner"
},
"ROLLUP_DESCRIPTION" : {
12
Examples Create a New Report
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Owner Role"
},
"ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner Alias"
},
"OWNER_EMAIL" : {
"dataType" : "email",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner Email"
},
"OWNER_PHONE" : {
"dataType" : "phone",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Phone"
},
"OWNER_MOBILE_PHONE" : {
"dataType" : "phone",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Mobile Phone"
},
"OWNER_MANAGER" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Manager"
},
"OWNER_TITLE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Title"
},
"OWNER_COMPANY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Company"
},
"OWNER_DEPARTMENT" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Department"
},
"OWNER_DIVISION" : {
13
Examples Create a New Report
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Division"
},
"OWNER_PROFILE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Opportunity Owner: Profile"
},
"OWNER_ACTIVE" : {
"dataType" : "boolean",
"filterValues" : [ {
"label" : "True",
"name" : "True"
}, {
"label" : "False",
"name" : "False"
} ],
"filterable" : true,
"label" : "Opportunity Owner: Active"
}
},
"label" : "Opportunity Owner Information"
}, {
"columns" : {
"ACCOUNT_NAME" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account Name"
},
"ACCOUNT_OWNER" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account Owner"
},
"ACCOUNT_OWNER_ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account Owner Alias"
},
"PARENT_NAME" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Parent Account"
},
"PARENT_ID" : {
"dataType" : "id",
"filterValues" : [ ],
14
Examples Create a New Report
"filterable" : true,
"label" : "Parent Account ID"
},
"SALES" : {
"dataType" : "currency",
"filterValues" : [ ],
"filterable" : true,
"label" : "Annual Revenue"
},
"ACCOUNT_TYPE" : {
"dataType" : "picklist",
"filterValues" : [ {
"label" : "Analyst",
"name" : "Analyst"
}, {
"label" : "Competitor",
"name" : "Competitor"
}, {
"label" : "Customer",
"name" : "Customer"
}, {
"label" : "Integrator",
"name" : "Integrator"
}, {
"label" : "Investor",
"name" : "Investor"
}, {
"label" : "Partner",
"name" : "Partner"
}, {
"label" : "Press",
"name" : "Press"
}, {
"label" : "Prospect",
"name" : "Prospect"
}, {
"label" : "Reseller",
"name" : "Reseller"
}, {
"label" : "Other",
"name" : "Other"
} ],
"filterable" : true,
"label" : "Account Type"
},
"INDUSTRY" : {
"dataType" : "picklist",
"filterValues" : [ {
"label" : "Agriculture",
"name" : "Agriculture"
}, {
"label" : "Apparel",
"name" : "Apparel"
}, {
15
Examples Create a New Report
"label" : "Banking",
"name" : "Banking"
}, {
"label" : "Biotechnology",
"name" : "Biotechnology"
}, {
"label" : "Chemicals",
"name" : "Chemicals"
}, {
"label" : "Communications",
"name" : "Communications"
}, {
"label" : "Construction",
"name" : "Construction"
}, {
"label" : "Consulting",
"name" : "Consulting"
}, {
"label" : "Education",
"name" : "Education"
}, {
"label" : "Electronics",
"name" : "Electronics"
}, {
"label" : "Energy",
"name" : "Energy"
}, {
"label" : "Engineering",
"name" : "Engineering"
}, {
"label" : "Entertainment",
"name" : "Entertainment"
}, {
"label" : "Environmental",
"name" : "Environmental"
}, {
"label" : "Finance",
"name" : "Finance"
}, {
"label" : "Food & Beverage",
"name" : "Food & Beverage"
}, {
"label" : "Government",
"name" : "Government"
}, {
"label" : "Healthcare",
"name" : "Healthcare"
}, {
"label" : "Hospitality",
"name" : "Hospitality"
}, {
"label" : "Insurance",
"name" : "Insurance"
}, {
16
Examples Create a New Report
"label" : "Machinery",
"name" : "Machinery"
}, {
"label" : "Manufacturing",
"name" : "Manufacturing"
}, {
"label" : "Media",
"name" : "Media"
}, {
"label" : "Not For Profit",
"name" : "Not For Profit"
}, {
"label" : "Other",
"name" : "Other"
}, {
"label" : "Recreation",
"name" : "Recreation"
}, {
"label" : "Retail",
"name" : "Retail"
}, {
"label" : "Shipping",
"name" : "Shipping"
}, {
"label" : "Technology",
"name" : "Technology"
}, {
"label" : "Telecommunications",
"name" : "Telecommunications"
}, {
"label" : "Transportation",
"name" : "Transportation"
}, {
"label" : "Utilities",
"name" : "Utilities"
} ],
"filterable" : true,
"label" : "Industry"
},
"EMPLOYEES" : {
"dataType" : "int",
"filterValues" : [ ],
"filterable" : true,
"label" : "Employees"
},
"ACCOUNT_ID" : {
"dataType" : "id",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account ID"
},
"ACCOUNT_LAST_ACTIVITY" : {
"dataType" : "date",
"filterValues" : [ ],
17
Examples Create a New Report
"filterable" : true,
"label" : "Account: Last Activity"
},
"ACCOUNT_CREATED_DATE" : {
"dataType" : "datetime",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account: Created Date"
},
"ACCOUNT_LAST_UPDATE" : {
"dataType" : "datetime",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account: Last Modified Date"
},
"ACCOUNT_DESCRIPTION" : {
"dataType" : "textarea",
"filterValues" : [ ],
"filterable" : true,
"label" : "Account Description"
}
},
"label" : "Account: General"
}, {
"columns" : {
"ADDRESS1_STREET" : {
"dataType" : "textarea",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing Street"
},
"ADDRESS1_LINE1" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing Address Line 1"
},
"ADDRESS1_LINE2" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing Address Line 2"
},
"ADDRESS1_LINE3" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing Address Line 3"
},
"ADDRESS1_CITY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing City"
18
Examples Create a New Report
},
"ADDRESS1_STATE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing State/Province"
},
"ADDRESS1_ZIP" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing Zip/Postal Code"
},
"ADDRESS1_COUNTRY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Billing Country"
},
"ADDRESS2_STREET" : {
"dataType" : "textarea",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping Street"
},
"ADDRESS2_LINE1" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping Address Line 1"
},
"ADDRESS2_LINE2" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping Address Line 2"
},
"ADDRESS2_LINE3" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping Address Line 3"
},
"ADDRESS2_CITY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping City"
},
"ADDRESS2_STATE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping State/Province"
19
Examples Create a New Report
},
"ADDRESS2_ZIP" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping Zip/Postal Code"
},
"ADDRESS2_COUNTRY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Shipping Country"
}
},
"label" : "Account: Address"
}, {
"columns" : {
"PHONE1" : {
"dataType" : "phone",
"filterValues" : [ ],
"filterable" : true,
"label" : "Phone"
},
"PHONE2" : {
"dataType" : "phone",
"filterValues" : [ ],
"filterable" : true,
"label" : "Fax"
},
"URL" : {
"dataType" : "url",
"filterValues" : [ ],
"filterable" : true,
"label" : "Website"
}
},
"label" : "Account: Ph/Fax"
}, {
"columns" : {
"CONTACT" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Primary Contact"
},
"CON.TITLE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Contact: Title"
},
"CON.PHONE" : {
"dataType" : "phone",
"filterValues" : [ ],
20
Examples Create a New Report
"filterable" : true,
"label" : "Contact: Phone"
},
"CON.EMAIL" : {
"dataType" : "email",
"filterValues" : [ ],
"filterable" : true,
"label" : "Contact: Email"
}
},
"label" : "Primary Contact"
}, {
"columns" : {
"CON.ADDRESS2_STREET" : {
"dataType" : "textarea",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing Street"
},
"CON.ADDRESS2_LINE1" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing Address Line 1"
},
"CON.ADDRESS2_LINE2" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing Address Line 2"
},
"CON.ADDRESS2_LINE3" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing Address Line 3"
},
"CON.ADDRESS2_CITY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing City"
},
"CON.ADDRESS2_STATE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing State/Province"
},
"CON.ADDRESS2_ZIP" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing Zip/Postal Code"
21
Examples Create a New Report
},
"CON.ADDRESS2_COUNTRY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Mailing Country"
},
"CON.ADDRESS1_STREET" : {
"dataType" : "textarea",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other Street"
},
"CON.ADDRESS1_LINE1" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other Address Line 1"
},
"CON.ADDRESS1_LINE2" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other Address Line 2"
},
"CON.ADDRESS1_LINE3" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other Address Line 3"
},
"CON.ADDRESS1_CITY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other City"
},
"CON.ADDRESS1_STATE" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other State/Province"
},
"CON.ADDRESS1_ZIP" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other Zip/Postal Code"
},
"CON.ADDRESS1_COUNTRY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"label" : "Other Country"
22
Examples Create a New Report
}
},
"label" : "Contact: Address"
} ],
"dataTypeFilterOperatorMap" : {
"date" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"string" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"picklist" : [ {
"label" : "equals",
23
Examples Create a New Report
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"textarea" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
24
Examples Create a New Report
"percent" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"int" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"url" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
25
Examples Create a New Report
26
Examples Create a New Report
27
Examples Create a New Report
28
Examples Create a New Report
"endDate" : "2015-12-31",
"label" : "Previous 2 FY",
"startDate" : "2014-01-01",
"value" : "LAST_N_FISCAL_YEARS:2"
}, {
"endDate" : "2014-12-31",
"label" : "2 FY Ago",
"startDate" : "2014-01-01",
"value" : "LAST_N_FISCAL_YEARS_AGO:2"
}, {
"endDate" : "2017-12-31",
"label" : "Next FY",
"startDate" : "2017-01-01",
"value" : "NEXT_FISCAL_YEAR"
}, {
"endDate" : "2016-12-31",
"label" : "Current and Previous FY",
"startDate" : "2015-01-01",
"value" : "THIS_AND_LAST_FISCAL_YEAR:2"
}, {
"endDate" : "2016-12-31",
"label" : "Current and Previous 2 FY",
"startDate" : "2014-01-01",
"value" : "THIS_AND_LAST_N_FISCAL_YEARS:2"
}, {
"endDate" : "2017-12-31",
"label" : "Current and Next FY",
"startDate" : "2016-01-01",
"value" : "THIS_AND_NEXT_FISCAL_YEAR"
} ]
}, {
"label" : "Fiscal Quarter",
"standardDateFilterDurations" : [ {
"endDate" : "2016-12-31",
"label" : "Current FQ",
"startDate" : "2016-10-01",
"value" : "THIS_FISCAL_QUARTER"
}, {
"endDate" : "2017-03-31",
"label" : "Current and Next FQ",
"startDate" : "2016-10-01",
"value" : "THIS_AND_NEXT_FISCAL_QUARTER"
}, {
"endDate" : "2016-12-31",
"label" : "Current and Previous FQ",
"startDate" : "2016-07-01",
"value" : "LAST_AND_THIS_FISCAL_QUARTER"
}, {
"endDate" : "2017-03-31",
"label" : "Next FQ",
"startDate" : "2017-01-01",
"value" : "NEXT_FISCAL_QUARTER"
}, {
"endDate" : "2016-09-30",
29
Examples Create a New Report
30
Examples Create a New Report
"standardDateFilterDurations" : [ {
"endDate" : "2016-12-31",
"label" : "Current CQ",
"startDate" : "2016-10-01",
"value" : "THIS_QUARTER"
}, {
"endDate" : "2017-03-31",
"label" : "Current and Next CQ",
"startDate" : "2016-10-01",
"value" : "THIS_AND_NEXT_QUARTER"
}, {
"endDate" : "2016-12-31",
"label" : "Current and Previous CQ",
"startDate" : "2016-07-01",
"value" : "LAST_AND_THIS_QUARTER"
}, {
"endDate" : "2017-03-31",
"label" : "Next CQ",
"startDate" : "2017-01-01",
"value" : "NEXT_QUARTER"
}, {
"endDate" : "2016-09-30",
"label" : "Previous CQ",
"startDate" : "2016-07-01",
"value" : "LAST_QUARTER"
}, {
"endDate" : "2017-09-30",
"label" : "Current and Next 3 CQ",
"startDate" : "2016-10-01",
"value" : "THIS_AND_NEXT_N_QUARTERS:3"
} ]
}, {
"label" : "Calendar Month",
"standardDateFilterDurations" : [ {
"endDate" : "2016-11-30",
"label" : "Last Month",
"startDate" : "2016-11-01",
"value" : "LAST_MONTH"
}, {
"endDate" : "2016-12-31",
"label" : "This Month",
"startDate" : "2016-12-01",
"value" : "THIS_MONTH"
}, {
"endDate" : "2017-01-31",
"label" : "Next Month",
"startDate" : "2017-01-01",
"value" : "NEXT_MONTH"
}, {
"endDate" : "2016-12-31",
"label" : "Current and Previous Month",
"startDate" : "2016-11-01",
"value" : "LAST_AND_THIS_MONTH"
}, {
31
Examples Create a New Report
"endDate" : "2017-01-31",
"label" : "Current and Next Month",
"startDate" : "2016-12-01",
"value" : "THIS_AND_NEXT_MONTH"
} ]
}, {
"label" : "Calendar Week",
"standardDateFilterDurations" : [ {
"endDate" : "2016-12-10",
"label" : "Last Week",
"startDate" : "2016-12-04",
"value" : "LAST_WEEK"
}, {
"endDate" : "2016-12-17",
"label" : "This Week",
"startDate" : "2016-12-11",
"value" : "THIS_WEEK"
}, {
"endDate" : "2016-12-24",
"label" : "Next Week",
"startDate" : "2016-12-18",
"value" : "NEXT_WEEK"
} ]
}, {
"label" : "Day",
"standardDateFilterDurations" : [ {
"endDate" : "2016-12-12",
"label" : "Yesterday",
"startDate" : "2016-12-12",
"value" : "YESTERDAY"
}, {
"endDate" : "2016-12-13",
"label" : "Today",
"startDate" : "2016-12-13",
"value" : "TODAY"
}, {
"endDate" : "2016-12-14",
"label" : "Tomorrow",
"startDate" : "2016-12-14",
"value" : "TOMORROW"
}, {
"endDate" : "2016-12-13",
"label" : "Last 7 Days",
"startDate" : "2016-12-07",
"value" : "LAST_N_DAYS:7"
}, {
"endDate" : "2016-12-13",
"label" : "Last 30 Days",
"startDate" : "2016-11-14",
"value" : "LAST_N_DAYS:30"
}, {
"endDate" : "2016-12-13",
"label" : "Last 60 Days",
"startDate" : "2016-10-15",
32
Examples Create a New Report
"value" : "LAST_N_DAYS:60"
}, {
"endDate" : "2016-12-13",
"label" : "Last 90 Days",
"startDate" : "2016-09-15",
"value" : "LAST_N_DAYS:90"
}, {
"endDate" : "2016-12-13",
"label" : "Last 120 Days",
"startDate" : "2016-08-16",
"value" : "LAST_N_DAYS:120"
}, {
"endDate" : "2016-12-19",
"label" : "Next 7 Days",
"startDate" : "2016-12-13",
"value" : "NEXT_N_DAYS:7"
}, {
"endDate" : "2017-01-11",
"label" : "Next 30 Days",
"startDate" : "2016-12-13",
"value" : "NEXT_N_DAYS:30"
}, {
"endDate" : "2017-02-10",
"label" : "Next 60 Days",
"startDate" : "2016-12-13",
"value" : "NEXT_N_DAYS:60"
}, {
"endDate" : "2017-03-12",
"label" : "Next 90 Days",
"startDate" : "2016-12-13",
"value" : "NEXT_N_DAYS:90"
}, {
"endDate" : "2017-04-11",
"label" : "Next 120 Days",
"startDate" : "2016-12-13",
"value" : "NEXT_N_DAYS:120"
} ]
} ],
"standardFilterInfos" : {
"probability" : {
"type" : "PICKLIST",
"filterValues" : [ {
"label" : "All",
"name" : ">0"
}, {
"label" : "> 90%",
"name" : "gt90"
}, {
"label" : "> 80%",
"name" : "gt80"
}, {
"label" : "> 70%",
"name" : "gt70"
}, {
33
Examples Create a New Report
34
Examples Run Reports Synchronously or Asynchronously
"name" : "open"
}, {
"label" : "Closed",
"name" : "closed"
}, {
"label" : "Closed Won",
"name" : "closedwon"
} ],
"label" : "Opportunity Status"
}
}
}
}
• The 2-minute overall Salesforce API timeout limit doesn’t apply to asynchronous runs.
• The Salesforce Reports and Dashboards REST API can handle a higher number of asynchronous run requests at a time.
• Since the results of an asynchronously run report are stored for a 24-hr rolling period, they’re available for recurring access.
2. Send a GET request to the Instance Results resource to fetch data using the instance ID.
35
Examples Run Reports Synchronously or Asynchronously
"00OR0000000K2UeMAK",
"reportName" : "Deals Closing This Quarter",
"type" : "Report"
},
"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 } ]
} ]
},
"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" : "0_0", "label" : "Existing Business", "value" :
"Existing Business" } ],
"key" : "0",
36
Examples Run Reports Synchronously or Asynchronously
37
Examples Run Reports Synchronously or Asynchronously
38
Examples Run Reports Synchronously or Asynchronously
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",
39
Examples Run Reports Synchronously or Asynchronously
40
Examples Run Reports Synchronously or Asynchronously
"acrossGroupingContext" : null,
"dataType" : "int",
"downGroupingContext" : null,
"label" : "Record Count" }
},
"detailColumnInfo" :
{ "OPPORTUNITY_NAME" : { "dataType" : "string", "label" : "Opportunity Name" },
"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,
41
Examples Get Report Metadata
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OR0000000K2UeMAK",
"name" : "Deals Closing This Quarter",
"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": [
42
Examples Get Report Metadata
{
"label": "Opportunity Information",
"columns": {
"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"
}
43
Examples Get Report Metadata
},
"aggregateColumnInfo": {
"RowCount": {
"label": "Record Count",
"dataType": "int",
"downGroupingContext": null,
"acrossGroupingContext": null
},
"FORMULA1": {
"label": "formula1",
"dataType": "double",
"downGroupingContext": "ALL_SUMMARY_LEVELS",
"acrossGroupingContext": "ALL_SUMMARY_LEVELS"
},
"s!EXP_AMOUNT": {
"label": "Sum of Expected Revenue",
"dataType": "currency",
"downGroupingContext": null,
"acrossGroupingContext": null
}
},
"groupingColumnInfo": {
"CLOSE_DATE": {
"label": "Close Date",
"dataType": "date",
"groupingLevel": 1
},
"STAGE_NAME": {
"label": "Stage",
"dataType": "picklist",
"groupingLevel": 0
},
"ACCOUNT_NAME": {
"label": "Account Name",
"dataType": "string",
"groupingLevel": 0
},
"ACCOUNT_LAST_ACTIVITY": {
"label": "Account: Last Activity",
"dataType": "date",
"groupingLevel": 1
}
}
},
"reportMetadata": {
"name": "Stuck Opportunities",
"id": "00OD0000001ZbP7MAK",
"currency": null,
"developerName": "StuckOpportunities",
"groupingsDown": [
{
"name": "ACCOUNT_NAME",
"sortOrder": "Asc",
"dateGranularity": "None"
44
Examples Get Report Metadata
},
{
"name": "CLOSE_DATE",
"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"
]
45
Examples Get a List of Report Types
}
}
SEE ALSO:
Describe
46
Examples Get a List of Report Types
"type" : "ContactAuditHistory"
} ]
}, {
"label" : "Opportunities",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/Opportunity",
"label" : "Opportunities",
"type" : "Opportunity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityProduct",
"label" : "Opportunities with Products",
"type" : "OpportunityProduct"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityContact",
"label" : "Opportunities with Contact Roles",
"type" : "OpportunityContact"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityPartner",
"label" : "Opportunities with Partners",
"type" : "OpportunityPartner"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityCompetitor",
47
Examples Get a List of Report Types
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseContactRole",
"label" : "Cases with Contact Roles",
"type" : "CaseContactRole"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseAsset",
"label" : "Cases with Assets",
"type" : "CaseAsset"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseSolution",
"label" : "Cases with Solutions",
"type" : "CaseSolution"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseAuditHistory",
"label" : "Case History",
"type" : "CaseAuditHistory"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionList",
"label" : "Solutions",
"type" : "SolutionList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionCategory",
"label" : "Solution Categories",
"type" : "SolutionCategory"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionAuditHistory",
"label" : "Solution History",
"type" : "SolutionAuditHistory"
} ]
}, {
"label" : "Leads",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/LeadList",
"label" : "Leads",
"type" : "LeadList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityLead",
"label" : "Leads with converted lead information",
"type" : "OpportunityLead"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/LeadAuditHistory",
"label" : "Lead History",
"type" : "LeadAuditHistory"
} ]
}, {
"label" : "Activities",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/Activity",
"label" : "Tasks and Events",
"type" : "Activity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/EventAttendee",
"label" : "Events with Invitees",
"type" : "EventAttendee"
48
Examples Get a List of Report Types
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/EmailStatus",
"label" : "HTML Email Status",
"type" : "EmailStatus"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/AccountActivity",
"label" : "Activities with Accounts",
"type" : "AccountActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContactActivity",
"label" : "Activities with Contacts",
"type" : "ContactActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OpportunityActivity",
"label" : "Activities with Opportunities",
"type" : "OpportunityActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/LeadActivity",
"label" : "Activities with Leads",
"type" : "LeadActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CaseActivity",
"label" : "Activities with Cases",
"type" : "CaseActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/SolutionActivity",
"label" : "Activities with Solutions",
"type" : "SolutionActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractActivity",
"label" : "Activities with Contracts",
"type" : "ContractActivity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductActivity",
"label" : "Activities with Products",
"type" : "ProductActivity"
} ]
}, {
"label" : "Contracts and Orders",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractList",
"label" : "Contracts",
"type" : "ContractList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractAuditHistory",
"label" : "Contract History",
"type" : "ContractAuditHistory"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractOrder",
"label" : "Contracts with Orders",
"type" : "ContractOrder"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractOrderItem",
"label" : "Contracts with Orders and Products",
49
Examples Get a List of Report Types
"type" : "ContractOrderItem"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ContractContactRole",
"label" : "Contracts with Contact Roles",
"type" : "ContractContactRole"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OrderList",
"label" : "Orders",
"type" : "OrderList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OrderItemList",
"label" : "Orders with Products",
"type" : "OrderItemList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/OrderAuditHistory",
"label" : "Order History",
"type" : "OrderAuditHistory"
} ]
}, {
"label" : "Price Books, Products and Assets",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductList",
"label" : "Products",
"type" : "ProductList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductOpportunity",
"label" : "Products with Opportunities",
"type" : "ProductOpportunity"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/PricebookProduct",
"label" : "Price Books with Products",
"type" : "PricebookProduct"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ProductAsset",
"label" : "Products with Assets",
"type" : "ProductAsset"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/AssetWithProduct",
"label" : "Assets",
"type" : "AssetWithProduct"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/AssetCase",
"label" : "Assets with Cases",
"type" : "AssetCase"
} ]
}, {
"label" : "Administrative Reports",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/User",
"label" : "Users",
"type" : "User"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/ReportList",
"label" : "Reports",
50
Examples Download Formatted Excel Reports Using the Reports REST
API
"type" : "ReportList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/DocumentList",
"label" : "Documents",
"type" : "DocumentList"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/LoginIpEmail",
"label" : "New Login Locations",
"type" : "LoginIpEmail"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/TwoFactorMethodsInfo",
"label" : "Identity Verification Methods",
"type" : "TwoFactorMethodsInfo"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CollabGroup",
"label" : "Collaboration Group Report",
"type" : "CollabGroup"
}, {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/CollabGroupFeedPosts",
"label" : "Collaboration Group Feed Posts Report",
"type" : "CollabGroupFeedPosts"
} ]
}, {
"label" : "File and Content Reports",
"reportTypes" : [ {
"describeUrl" : "/services/data/v39.0/analytics/reportTypes/File",
"label" : "File and Content Report",
"type" : "File"
} ]
} ]
51
Examples List Asynchronous Runs of a Report
Now when you execute a GET request, the Excel file is created. The raw response includes the Excel filename, as shown in bold in the
following example. You can add code to your application to download the file from the response stream.
Raw Response
HTTP/1.1 200 OK
Date: Wed, 06 Jun 2018 17:23:58 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: upgrade-insecure-requests
Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private
Set-Cookie: BrowserId=YJXhUq42SRyZ3hhgDPFxog;Path=/;Domain=.salesforce.com;Expires=Sun,
05-Aug-2018 17:23:58 GMT;Max-Age=5184000
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Sforce-Limit-Info: api-usage=4/15000
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename="New Opportunities Report-2018-05-06-10-23-59.xlsx"
Transfer-Encoding: chunked
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,
52
Examples Filter Reports on Demand
"completionDate": "2013-08-12T18:39:07Z"
}
]
SEE ALSO:
Instances List
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",
53
Examples Filter Reports on Demand
"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",
"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": []
}
}
54
Examples Filter Reports on Demand
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,
"label": "1"
}
]
},
"7_1!T": {
"aggregates": [
{
"value": 24000000,
"label": "$24,000,000"
},
{
"value": 1,
"label": "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"
55
Examples List Recently Viewed Reports
},
{
"value": "\"100,000\"",
"operator": "greaterThan",
"column": "SALES"
},
{
"value": "Manufacturing,Recreation",
"operator": "notEqual",
"column": "INDUSTRY"
}
],
"detailColumns": [
"RATING",
"LAST_UPDATE",
"SALES"
],
...
}
}
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",
"id" : "00OR0000000OFXeMAO",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFXeMAO/instances",
56
Examples Decode the Fact Map
"id" : "00OR0000000K2UeMAK",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000K2UeMAK/instances",
"id" : "00OR0000000OFHoMAO",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000OFHoMAO/instances",
"id" : "00OR0000000JdVOMA0",
"instancesUrl" : "/services/data/v35.0/analytics/reports/00OR0000000JdVOMA0/instances",
SEE ALSO:
Report List
Summary <First level row grouping_second level row grouping_third level row
grouping>!T: T refers to the row grand total.
Matrix <First level row grouping_second level row grouping>!<First level column
grouping_second level column grouping>.
57
Examples Decode the Fact Map
Each item in a row or column grouping is numbered starting with 0. Here are some examples of fact map keys:
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.
Let’s look at examples of how fact map keys represent data as it appears in a Salesforce tabular, summary, or matrix report.
58
Examples Decode the Fact Map
1_0!T Summary of the probabilities for the Manufacturing opportunities in the Needs Analysis stage.
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.
SEE ALSO:
Execute Sync
Execute Async
59
Examples Get Report Data without Saving Changes to or Creating a
Report
Example
Get report data using the query resource.
/services/data/v37.0/analytics/reports/query
Include report criteria as reportMetadata in the POST request body. This POST request gets data about Opportunities:
{
"reportMetadata" : {
"aggregates" : [ "RowCount" ],
"chart" : null,
"crossFilters" : [ ],
"currency" : null,
"description" : null,
"detailColumns" : [ "OPPORTUNITY_NAME", "TYPE", "LEAD_SOURCE", "AMOUNT", "CLOSE_DATE",
"NEXT_STEP", "STAGE_NAME", "PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE",
"FULL_NAME", "ROLLUP_DESCRIPTION", "ACCOUNT_NAME" ],
"developerName" : "OpportunityReport",
"division" : null,
"folderId" : "00DD000000086ujMAA",
"groupingsAcross" : [ ],
"groupingsDown" : [ ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : "00OD0000001leVCMAY",
"name" : "Matrix",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
"reportFormat" : "MATRIX",
"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"
}, {
60
Examples Get Report Data without Saving Changes to or Creating a
Report
"name" : "probability",
"value" : ">0"
} ]
}
}
The response to the POST request returns report data, but doesn’t create or save a report.
{
"attributes" : {
"describeUrl" : "/services/data/v37.0/analytics/reports/null/describe",
"instancesUrl" : "/services/data/v37.0/analytics/reports/null/instances",
"reportId" : null,
"reportName" : "Matrix",
"type" : "Report"
},
"allData" : true,
"factMap" : {
"T!T" : {
"aggregates" : [ {
"label" : "9",
"value" : 9
} ],
"rows" : [ {
"dataCells" : [ {
"label" : "salesforce.com - 5000 Widgets",
"value" : "006D000000CzmqYIAR"
}, {
"label" : "New Business",
"value" : "New Business"
}, {
"label" : "Advertisement",
"value" : "Advertisement"
}, {
"label" : "$500,000.00",
"value" : {
"amount" : 500000,
"currency" : null
}
}, {
"label" : "9/19/2013",
"value" : "2013-09-19"
}, {
"label" : "Closed!",
"value" : "Closed!"
}, {
"label" : "Closed Won",
"value" : "Closed Won"
}, {
"label" : "100%",
"value" : 100
}, {
"label" : "Q2-2007",
"value" : "Q2-2007"
}, {
61
Examples Get Report Data without Saving Changes to or Creating a
Report
"label" : "0",
"value" : 0
}, {
"label" : "1/4/2016",
"value" : "2016-01-04"
}, {
"label" : "Fred Williamson",
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Global Media",
"value" : "001D000000KtTTqIAN"
} ]
}, {
"dataCells" : [ {
"label" : "salesforce.com - 500 Widgets",
"value" : "006D000000CzmqZIAR"
}, {
"label" : "Existing Business",
"value" : "Existing Business"
}, {
"label" : "Advertisement",
"value" : "Advertisement"
}, {
"label" : "$50,000.00",
"value" : {
"amount" : 50000,
"currency" : null
}
}, {
"label" : "9/19/2013",
"value" : "2013-09-19"
}, {
"label" : "Closed!",
"value" : "Closed!"
}, {
"label" : "Closed Won",
"value" : "Closed Won"
}, {
"label" : "100%",
"value" : 100
}, {
"label" : "Q2-2007",
"value" : "Q2-2007"
}, {
"label" : "0",
"value" : 0
}, {
"label" : "1/4/2016",
"value" : "2016-01-04"
}, {
"label" : "Fred Williamson",
62
Examples Get Report Data without Saving Changes to or Creating a
Report
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Global Media",
"value" : "001D000000KtTTqIAN"
} ]
}, {
"dataCells" : [ {
"label" : "Acme - 1,200 Widgets",
"value" : "006D000000CzmqbIAB"
}, {
"label" : "Existing Business",
"value" : "Existing Business"
}, {
"label" : "Trade Show",
"value" : "Trade Show"
}, {
"label" : "$140,000.00",
"value" : {
"amount" : 140000,
"currency" : null
}
}, {
"label" : "10/22/2013",
"value" : "2013-10-22"
}, {
"label" : "Need estimate",
"value" : "Need estimate"
}, {
"label" : "Value Proposition",
"value" : "Value Proposition"
}, {
"label" : "50%",
"value" : 50
}, {
"label" : "Q2-2007",
"value" : "Q2-2007"
}, {
"label" : "134",
"value" : 134
}, {
"label" : "1/4/2016",
"value" : "2016-01-04"
}, {
"label" : "Fred Williamson",
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Acme",
"value" : "001D000000KtTTrIAN"
63
Examples Get Report Data without Saving Changes to or Creating a
Report
} ]
}, {
"dataCells" : [ {
"label" : "salesforce.com - 1,000 Widgets",
"value" : "006D000000CzmqeIAB"
}, {
"label" : "New Business",
"value" : "New Business"
}, {
"label" : "Advertisement",
"value" : "Advertisement"
}, {
"label" : "$100,000.00",
"value" : {
"amount" : 100000,
"currency" : null
}
}, {
"label" : "10/22/2013",
"value" : "2013-10-22"
}, {
"label" : "Close the deal!",
"value" : "Close the deal!"
}, {
"label" : "Negotiation/Review",
"value" : "Negotiation/Review"
}, {
"label" : "90%",
"value" : 90
}, {
"label" : "Q2-2007",
"value" : "Q2-2007"
}, {
"label" : "134",
"value" : 134
}, {
"label" : "1/4/2016",
"value" : "2016-01-04"
}, {
"label" : "Fred Williamson",
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "salesforce.com",
"value" : "001D000000KtTTsIAN"
} ]
}, {
"dataCells" : [ {
"label" : "Global Media - 400 Widgets",
"value" : "006D000000CzmqaIAB"
}, {
"label" : "New Business",
64
Examples Get Report Data without Saving Changes to or Creating a
Report
65
Examples Get Report Data without Saving Changes to or Creating a
Report
"amount" : 70000,
"currency" : null
}
}, {
"label" : "12/18/2013",
"value" : "2013-12-18"
}, {
"label" : "Need estimate",
"value" : "Need estimate"
}, {
"label" : "Needs Analysis",
"value" : "Needs Analysis"
}, {
"label" : "20%",
"value" : 20
}, {
"label" : "Q3-2007",
"value" : "Q3-2007"
}, {
"label" : "134",
"value" : 134
}, {
"label" : "1/4/2016",
"value" : "2016-01-04"
}, {
"label" : "Fred Williamson",
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Acme",
"value" : "001D000000KtTTrIAN"
} ]
}, {
"dataCells" : [ {
"label" : "salesforce.com - 2,000 Widgets",
"value" : "006D000000CzmqfIAB"
}, {
"label" : "Existing Business",
"value" : "Existing Business"
}, {
"label" : "Partner",
"value" : "Partner"
}, {
"label" : "$20,000.00",
"value" : {
"amount" : 20000,
"currency" : null
}
}, {
"label" : "12/20/2013",
"value" : "2013-12-20"
}, {
66
Examples Get Report Data without Saving Changes to or Creating a
Report
67
Examples Get Report Data without Saving Changes to or Creating a
Report
"value" : 10
}, {
"label" : "Q4-2007",
"value" : "Q4-2007"
}, {
"label" : "134",
"value" : 134
}, {
"label" : "1/4/2016",
"value" : "2016-01-04"
}, {
"label" : "Fred Williamson",
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Acme",
"value" : "001D000000KtTTrIAN"
} ]
}, {
"dataCells" : [ {
"label" : "Fred",
"value" : "006D000000Czq0uIAB"
}, {
"label" : "-",
"value" : null
}, {
"label" : "-",
"value" : null
}, {
"label" : "-",
"value" : null
}, {
"label" : "2/26/2016",
"value" : "2016-02-26"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Id. Decision Makers",
"value" : "Id. Decision Makers"
}, {
"label" : "60%",
"value" : 60
}, {
"label" : "Q1-2016",
"value" : "Q1-2016"
}, {
"label" : "85",
"value" : 85
}, {
"label" : "2/22/2016",
"value" : "2016-02-22"
68
Examples Get Report Data without Saving Changes to or Creating a
Report
}, {
"label" : "Fred Williamson",
"value" : "005D0000001bV42IAE"
}, {
"label" : "-",
"value" : null
}, {
"label" : "Fred",
"value" : "001D000000KtqzeIAB"
} ]
} ]
}
},
"groupingsAcross" : {
"groupings" : [ ]
},
"groupingsDown" : {
"groupings" : [ ]
},
"hasDetailRows" : true,
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"RowCount" : {
"dataType" : "int",
"label" : "Record Count"
}
},
"detailColumnInfo" : {
"OPPORTUNITY_NAME" : {
"dataType" : "string",
"label" : "Opportunity Name"
},
"TYPE" : {
"dataType" : "picklist",
"label" : "Type"
},
"LEAD_SOURCE" : {
"dataType" : "picklist",
"label" : "Lead Source"
},
"AMOUNT" : {
"dataType" : "currency",
"label" : "Amount"
},
"CLOSE_DATE" : {
"dataType" : "date",
"label" : "Close Date"
},
"NEXT_STEP" : {
"dataType" : "string",
"label" : "Next Step"
},
"STAGE_NAME" : {
"dataType" : "picklist",
69
Examples Get Report Data without Saving Changes to or Creating a
Report
"label" : "Stage"
},
"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"
},
"ACCOUNT_NAME" : {
"dataType" : "string",
"label" : "Account Name"
}
},
"groupingColumnInfo" : { }
},
"reportMetadata" : {
"aggregates" : [ "RowCount" ],
"chart" : null,
"crossFilters" : [ ],
"currency" : null,
"description" : null,
"detailColumns" : [ "OPPORTUNITY_NAME", "TYPE", "LEAD_SOURCE", "AMOUNT", "CLOSE_DATE",
"NEXT_STEP", "STAGE_NAME", "PROBABILITY", "FISCAL_QUARTER", "AGE", "CREATED_DATE",
"FULL_NAME", "ROLLUP_DESCRIPTION", "ACCOUNT_NAME" ],
"developerName" : null,
"division" : null,
"folderId" : "00DD000000086ujMAA",
"groupingsAcross" : [ ],
"groupingsDown" : [ ],
"hasDetailRows" : true,
"hasRecordCount" : true,
"historicalSnapshotDates" : [ ],
"id" : null,
"name" : "Matrix",
"reportBooleanFilter" : null,
"reportFilters" : [ ],
70
Examples Save Changes to Reports
"reportFormat" : "TABULAR",
"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"
} ]
}
}
Note: Saving a report deletes any running async report jobs because they will be obsolete.
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.
This PATCH request /services/data/v34.0/analytics/reports/00OD0000001cxIE to the Report resource updates
and saves the report.
{
"reportMetadata" : {
"name":"myUpdatedReport",
"folderId":"00DD00000007enH"}
}
The response to the PATCH request returns the following details about the updated, saved report.
{
"reportExtendedMetadata" : {
...
},
"reportMetadata" : {
"aggregates" : [ "RowCount" ],
"chart" : null,
71
Examples Clone Reports
"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" : {
...
}
}
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."
72
Examples Clone Reports
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",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CREATED_DATE",
"durationValue" : "CUSTOM",
"endDate" : null,
"startDate" : null },
"standardFilters" : null },
"reportTypeMetadata" : {
...
}
}
73
Examples Delete Reports
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.
Dashboards Examples
Learn how to refresh, create, edit, copy, and delete dashboards.
SEE ALSO:
Dashboard List
74
Examples Get Dashboard Results
• Metadata: information about the dashboard as a whole, including the dashboard ID, name, component metadata, and any dashboard
filters.
• Data: underlying report data for each component, filtered by the optional filter parameters. For more information about filtering,
see Filter Dashboard Results.
• Status: data and refresh status for each component of the dashboard. The data status can be NODATA, DATA, or ERROR. If an
error occurs, the component status will contain additional properties with the error code, message, and severity. The refresh status
can be IDLE, if components are finished running, or RUNNING, if components are still being refreshed.
Example Usage
/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE
75
Examples Get Dashboard Results
"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,
"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" : {
76
Examples Get Dashboard Results
"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" : {
"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 },
77
Examples Filter Dashboard Results
"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,
"value" : "USD 2000000"
} ],
"selectedOption" : null
} ],
"folderId" : "00lR0000000DrojIAC",
"id" : "01ZD00000007S89MAE",
"layout" : {
"columns" : [ {
"components" : [ 0 ]
} ]
},
"name" : "Simple Dashboard",
"runningUser" : {
"displayName" : "Allison Wheeler",
"id" : "005D00000016V2qIAE"
}
}
}
SEE ALSO:
Dashboard Results
78
Examples Get Dashboard Status
Example Usage
A dashboard with one filter ("Country") and two options ("United States" and "Canada") appears like this in the dashboard metadata:
{
"dashboardMetadata" : {
...
"filters" : [ {
"name" : "Country",
"options" : [ {
"id" : "0ICxx0000000001GAA",
"alias" : "United States",
"operation" : "equals",
"value" : "US",
"startValue" : null,
"endValue" : null
} ], [ {
"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
79
Examples 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.
80
Examples Save a Dashboard
Use a PATCH request on the Dashboard Results resource to save changes to a dashboard.
Example Usage
/services/data/v31.0/analytics/dashboards/01ZD00000007S89MAE
81
Examples Save a Dashboard
"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,
"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",
82
Examples Save a Dashboard
"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" : {
"dataStatus" : "DATA",
"errorCode" : null,
"errorMessage" : null,
"errorSeverity" : null,
"refreshDate" : "2014-04-09T00:28:16.000+0000",
"refreshStatus" : "IDLE"
}
} ],
"dashboardMetadata" : {
"attributes" : {
"dashboardId" : "01ZD00000007S89MAE",
"dashboardName" : "Service Dept 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 } ]
} ],
83
Examples Set a Sticky Dashboard Filter
"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,
"value" : "USD 2000000"
} ],
"selectedOption" : null
} ],
"folderId" : "00lR0000000DrojIAC",
"id" : "01ZD00000007S89MAE",
"layout" : {
"columns" : [ {
"components" : [ 0 ]
} ]
},
"name" : "Simple Dashboard",
"runningUser" : {
"displayName" : "Allison Wheeler",
"id" : "005D00000016V2qIAE"
}
}
}
84
Examples Return Details About Dashboard Components
"errorMessage" : null,
"id" : "0IBR00000004D4iOAE",
"name" : "Billing City",
"options" : [ {
"alias" : "New York City",
"endValue" : null,
"id" : "0ICR00000004FtQOAU",
"operation" : "equals",
"startValue" : null,
"value" : "New York City"
}, {
"alias" : "Chicago",
"endValue" : null,
"id" : "0ICR00000004FtROAU",
"operation" : "equals",
"startValue" : null,
"value" : "Chicago"
}, {
"alias" : "Los Angeles",
"endValue" : null,
"id" : "0ICR00000004FtSOAU",
"operation" : "equals",
"startValue" : null,
"value" : "Los Angeles"
}
],
"selectedOption" : 1
}
]
}
85
Examples Return Details About Dashboard Components
"type" : "Dashboard"
},
"componentData" : [ {
"componentId" : "01aR00000005aT4IAI",
"reportResult" : {
"attributes" : null,
"allData" : true,
"factMap" : {
"0!T" : {
"aggregates" : [ {
"label" : "$10,000.00",
"value" : 10000
} ]
},
"1!T" : {
"aggregates" : [ {
"label" : "$110,000.00",
"value" : 110000
} ]
},
"0_0!T" : {
"aggregates" : [ {
"label" : "$10,000.00",
"value" : 10000
} ]
},
"2_2!T" : {
"aggregates" : [ {
"label" : "$143.00",
"value" : 143
} ]
},
"2!T" : {
"aggregates" : [ {
"label" : "$400,398.00",
"value" : 400398
} ]
},
"0_1!T" : {
"aggregates" : [ {
"label" : "$0.00",
"value" : 0
} ]
},
"2_3!T" : {
"aggregates" : [ {
"label" : "$100,017.00",
"value" : 100017
} ]
86
Examples Return Details About Dashboard Components
},
"T!T" : {
"aggregates" : [ {
"label" : "$520,398.00",
"value" : 520398
} ]
},
"2_0!T" : {
"aggregates" : [ {
"label" : "$138.00",
"value" : 138
} ]
},
"1_0!T" : {
"aggregates" : [ {
"label" : "$110,000.00",
"value" : 110000
} ]
},
"2_1!T" : {
"aggregates" : [ {
"label" : "$300,100.00",
"value" : 300100
} ]
}
},
"groupingsAcross" : null,
"groupingsDown" : {
"groupings" : [ {
"groupings" : [ {
"groupings" : [ ],
"key" : "0_0",
"label" : "-",
"value" : null
}, {
"groupings" : [ ],
"key" : "0_1",
"label" : "-",
"value" : null
} ],
"key" : "0",
"label" : "January 2016",
"value" : "January 2016"
}, {
"groupings" : [ {
"groupings" : [ ],
"key" : "1_0",
"label" : "-",
"value" : null
} ],
"key" : "1",
"label" : "February 2016",
"value" : "February 2016"
}, {
87
Examples Return Details About Dashboard Components
"groupings" : [ {
"groupings" : [ ],
"key" : "2_0",
"label" : "-",
"value" : null
}, {
"groupings" : [ ],
"key" : "2_1",
"label" : "-",
"value" : null
}, {
"groupings" : [ ],
"key" : "2_2",
"label" : "-",
"value" : null
}, {
"groupings" : [ ],
"key" : "2_3",
"label" : "-",
"value" : null
} ],
"key" : "2",
"label" : "March 2016",
"value" : "March 2016"
} ]
},
"hasDetailRows" : false,
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"s!AMOUNT" : {
"dataType" : "currency",
"label" : "Sum of Amount"
}
},
"detailColumnInfo" : { },
"groupingColumnInfo" : {
"ACCOUNT_NAME" : {
"dataType" : "string",
"groupingLevel" : 0,
"label" : "Account Name"
},
"CLOSE_DATE" : {
"dataType" : "date",
"groupingLevel" : 0,
"label" : "Close Date"
}
}
},
"reportMetadata" : {
"aggregates" : [ "s!AMOUNT" ],
"buckets" : [ {
"bucketType" : "picklist",
"devloperName" : "BucketField_47575792",
"label" : "Industry",
88
Examples Return Details About Dashboard Components
"nullTreatedAsZero" : false,
"otherBucketLabel" : null,
"sourceColumnName" : "INDUSTRY",
"values" : [ {
"label" : "Technology",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Agriculture", "Apparel", "Banking",
"Biotechnology", "Chemicals", "Communications", "Construction", "Consulting", "Education",
"Electronics" ]
}, {
"label" : "Energy",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Energy", "Engineering", "Entertainment",
"Environmental", "Finance", "Food & Beverage", "Government", "Healthcare", "Hospitality",
"Insurance", "Machinery", "Manufacturing" ]
}, {
"label" : "Healthcare",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Media", "Not For Profit", "Other", "Recreation",
"Retail", "Shipping", "Technology", "Telecommunications", "Transportation", "Utilities"
]
} ]
}, {
"bucketType" : "picklist",
"devloperName" : "BucketField_36625466",
"label" : "Stage",
"nullTreatedAsZero" : false,
"otherBucketLabel" : null,
"sourceColumnName" : "STAGE_NAME",
"values" : [ {
"label" : "Early",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Prospecting", "Qualification", "Needs Analysis"
]
}, {
"label" : "Late",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Value Proposition", "Id. Decision Makers",
"Perception Analysis", "Proposal/Price Quote", "Negotiation/Review" ]
}, {
"label" : "Won",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Closed Won" ]
}, {
"label" : "Lost",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Closed Lost" ]
} ]
} ],
"chart" : null,
"crossFilters" : [ ],
"currency" : null,
"description" : null,
"detailColumns" : [ ],
89
Examples Return Details About Dashboard Components
"developerName" : "Deals_Closing_This_Quarter",
"division" : null,
"folderId" : "00lR0000000M8IiIAK",
"groupingsAcross" : [ ],
"groupingsDown" : [ {
"dateGranularity" : "None",
"name" : "ACCOUNT_NAME",
"sortAggregate" : null,
"sortOrder" : "Asc"
}, {
"dateGranularity" : "Month",
"name" : "CLOSE_DATE",
"sortAggregate" : null,
"sortOrder" : "Asc"
} ],
"hasDetailRows" : false,
"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" : "SUMMARY",
"reportType" : {
"label" : "Opportunities",
"type" : "Opportunity"
},
"scope" : "organization",
"showGrandTotal" : true,
"showSubtotals" : true,
"sortBy" : [ ],
"standardDateFilter" : {
"column" : "CLOSE_DATE",
"durationValue" : "THIS_FISCAL_QUARTER",
"endDate" : "2016-06-30",
"startDate" : "2016-04-01"
},
"standardFilters" : [ {
"name" : "open",
"value" : "all"
}, {
"name" : "probability",
"value" : ">0"
} ]
90
Examples Return Details About Dashboard Components
}
},
"status" : {
"dataStatus" : "DATA",
"errorCode" : null,
"errorMessage" : null,
"errorSeverity" : null,
"refreshDate" : "2016-03-22T18:24:39.000+0000",
"refreshStatus" : "IDLE"
}
}, {
"componentId" : "01aR00000005aT5IAI",
"reportResult" : {
"attributes" : null,
"allData" : true,
"factMap" : {
"0!T" : {
"aggregates" : [ {
"label" : "$634,493.00",
"value" : 634493
} ]
},
"1!T" : {
"aggregates" : [ {
"label" : "$590,036.00",
"value" : 590036
} ]
},
"0_0!T" : {
"aggregates" : [ {
"label" : "$14.00",
"value" : 14
} ]
},
"2!T" : {
"aggregates" : [ {
"label" : "$1,330,035.00",
"value" : 1330035
} ]
},
"0_1!T" : {
"aggregates" : [ {
"label" : "$36,021.00",
"value" : 36021
} ]
},
"0_2!T" : {
"aggregates" : [ {
"label" : "$5,000.00",
"value" : 5000
} ]
},
"1_3!T" : {
"aggregates" : [ {
91
Examples Return Details About Dashboard Components
"label" : "$500,000.00",
"value" : 500000
} ]
},
"T!T" : {
"aggregates" : [ {
"label" : "$2,554,564.00",
"value" : 2554564
} ]
},
"0_3!T" : {
"aggregates" : [ {
"label" : "$440,000.00",
"value" : 440000
} ]
},
"1_4!T" : {
"aggregates" : [ {
"label" : "$13.00",
"value" : 13
} ]
},
"0_4!T" : {
"aggregates" : [ {
"label" : "$20,000.00",
"value" : 20000
} ]
},
"1_1!T" : {
"aggregates" : [ {
"label" : "$11.00",
"value" : 11
} ]
},
"0_5!T" : {
"aggregates" : [ {
"label" : "$90,000.00",
"value" : 90000
} ]
},
"1_2!T" : {
"aggregates" : [ {
"label" : "$40,000.00",
"value" : 40000
} ]
},
"0_6!T" : {
"aggregates" : [ {
"label" : "$43,320.00",
"value" : 43320
} ]
},
"0_7!T" : {
"aggregates" : [ {
92
Examples Return Details About Dashboard Components
"label" : "$138.00",
"value" : 138
} ]
},
"1_0!T" : {
"aggregates" : [ {
"label" : "$50,012.00",
"value" : 50012
} ]
},
"2_2!T" : {
"aggregates" : [ {
"label" : "$100,017.00",
"value" : 100017
} ]
},
"2_3!T" : {
"aggregates" : [ {
"label" : "$20,018.00",
"value" : 20018
} ]
},
"2_4!T" : {
"aggregates" : [ {
"label" : "$0.00",
"value" : 0
} ]
},
"2_0!T" : {
"aggregates" : [ {
"label" : "$100,000.00",
"value" : 100000
} ]
},
"2_1!T" : {
"aggregates" : [ {
"label" : "$1,110,000.00",
"value" : 1110000
} ]
}
},
"groupingsAcross" : null,
"groupingsDown" : {
"groupings" : [ {
"groupings" : [ {
"groupings" : [ ],
"key" : "0_0",
"label" : "March 2013",
"value" : "2013-03-01"
}, {
"groupings" : [ ],
"key" : "0_1",
"label" : "July 2015",
"value" : "2015-07-01"
93
Examples Return Details About Dashboard Components
}, {
"groupings" : [ ],
"key" : "0_2",
"label" : "August 2015",
"value" : "2015-08-01"
}, {
"groupings" : [ ],
"key" : "0_3",
"label" : "September 2015",
"value" : "2015-09-01"
}, {
"groupings" : [ ],
"key" : "0_4",
"label" : "October 2015",
"value" : "2015-10-01"
}, {
"groupings" : [ ],
"key" : "0_5",
"label" : "November 2015",
"value" : "2015-11-01"
}, {
"groupings" : [ ],
"key" : "0_6",
"label" : "December 2015",
"value" : "2015-12-01"
}, {
"groupings" : [ ],
"key" : "0_7",
"label" : "March 2016",
"value" : "2016-03-01"
} ],
"key" : "0",
"label" : "Manufacturing",
"value" : "Manufacturing"
}, {
"groupings" : [ {
"groupings" : [ ],
"key" : "1_0",
"label" : "February 2013",
"value" : "2013-02-01"
}, {
"groupings" : [ ],
"key" : "1_1",
"label" : "February 2015",
"value" : "2015-02-01"
}, {
"groupings" : [ ],
"key" : "1_2",
"label" : "September 2015",
"value" : "2015-09-01"
}, {
"groupings" : [ ],
"key" : "1_3",
"label" : "February 2016",
94
Examples Return Details About Dashboard Components
"value" : "2016-02-01"
}, {
"groupings" : [ ],
"key" : "1_4",
"label" : "April 2016",
"value" : "2016-04-01"
} ],
"key" : "1",
"label" : "Media",
"value" : "Media"
}, {
"groupings" : [ {
"groupings" : [ ],
"key" : "2_0",
"label" : "November 2015",
"value" : "2015-11-01"
}, {
"groupings" : [ ],
"key" : "2_1",
"label" : "December 2015",
"value" : "2015-12-01"
}, {
"groupings" : [ ],
"key" : "2_2",
"label" : "March 2016",
"value" : "2016-03-01"
}, {
"groupings" : [ ],
"key" : "2_3",
"label" : "May 2016",
"value" : "2016-05-01"
}, {
"groupings" : [ ],
"key" : "2_4",
"label" : "June 2016",
"value" : "2016-06-01"
} ],
"key" : "2",
"label" : "Technology",
"value" : "Technology"
} ]
},
"hasDetailRows" : false,
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"s!AMOUNT" : {
"dataType" : "currency",
"label" : "Sum of Amount"
}
},
"detailColumnInfo" : { },
"groupingColumnInfo" : {
"INDUSTRY" : {
"dataType" : "picklist",
95
Examples Return Details About Dashboard Components
"groupingLevel" : 0,
"label" : "Industry"
},
"CLOSE_DATE" : {
"dataType" : "date",
"groupingLevel" : 0,
"label" : "Close Date"
}
}
},
"reportMetadata" : {
"aggregates" : [ "s!AMOUNT" ],
"buckets" : [ {
"bucketType" : "picklist",
"devloperName" : "BucketField_47575792",
"label" : "Industry",
"nullTreatedAsZero" : false,
"otherBucketLabel" : null,
"sourceColumnName" : "INDUSTRY",
"values" : [ {
"label" : "Technology",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Agriculture", "Apparel", "Banking",
"Biotechnology", "Chemicals", "Communications", "Construction", "Consulting", "Education",
"Electronics" ]
}, {
"label" : "Energy",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Energy", "Engineering", "Entertainment",
"Environmental", "Finance", "Food & Beverage", "Government", "Healthcare", "Hospitality",
"Insurance", "Machinery", "Manufacturing" ]
}, {
"label" : "Healthcare",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Media", "Not For Profit", "Other", "Recreation",
"Retail", "Shipping", "Technology", "Telecommunications", "Transportation", "Utilities"
]
} ]
}, {
"bucketType" : "picklist",
"devloperName" : "BucketField_36625466",
"label" : "Stage",
"nullTreatedAsZero" : false,
"otherBucketLabel" : null,
"sourceColumnName" : "STAGE_NAME",
"values" : [ {
"label" : "Early",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Prospecting", "Qualification", "Needs Analysis"
]
}, {
"label" : "Late",
"rangeUpperBound" : null,
"sourceDimensionValues" : [ "Value Proposition", "Id. Decision Makers",
96
Examples Return Details About Dashboard Components
97
Examples Return Details About Dashboard Components
"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" : {
"dataStatus" : "DATA",
"errorCode" : null,
"errorMessage" : null,
"errorSeverity" : null,
"refreshDate" : "2016-03-22T18:24:39.000+0000",
"refreshStatus" : "IDLE"
}
} ],
"dashboardMetadata" : {
"canChangeRunningUser" : false,
"components" : [ {
"componentData" : 0,
"footer" : null,
"header" : "Pipeline This Quarter",
"id" : "01aR00000005aT4IAI",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
} ],
"autoSelectColumns" : false,
"filterColumns" : [ ],
"groupings" : null,
"maxRows" : null,
"sort" : null,
"useReportChart" : false,
"visualizationProperties" : {
"breakPoints" : [ {
"aggregateName" : "s!AMOUNT",
"breaks" : [ {
"color" : "c23934",
"lowerBound" : 0,
"upperBound" : 200000
}, {
"color" : "ffb75d",
"lowerBound" : 200000,
98
Examples Return Details About Dashboard Components
"upperBound" : 400000
}, {
"color" : "00716b",
"lowerBound" : 400000,
"upperBound" : 600000
} ]
} ],
"showPercentages" : true,
"showTotal" : true
},
"visualizationType" : "Gauge"
},
"reportId" : "00OR0000000K2UeMAK",
"title" : null,
"type" : "Report"
}, {
"componentData" : 1,
"footer" : null,
"header" : "Pipeline by Industry",
"id" : "01aR00000005aT5IAI",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
} ],
"autoSelectColumns" : false,
"filterColumns" : [ ],
"groupings" : [ {
"name" : "INDUSTRY"
} ],
"maxRows" : null,
"sort" : {
"column" : "INDUSTRY",
"sortOrder" : "asc"
},
"useReportChart" : false,
"visualizationProperties" : {
"combineSmallGroups" : false,
"legendPosition" : "Bottom",
"showPercentages" : false,
"showTotal" : false,
"showValues" : false
},
"visualizationType" : "Donut"
},
"reportId" : "00OR0000000OgsOMAS",
"title" : null,
"type" : "Report"
} ],
"description" : null,
"developerName" : "yTtOilrkFGewFKpFUOscDuukUApfxH",
"filters" : [ ],
"folderId" : "00lR0000000DnRZIA0",
"id" : "01ZR00000008h2EMAQ",
"layout" : {
99
Examples Get Dashboard Metadata
"components" : [ {
"colspan" : 3,
"column" : 0,
"row" : 0,
"rowspan" : 4
}, {
"colspan" : 3,
"column" : 0,
"row" : 4,
"rowspan" : 4
} ],
"gridLayout" : true,
"numColumns" : 9,
"rowHeight" : 80
},
"name" : "Liz's Sales Manager Dashboard",
"runningUser" : {
"displayName" : "Vandelay Art",
"id" : "005R0000000Hv5rIAC"
}
}
}
100
Examples Get Dashboard Metadata
101
Examples Get Dashboard Metadata
},
"useReportChart" : false,
"visualizationProperties" : {
"combineSmallGroups" : true,
"legendPosition" : "Bottom",
"showPercentages" : false,
"showValues" : true
},
"visualizationType" : "Funnel"
},
"reportId" : "00OR0000000OFXeMAO",
"title" : null,
"type" : "Report"
}, {
"componentData" : 2,
"footer" : null,
"header" : null,
"id" : "01aR00000005awTIAQ",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
} ],
"autoSelectColumns" : true,
"filterColumns" : [ {
"label" : "Closed",
"name" : "CLOSED"
}, {
"label" : "Account Type",
"name" : "ACCOUNT_TYPE"
}, {
"label" : "Annual Revenue",
"name" : "SALES"
} ],
"groupings" : null,
"maxRows" : null,
"sort" : null,
"useReportChart" : false,
"visualizationProperties" : {
"breakPoints" : [ {
"aggregateName" : "s!AMOUNT",
"breaks" : [ {
"color" : "c25454",
"lowerBound" : 100000,
"upperBound" : 300000
}, {
"color" : "c2c254",
"lowerBound" : 300000,
"upperBound" : 800000
}, {
"color" : "54c254",
"lowerBound" : 800000,
"upperBound" : 1000000
} ]
} ],
102
Examples Get Dashboard Metadata
"showPercentages" : false,
"showTotal" : false
},
"visualizationType" : "Gauge"
},
"reportId" : "00OR0000000JizXMAS",
"title" : null,
"type" : "Report"
}, {
"componentData" : 3,
"footer" : null,
"header" : null,
"id" : "01aR00000005kCnIAI",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
}, {
"name" : "a!AMOUNT"
} ],
"autoSelectColumns" : false,
"filterColumns" : [ {
"label" : "Closed",
"name" : "CLOSED"
}, {
"label" : "Account Type",
"name" : "ACCOUNT_TYPE"
}, {
"label" : "Annual Revenue",
"name" : "SALES"
} ],
"groupings" : [ {
"name" : "STAGE_NAME"
}, {
"name" : "TYPE"
} ],
"maxRows" : null,
"sort" : {
"column" : "STAGE_NAME",
"sortOrder" : "asc"
},
"useReportChart" : false,
"visualizationProperties" : {
"axisRange" : {
"max" : null,
"min" : null,
"rangeType" : "auto"
},
"groupByType" : "grouped",
"legendPosition" : "Bottom"
},
"visualizationType" : "Scatter"
},
"reportId" : "00OR0000000JizXMAS",
"title" : null,
103
Examples Get Dashboard Metadata
"type" : "Report"
}, {
"componentData" : 4,
"footer" : null,
"header" : "My Table",
"id" : "01aR00000005awUIAQ",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
} ],
"autoSelectColumns" : false,
"filterColumns" : [ {
"label" : "Closed",
"name" : "CLOSED"
}, {
"label" : "Account Type",
"name" : "ACCOUNT_TYPE"
}, {
"label" : "Annual Revenue",
"name" : "SALES"
} ],
"groupings" : [ {
"name" : "INDUSTRY"
}, {
"name" : "CLOSE_DATE"
} ],
"maxRows" : null,
"sort" : {
"column" : "INDUSTRY",
"sortOrder" : "asc"
},
"useReportChart" : false,
"visualizationProperties" : {
"breakPoints" : [ {
"aggregateName" : "s!AMOUNT",
"breaks" : [ {
"color" : "c25454",
"lowerBound" : null,
"upperBound" : null
}, {
"color" : "c2c254",
"lowerBound" : null,
"upperBound" : null
}, {
"color" : "54c254",
"lowerBound" : null,
"upperBound" : null
} ]
} ],
"tableColumns" : [ {
"column" : "INDUSTRY",
"isPercent" : false,
"scale" : null,
"showTotal" : false,
104
Examples Get Dashboard Metadata
"type" : "grouping"
}, {
"column" : "CLOSE_DATE",
"isPercent" : false,
"scale" : null,
"showTotal" : false,
"type" : "grouping"
}, {
"column" : "s!AMOUNT",
"isPercent" : false,
"scale" : null,
"showTotal" : true,
"type" : "aggregate"
} ]
},
"visualizationType" : "Table"
},
"reportId" : "00OR0000000OgsOMAS",
"title" : "My Table",
"type" : "Report"
}, {
"componentData" : 5,
"footer" : null,
"header" : null,
"id" : "01aR00000005kCoIAI",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
} ],
"autoSelectColumns" : false,
"filterColumns" : [ {
"label" : "Closed",
"name" : "CLOSED"
}, {
"label" : "Account Type",
"name" : "ACCOUNT_TYPE"
}, {
"label" : "Annual Revenue",
"name" : "SALES"
} ],
"groupings" : [ {
"name" : "STAGE_NAME"
}, {
"name" : "TYPE"
} ],
"maxRows" : null,
"sort" : {
"column" : "STAGE_NAME",
"sortOrder" : "asc"
},
"useReportChart" : false,
"visualizationProperties" : {
"aggregateVisualizationInfos" : [ {
"axis" : "Y2",
105
Examples Get Dashboard Metadata
"visualizationType" : "Column"
} ],
"axisRange" : {
"max" : null,
"min" : null,
"rangeType" : "auto"
},
"groupByType" : "grouped",
"legendPosition" : "Bottom",
"showValues" : false
},
"visualizationType" : "Column"
},
"reportId" : "00OR0000000JizXMAS",
"title" : null,
"type" : "Report"
}, {
"componentData" : 6,
"footer" : null,
"header" : null,
"id" : "01aR00000005kCpIAI",
"properties" : {
"aggregates" : [ {
"name" : "s!AMOUNT"
}, {
"name" : "a!AMOUNT"
} ],
"autoSelectColumns" : false,
"filterColumns" : [ {
"label" : "Closed",
"name" : "CLOSED"
}, {
"label" : "Account Type",
"name" : "ACCOUNT_TYPE"
}, {
"label" : "Annual Revenue",
"name" : "SALES"
} ],
"groupings" : [ {
"name" : "STAGE_NAME"
} ],
"maxRows" : null,
"sort" : {
"column" : "STAGE_NAME",
"sortOrder" : "asc"
},
"useReportChart" : false,
"visualizationProperties" : {
"axisRange" : {
"max" : null,
"min" : null,
"rangeType" : "auto"
},
"groupByType" : "none",
106
Examples Get Dashboard Metadata
"legendPosition" : "Bottom",
"showValues" : false
},
"visualizationType" : "Bar"
},
"reportId" : "00OR0000000JizXMAS",
"title" : null,
"type" : "Report"
} ],
"description" : null,
"developerName" : "Filtered_Dashboard",
"filters" : [ {
"errorMessage" : null,
"id" : "0IBR00000004CElOAM",
"name" : "Closed",
"options" : [ {
"alias" : "Open",
"endValue" : null,
"id" : "0ICR00000004CG4OAM",
"operation" : "equals",
"startValue" : null,
"value" : "True"
}, {
"alias" : "Closed",
"endValue" : null,
"id" : "0ICR00000004CG5OAM",
"operation" : "equals",
"startValue" : null,
"value" : "False"
} ],
"selectedOption" : null
}, {
"errorMessage" : null,
"id" : "0IBR00000004CEmOAM",
"name" : "Account Type",
"options" : [ {
"alias" : null,
"endValue" : null,
"id" : "0ICR00000004CG6OAM",
"operation" : "equals",
"startValue" : null,
"value" : "Analyst"
}, {
"alias" : null,
"endValue" : null,
"id" : "0ICR00000004CG7OAM",
"operation" : "equals",
"startValue" : null,
"value" : "Competitor"
}, {
"alias" : null,
"endValue" : null,
"id" : "0ICR00000004CG8OAM",
"operation" : "equals",
107
Examples Get Dashboard Metadata
"startValue" : null,
"value" : "Press,Prospect,Reseller"
}, {
"alias" : null,
"endValue" : null,
"id" : "0ICR00000004CG9OAM",
"operation" : "notEqual",
"startValue" : null,
"value" : "Other"
}, {
"alias" : "Outsiders",
"endValue" : null,
"id" : "0ICR00000004CGAOA2",
"operation" : "lessOrEqual",
"startValue" : null,
"value" : "Integrator,Partner,Prospect"
} ],
"selectedOption" : null
}, {
"errorMessage" : null,
"id" : "0IBR0000000007cOAA",
"name" : "Annual Revenue",
"options" : [ {
"alias" : null,
"endValue" : null,
"id" : "0ICR000000000A5OAI",
"operation" : "lessThan",
"startValue" : null,
"value" : "\"400,000\""
} ],
"selectedOption" : null
} ],
"folderId" : "00lR0000000DnRZIA0",
"id" : "01ZR00000004SknMAE",
"layout" : {
"columns" : [ {
"components" : [ 0, 1, 2 ]
}, {
"components" : [ 3, 4 ]
}, {
"components" : [ 5, 6 ]
} ],
"gridLayout" : false
},
"name" : "Filtered Dashboard",
"runningUser" : {
"displayName" : "Vandelay Art",
"id" : "005R0000000Hv5rIAC"
}
}
108
Examples Clone a Dashboard
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 },
"name" : "Sales Manager Dashboard",
"runningUser" : { "displayName" : "Fred Wiliamson", "id" : "005R0000000Hv5rIAC" }
}
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.
Downloads Examples
Learn how to download dashboards, lenses, and reports as images or PDFs.
109
Examples Download a CRM Analytics Lens as a PNG
Example Usage
/analytics/download/dashboard/0FKB0000000xxxxxxx.pdf
Parameter Description
assetType Required for GET calls. Specifies what type of Analytics asset to download. Valid values are:
• dashboard
• lens
• report
downloadType Required for GET calls. Specifies what file type to download the Analytics asset as. Valid values are:
• .png
• .pdf
Parameter Description
assetType Required for GET calls. Specifies what type of Analytics asset to download. Valid values are:
• dashboard
• lens
• report
downloadType Required for GET calls. Specifies what file type to download the Analytics asset as. Valid values are:
• .png
• .pdf
110
Examples Download a Lightning Experience Dashboard as a PNG
Note: For a Lightning Experience dashboard, the GET only works for .png. If .pdf is used, the request returns an error.
Example Usage
/analytics/download/dashboard/01ZB0000000xxxxxxx.png
Parameter Description
assetType Required for GET calls. Specifies what type of Analytics asset to download. Valid values are:
• dashboard
• lens
• report
downloadType Required for GET calls. Specifies what file type to download the Analytics asset as. Valid values are:
• .png
• .pdf
Note: For a Lightning Experience report, the GET only works for .png when the report has a chart. If .pdf is used or the report
doesn’t have a chart, the request returns an error.
Example Usage
/analytics/download/dashboard/00OB0000000xxxxxxx.pdf
Parameter Description
assetType Required for GET calls. Specifies what type of Analytics asset to download. Valid values are:
• dashboard
111
Examples Notifications Examples
Parameter Description
• lens
• report
downloadType Required for GET calls. Specifies what file type to download the Analytics asset as. Valid values are:
• .png
• .pdf
Notifications Examples
Learn how to refresh, create, edit, copy, and delete analytic notifications. Analytic notifications are surfaced in the Salesforce user interface
as report subscriptions, dashboard subscriptions, or Analytics notifications.
Parameter Description
source Required for GET calls. Specifies what type of analytics notification to return. Valid values are:
• lightningDashboardSubscribe — dashboard subscriptions
• lightningReportSubscribe — report subscriptions
• waveNotification — Analytics notifications
ownerId Optional for GET calls. Allows users with Manage Analytics Notifications permission to get notifications for another
user with the specified ownerId.
recordId Optional. Return notifications for a single record. Valid values are:
• reportId— Unique report ID
• lensId— Unique Analytics lens ID
112
Examples Get Analytics Notifications
113
Examples Create an Analytics Notification
}, {
"active" : true,
"createdDate" : "2016-08-12T04:01:50Z",
"deactivateOnTrigger" : false,
"id" : "0AuR000000000KcKAI",
"lastModifiedDate" : "2016-08-12T04:16:34Z",
"name" : "Notification3",
"recordId" : "00OR0000000PBXEMA4",
"schedule" : {
"details" : {
"dayInWeek" : "mon",
"time" : 22,
"weekInMonth" : "third"
},
"frequency" : "monthly",
"frequencyType" : "relative"
},
"source" : "lightningReportSubscribe",
"thresholds" : [ {
"actions" : [ {
"configuration" : {
"recipients" : [ ]
},
"type" : "sendEmail"
} ],
"conditions" : null,
"type" : "always"
} ]
} ]
114
Examples Save Changes to an Analytics Notification
"source" : "lightningReportSubscribe",
"thresholds" : [ {
"actions" : [ {
"configuration" : {
"recipients" : [ ]
},
"type" : "sendEmail"
} ],
"conditions" : null,
"type" : "always"
} ]
}
115
Examples Save Changes to an Analytics Notification
116
Examples Delete an Analytics Notification
} ],
"conditions" : null,
"type" : "always"
} ]
}
Method Description
GET Check how many analytic notifications you have, and the maximum number you can have.
117
CHAPTER 3 Reference
In this chapter ... Curious about a property in the Reports and Dashboards REST API? This reference details each property,
method, and URL parameter for each Reports and Dashboards REST API resource.
• Analytics Download
• Analytics
Notifications
• Dashboards
• Filter Operators
• Folders
• Reports
• Report Types
118
Reference Analytics Download
Analytics Download
Use the Analytics Download API to download images and PDFs of Analytics content, including CRM Analytics dashboards and lenses
and Lightning Experience dashboards and reports. The Analytics Download API is available in API version 55.0 and later.
Note: To use the Analytics Download API, your org must have Slack for Salesforce and CRM Analytics for Slack enabled. From
Setup, in the Quick Find box, enter Slack, and then select Enable Slack for Salesforce. After Slack for Salesforce is enabled,
select CRM Analytics for Slack and check Agree and enable Slack Integration.
Resources for the Analytics Download API are available at /services/data/<latest API
version>/analytics/download. You can download resources with an HTTP method.
Analytics Download
Get an image or PDF for an Analytics dashboard, lens, or report (GET).
Syntax
URI
/services/data/<latest API version>/analytics/download/<asset
type>/<Id>.<downloadType>
Formats
JSON
HTTP methods
Method Description
GET Downloads a .png or .pdf for a specific Analytics dashboard, lens, or report.
Parameters
Parameter Description
assetType Required for GET calls. Specifies what type of Analytics asset to download. Valid values are:
• dashboard
• lens
• report
119
Reference Analytics Notifications
Parameter Description
Id Required for GET calls. Specifies the Analytics asset id to download.
downloadType Required for GET calls. Specifies what file type to download the Analytics asset as. Valid values are:
• .png
• .pdf
Note: For a Lightning Experience dashboards and reports, the GET only works for .png. If .pdf is used, the request returns
an error.
Analytics Notifications
Use the Analytics Notifications API to work set up custom analytics notifications. The Analytics Notifications API is available in API version
38.0 and later.
Resources for the Analytics Notifications API are available at /services/data/<latest API
version>/analytics/notifications. You can query each resource with an HTTP method.
Analytics Notification GET Check to see how many more analytics notifications you can create.
Limits
/services/data/<latest
API
version>/analytics/notifications/limits
120
Reference Analytics Notification List
Syntax
URI
/services/data/vXX.X/analytics/notifications?source=source
Formats
JSON
HTTP methods
Method Description
GET Returns a list of analytics notifications.
Parameters
Parameter Description
source Required for GET calls. Specifies what type of analytics notification to return. Valid values are:
• lightningDashboardSubscribe — dashboard subscriptions
• lightningReportSubscribe — report subscriptions
• waveNotification — Analytics notifications
ownerId Optional for GET calls. Allows users with Manage Analytics Notifications permission to get notifications for another
user with the specified ownerId.
recordId Optional. Return notifications for a single record. Valid values are:
• reportId— Unique report ID
• lensId— Unique Analytics lens ID
configuration WaveConfiguration[] Describes details of a Analytics notification. Only applicable when source
is waveNotification.
createdDate DateTime Date and time when the notification was created (in ISO 8601 format).
deactivateOnTrigger Boolean Indicates whether the notification is deactivated after it's sent (true) or not
(false). Deactivation doesn't delete the notification.
The default value is false.
121
Reference Analytics Notification List
recordId String Unique ID of the record that the notification describes. Valid values are:
• reportId
• lensId
runAs runAs The person who runs the report in a report subscription. Report recipients see
data in the emailed report that this person has access to in Salesforce.
Available in API version 40.0 and later. Only appears if you have the “Subscribe
to Reports: Add Recipients” user perm.
thresholds Threshold[] Specifies what happens when the notification runs. For example, sending an
email with report results.
runAs
Schedule
frequencyType String Only necessary when frequency is monthly. Possible values are:
• relative — Days which can change month-to-month, as described
by details.
• specific — Fixed monthly dates, as described by details.
122
Reference Analytics Notification List
daysOfWeek String[] The days of the week on which the notification is invoked. Possible values
are:
• mon — Monday
• tue — Tuesday
• wed — Wednesday
• thu — Thursday
• fri — Friday
• sat — Saturday
• sun — Sunday
weekInMonth String The week in the month during which the notification is invoked. Possible
values are:
• first — First week
• second — Second week
• third — Third week
• fourth — Fourth week
123
Reference Analytics Notification List
daysOfMonth Integer[] The days of the month on which the notification is invoked. Possible values
are integers from 1 to 31, and -1 (which represents the last day of the
month).
Threshold
conditions Condition[] Describes conditions that govern when the notification is invoked.
type String Specifies when the notification is invoked (other than date and time criteria).
Possible values are:
• always — Always invoke the notification
• onError — Invoke the notification when there is an error
• condition — Invoke the notification based on criteria described by
conditions
Condition
124
Reference Analytics Notification List
operation String The operation which is used to evaluate the condition. Possible values are:
• equal — colName and value are equal
• notEqual — colName and value are not equal
• greaterThan — colName is greater than value
• lessThan — colName is less than value
• greaterThanEqual — colName is greater than or equal to
value
• lessThanEqual — colName is less than or equal to value
Action
configuration Configuration[] Specifies important attributes for resources related to the notification.
Configuration
recipients Recipient[] A list of users, roles, and groups who receive the notification.
125
Reference Analytics Notification List
Recipient
Team
WaveConfiguration
filter String Optional. Description of selected filters at the time of notification creation.
query String Required. SAQL query which is run when the notification is invoked.
WaveDataset
126
Reference Analytics Notification
Analytics Notification
Get information about (GET), save changes to (PUT) or delete (DELETE) a specific analytics notification.
Syntax
URI
/services/data/vXX.X/analytics/notifications/analytics notification ID
Formats
JSON
HTTP methods
Method Description
GET Returns information about a specific notification.
PUT Save changes to the analytics notification as specified in the request body.
Parameters
Parameter Description
source Required for GET calls. Specifies what type of analytics notification to return. Valid values are:
• lightningDashboardSubscribe — dashboard subscriptions
• lightningReportSubscribe — report subscriptions
• waveNotification — Analytics notifications
ownerId Optional for GET calls. Allows users with Manage Analytics Notifications permission to get notifications for another
user with the specified ownerId.
recordId Optional. Return notifications for a single record. Valid values are:
• reportId— Unique report ID
• lensId— Unique Analytics lens ID
127
Reference Analytics Notification
createdDate DateTime Date and time when the notification was created (in ISO 8601 format).
deactivateOnTrigger Boolean Indicates whether the notification is deactivated after it's sent (true) or not
(false). Deactivation doesn't delete the notification.
The default value is false.
lastModifiedDate DateTime Date and time when the notification was last modified (in ISO 8601 format).
recordId String Unique ID of the record that the notification describes. Valid values are:
• reportId
• lensId
runAs runAs The person who runs the report in a report subscription. Report recipients see
data in the emailed report that this person has access to in Salesforce.
Available in API version 40.0 and later. Only appears if you have the “Subscribe
to Reports: Add Recipients” user perm.
thresholds Threshold[] Specifies what happens when the notification runs. For example, sending an
email with report results.
runAs
128
Reference Analytics Notification
Schedule
frequencyType String Only necessary when frequency is monthly. Possible values are:
• relative — Days which can change month-to-month, as described
by details.
• specific — Fixed monthly dates, as described by details.
daysOfWeek String[] The days of the week on which the notification is invoked. Possible values
are:
• mon — Monday
• tue — Tuesday
• wed — Wednesday
• thu — Thursday
• fri — Friday
• sat — Saturday
• sun — Sunday
129
Reference Analytics Notification
weekInMonth String The week in the month during which the notification is invoked. Possible
values are:
• first — First week
• second — Second week
• third — Third week
• fourth — Fourth week
dayInWeek String The day of the week on which the notification is invoked. Possible values
are:
• mon — Monday
• tue — Tuesday
• wed — Wednesday
• thu — Thursday
• fri — Friday
• sat — Saturday
• sun — Sunday
• weekday — Weekday
• weekend — Weekend day
daysOfMonth Integer[] The days of the month on which the notification is invoked. Possible values
are integers from 1 to 31, and -1 (which represents the last day of the
month).
Threshold
conditions Condition[] Describes conditions that govern when the notification is invoked.
130
Reference Analytics Notification
Condition
operation String The operation which is used to evaluate the condition. Possible values are:
• equal — colName and value are equal
• notEqual — colName and value are not equal
• greaterThan — colName is greater than value
• lessThan — colName is less than value
• greaterThanEqual — colName is greater than or equal to
value
• lessThanEqual — colName is less than or equal to value
Action
configuration Configuration[] Specifies important attributes for resources related to the notification.
Configuration
131
Reference Analytics Notification
recipients Recipient[] A list of users, roles, and groups who receive the notification.
Recipient
Team
WaveConfiguration
filter String Optional. Description of selected filters at the time of notification creation.
132
Reference Analytics Notification Limits
WaveDataset
Syntax
URI
/services/data/vXX.X/analytics/notifications/limits?source=source
Formats
JSON
HTTP methods
Method Description
GET Check how many analytic notifications you have, and the maximum number you can have.
133
Reference Dashboards
Parameters
Parameter Description
source Required for GET calls. Specifies what type of analytics notification to return. Valid values are:
• lightningDashboardSubscribe — dashboard subscriptions
• lightningReportSubscribe — report subscriptions
• waveNotification — Analytics notifications
recordId Optional. Return notifications for a single record. Valid values are:
• reportId— Unique report ID
• lensId— Unique Analytics lens ID
remaining Integer How many more analytics notifications of the type specified by source the
user can create before hitting the limit.
Dashboards
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.
Dashboard Results GET Returns the metadata, data, and status for the specified dashboard.
POST Returns details about specified dashboard components.
PUT Triggers a dashboard refresh.
PATCH Saves a dashboard.
DELETE Deletes a dashboard.
Dashboard Status GET Returns the status for the specified dashboard.
134
Reference Dashboard List
Dashboard Filter Options POST Verifies that dashboard filter options are compatible with report fields. Specify the
Analysis reportId of a dashboard’s components’ source report.
Dashboard List
Returns a list of recently used dashboards or clones a dashboard.
Syntax
URI
/services/data/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.
Authentication
Authorization: Bearer token
135
Reference Dashboard Results
Dashboard Results
Can return metadata, data, and status for the specified dashboard. Can also refresh, save, or delete a dashboard.
Syntax
URI
/services/data/vXX.X/analytics/dashboards/dashboardID
Or, with optional parameters:
/services/data/vXX.X/analytics/dashboards/dashboardID
?runningUser=runningUserID&filter1=filter1ID&filter2=filter2ID&filter3=filter3ID
Formats
JSON
HTTP methods
Method Description
GET Returns metadata, data, and status for the specified dashboard. See this example.
POST Returns details about one or more dashboard components from a specified dashboard. See this example.
Authentication
Authorization: Bearer token
Parameters
The following optional parameters can be used with the GET and PUT methods:
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.
isStickyFilterSave Append to a PATCH request. When true, saves any dashboard filters set in the request so
that they’re also set the next time you open the dashboard. You can only set dashboard filters
for yourself, not for other users.
136
Reference Dashboard Results
Attributes
statusUrl Url The URL of the status resource for the dashboard.
Component data
reportResult Report results Report metadata and summary data for the dashboard component. Uses
the same data format as the Report API.
Component status
errorCode String Unique identifier of error message. This property is only populated in case
of error.
errorMessage String Localized error message. This property is only populated in case of error.
errorSeverity String Severity of error code and message. Value can be:
• Error
137
Reference Dashboard Results
refreshDate Date and time string Date and time of last refresh in ISO-8601 format.
Dashboard metadata
canChangeRunningUser Boolean Indicates whether the user is allowed to select a specific running user.
Always true for team dashboards.
canUseStickyFilter Boolean Indicates whether dashboard filters persist after closing the dashboard
(true) or not (false). Filters that persist keep the dashboard filtered
the next time you open it. Filters persist for users on a per-user basis, so if
you apply a filter then it doesn’t persist for other people.
colorPalette String Specifies a color palette for use in charts. Possible values are:
• wildflowers—Default value.
• aurora
• nightfall
• sunrise
• bluegrass
• ocean
• heat
• dusk
• pond
• watermelon
• fire
• water
• lake
138
Reference Dashboard Results
filters Filters[] Ordered array of filters for this dashboard. The dashboard can have 0-3
filters.
runningUser Running user The running user, which is either specified at dashboard design time, or
is overridden by the runningUser parameter specified in the GET
request. For dynamic dashboards, this is always the current user.
Components
139
Reference Dashboard Results
Filters
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.
Filter option
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:
• equals
• notEqual
• lessThan
• greaterThan
140
Reference Dashboard Results
value String Value to filter on. Used for all operations except between.
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.
Layout
components Components Layout for dashboards. This property is available only if the dashboard was
created using Lightning Experience.
Columns
Components
141
Reference Dashboard Results
Running user
id String Returns the ID of the running user specified for the dashboard. If the
dashboard is configured to run as the viewing user, returns the user ID of
the dashboard creator.
picklistColors
autoSelectColumns Boolean Indicates whether groupings and aggregates are automatically selected.
Valid values are true and false.
142
Reference Dashboard Results
maxRows Number Maximum number of rows to be rendered, based on the sort value.
sort Sort Used in previous releases. In this release (v46.0) and later assign the value
null, except for the following instances:
• Tabular lightning table format
• Top N source report for any chart type
In these two cases, the value matches the following object:
{
"sort" : {
"column" : "TYPE",
"sortOrder" : "asc",
"type" : "label" },
}
useReportChart Boolean Indicates whether the dashboard component uses the chart as defined
in the report. Valid values are true and false.
143
Reference Dashboard Results
Groupings
sortAggregate String Name of the aggregate by which the dashboard component sorts. If null,
the dashboard component sorts by label or matches/inverts the report's
sort order.
sortOrder String Specifies whether the dashboard component sorts in ascending (Asc) or
descending (Desc) order.
Sort
sortAggregate String Name of the aggregate by which the dashboard component sorts. If null,
the dashboard component sorts by label or matches/inverts the report's
sort order.
sortOrder String Specifies whether the dashboard component sorts in ascending (Asc) or
descending (Desc) order.
decimalPrecision Integer The number of decimal places included in a dashboard metric, chart, or
table, 0–5. If -1 or null, Salesforce automatically sets the number of decimal
places.
144
Reference Dashboard Results
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.
145
Reference Dashboard Results
flexTableType String Specifies whether the table shows detail columns or groups and measures.
Possible values are:
• tabular — The table displays detail rows.
• summary — The table displays groups and measures.
showChatterPhotos Boolean Indicates whether Chatter photos are shown (true) or not (false).
146
Reference Dashboard Results
showPercentages Boolean Specify whether percentages are displayed (true) or not (false)
147
Reference Dashboard Results
Break point
Break
Table columns
isPercent Boolean Indicates whether the column value is shown as a percent (true)
or not (false).
Not supported for FlexTables.
scale Number The number of decimal places for the column value.
Not supported for FlexTables.
showTotal Boolean Indicates whether the column shows the total (true) or not
(false).
148
Reference Dashboard Describe
tableChatterPhotoUrls
Dashboard Describe
Returns metadata for the specified dashboard, including dashboard components, filters, layout, and the running user.
Syntax
URI
/services/data/vXX.X/analytics/dashboards/dashboardID/describe
Formats
JSON
HTTP methods
GET
Parameters
Parameter Description
loadComponentProperties Optional. Specifies whether or not to return properties for each dashboard component. The default value is true.
Has no effect on filtered dashboards. Valid values are:
• true — Return component properties.
149
Reference Dashboard Describe
Parameter Description
• false — Don’t return component properties. The properties value instead returns null.
Authentication
Authorization: Bearer token
Example
See this example, Get Dashboard Metadata.
Response body
Property Type Description
attributes Attributes Attributes for the dashboard resource, such as name, identifier, and references
to other related resources.
canChangeRunningUser Boolean Indicates whether the user is allowed to select a specific running user. Always
true for team dashboards.
canUseStickyFilter Boolean Indicates whether dashboard filters persist after closing the dashboard
(true) or not (false). Filters that persist keep the dashboard filtered the
next time you open it. Filters persist for users on a per-user basis, so if you
apply a filter then it doesn’t persist for other people.
colorPalette String Specifies a color palette for use in charts. Possible values are:
• wildflowers—Default value.
• aurora
• nightfall
• sunrise
• bluegrass
• ocean
• heat
• dusk
• pond
• watermelon
• fire
• water
150
Reference Dashboard Describe
filters Filters[] Ordered array of filters for this dashboard. The dashboard can have 0-3 filters.
runningUser Running user The running user, which is either specified at dashboard design time, or is
overridden by the runningUser parameter specified in the GET request.
For dynamic dashboards, this is always the current user.
Components
151
Reference Dashboard Describe
autoSelectColumns Boolean Indicates whether groupings and aggregates are automatically selected.
Valid values are true and false.
152
Reference Dashboard Describe
sort Sort Used in previous releases. In this release (v46.0) and later assign the
value null, except for the following instances:
• Tabular lightning table format
• Top N source report for any chart type
In these two cases, the value matches the following object:
{
"sort" : {
"column" : "TYPE",
"sortOrder" : "asc",
"type" : "label" },
}
useReportChart Boolean Indicates whether the dashboard component uses the chart as defined
in the report. Valid values are true and false.
153
Reference Dashboard Describe
Sort
sortAggregate String Name of the aggregate by which the dashboard component sorts. If
null, the dashboard component sorts by label or matches/inverts the
report's sort order.
sortOrder String Specifies whether the dashboard component sorts in ascending (Asc)
or descending (Desc) order.
decimalPrecision Integer The number of decimal places included in a dashboard metric, chart,
or table, 0–5. If -1 or null, Salesforce automatically sets the number of
decimal places.
legendPosition String Position of legend on the grid. Valid values are bottom, right, and
none.
154
Reference Dashboard Describe
155
Reference Dashboard Describe
showPercentages Boolean Specify whether percentages are displayed (true) or not (false)
showTotal Boolean Indicates whether the total is displayed (true) or not (false).
156
Reference Dashboard Describe
Filters
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.
Filter option
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:
• equals
• notEqual
• lessThan
• greaterThan
• lessOrEqual
• greaterOrEqual
• contains
• notContain
• startsWith
• includes
• excludes
• within
157
Reference Dashboard Describe
value String Value to filter on. Used for all operations except between.
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.
Layout
components Components Layout for dashboards. This property is available only if the dashboard was
created using Lightning Experience.
Columns
Components
rowspan Integer Height of component in rows. For example, if rowspan=4, then the
component spans 4 rows.
158
Reference Dashboard Status
Running user
id String Returns the ID of the running user specified for the dashboard. If the
dashboard is configured to run as the viewing user, returns the user ID of
the dashboard creator.
Dashboard Status
Returns the status for the specified dashboard.
Syntax
URI
/services/data/vXX.X/analytics/dashboards/dashboardID/status
Or, with optional parameters:
/services/data/vXX.X/analytics/dashboards/dashboardID/status
?runningUser=runningUserID&filter1=filter1ID&filter2=filter2ID&filter3=filter3ID
Formats
JSON
HTTP methods
GET
Authentication
Authorization: Bearer token
Parameters
The following optional parameters can be used with the GET method:
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 Component status with Status for each component of the dashboard. The order of the array is the same
id[] as in previous calls, unless the dashboard has changed in the meantime.
159
Reference Dashboard Filter Options Analysis
refreshDate Date and time string Date and time of last refresh in ISO-8601 format.
Syntax
URI
/services/data/vXX.X/analytics/dashboards/dashboardID/filteroptionsanalysis
Formats
JSON
HTTP methods
POST
Authentication
Authorization: Bearer token
options options[] An array of objects describing a dashboard filter. Each object has these
properties:
alias
The display name of the filter value.
operation
The filter’s operator.
160
Reference Dashboard and Component Error Codes
value
The value applied by the filter.
startValue
If the filter includes a range (such as a date range), the start of the range.
Otherwise, null.
endValue
If the filter includes a range (such as a date range), the end of the range.
Otherwise, null.
Dashboard-level errors
When a dashboard-level error occurs, the response header contains an HTTP response code and one of the following error messages:
161
Reference Dashboard and Component Error Codes
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.
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.
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 Error
custom or external 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 Unable to run source report because its definition is invalid. Error
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.
162
Reference Filter Operators
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 Error
report filters above the limit. Reduce the number of report filters and try again.
305 The component can't be displayed because the field(s) you chose for the filter are unavailable. Error
308 You can’t filter this component because data is in the joined report format. To filter the component, Error
change its report format.
309 The underlying report uses a snapshot date that is out of range. Error
Filter Operators
Use the Filter Operators API to get information about which filter operators are available for reports and dashboards. The Filter Operators
API is available in API version 40.0 and later.
Resources for the Filter Operators API are available at /services/data/<latest API
version>/analytics/filteroperators. You can query each resource with an HTTP method.
Syntax
URI
/services/data/vXX.X/analytics/reportTypes
163
Reference Filter Operator List
Formats
JSON
HTTP methods
Method Description
GET Returns a list of filter operators.
Parameters
Parameter Description
forDashboards Optional. When forDashboards equals true, returns filter operators for dashboard filters. Otherwise, the
GET response always returns filter operators for report filters.
164
Reference Filter Operator List
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"double" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"picklist" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
165
Reference Filter Operator List
166
Reference Filter Operator List
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"url" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"int" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
167
Reference Filter Operator List
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"reference" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
} ],
"datetime" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"boolean" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
} ],
"phone" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
168
Reference Filter Operator List
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"currency" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
} ],
"id" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"email" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "less than",
"name" : "lessThan"
}, {
"label" : "greater than",
"name" : "greaterThan"
}, {
"label" : "less or equal",
169
Reference Folders
"name" : "lessOrEqual"
}, {
"label" : "greater or equal",
"name" : "greaterOrEqual"
}, {
"label" : "contains",
"name" : "contains"
}, {
"label" : "does not contain",
"name" : "notContain"
}, {
"label" : "starts with",
"name" : "startsWith"
} ],
"multipicklist" : [ {
"label" : "equals",
"name" : "equals"
}, {
"label" : "not equal to",
"name" : "notEqual"
}, {
"label" : "includes",
"name" : "includes"
}, {
"label" : "excludes",
"name" : "excludes"
} ]
}
Folders
Use the Analytics Folders API to perform operations on report and dashboard folders. The Folders API is available in API version 41.0 and
later.
Resources for the Analytics Folders API are available at /services/data/<latest API version>/folders. You can
query each resource with an HTTP method.
170
Reference Folder Collections
Folder Collections
Enables creation of report and dashboard folders and obtaining the list of folders.
The following user permissions are needed to access this resource.
POST:
• Create Dashboard Folders (for dashboard folders)
• Create Report Folders (for report folders)
GET:
• View access to the folder
Syntax
URI
/services/data/v43.0/folders/
Formats
JSON
HTTP methods
Method Description
POST Creates a new folder with the specified name, label, and type.
171
Reference Folder Collections
Method Description
GET Gets the list of folders.
POST
Creates a new folder with the specified name, label, type, and parent ID (subfolders only).
/services/data/v43.0/folders/
Request Body
FolderInputRepresentation
name String 42.0 Folder unique name. This is a mandatory field for admins; for non-admins,
it is auto-generated.
type ConnectFolderTypeEnum 42.0 Defined by the type of entity the folder contains.
parentId String 43.0 ID of the parent folder. This field is valid only for subfolders.
ConnectFolderTypeEnum
Type Description
Dashboard Dashboard folders.
172
Reference Folder Collections
"type": "report"
"parentId": "00lxx000000fffffff"
}
"sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares",
"supportedShareTypes" : [ "user", "role", "roleandsubordinates",
"roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates",
"customerportaluser" ],
"type" : "report"
"parentId" : "00lxx000000fffffff"
GET
Gets the list of report and dashboard folders.
/services/data/v43.0/folders/
Parameters
pageSize Integer 43.0 Integer that indicates how many results to return
per page. Default is 10.
Output Payload
FolderCollectionRepresentation
FolderCollectionRepresentation
173
Reference Folder Collections
FolderSummaryRepresentation
type ConnectFolderTypeEnum 43.0 Defined by the type of entity the folder contains.
childrenUrl ConnectUri 43.0 URL that represents the first level subfolders of the
specified folder.
depth Int 43.0 Depth of the folder in the tree. A folder with depth
0 is the root folder.
174
Reference Folder Operations
"url" : "/services/data/v43.0/folders/00lRM000000jDmNYAU"
}, {
"childrenUrl" : "/services/data/v43.0/folders/00lRM000000jHKXYA2/children",
"id" : "00lRM000000jHKXYA2",
"label" : "North America Sales",
"name" : "North_America_Sales",
"type" : "report",
"url" : "/services/data/v43.0/folders/00lRM000000jHKXYA2"
} ],
"totalSize" : 3,
"url" : "/services/data/v43.0/folders?page=1&pageSize=10"
}
Folder Operations
Enables renaming, deleting, and obtaining information on report and dashboard folders.
The following user permissions are needed to access this resource.
GET:
• View access for the folder
PATCH/DELETE:
• Manage access for the folder
Syntax
URI
/services/data/v43.0/folders/<folderid>
Formats
JSON
HTTP methods
Method Description
GET Gets information about the folder that has the specified folder ID.
PATCH Updates the label or name of the folder with the specified folder ID.
• All users with manage access on the folder can change the folder label.
• Only admin users can change the folder name.
DELETE Deletes the folder that has the specified folder ID.
Parameters
Parameter Description
folderId Specifies a unique folder ID.
175
Reference Folder Operations
GET
Gets information about the folder that has the specified folder ID.
/services/data/v43.0/folders/<folderid>
Output Payload
FolderDetailRepresentatiion
FolderDetailRepresentatiion
namespace String 42.0 Namespace prefix to differentiate custom object and field
names from those in use by other organizations.
type ConnectFolderTypeEnum 42.0 Defined by the type of entity the folder contains.
childrenUrl ConnectUri 43.0 URL that represents the first level subfolders of the
specified folder:
/services/data/v43.0/folders/<folderid>/children
depth Integer 43.0 Depth of the folder in the tree. A folder with depth 0 is
the root folder.
supportedShareTypess List <supportedShareTypes on 43.0 List of supported share types for the folder in the
page 185> organization.
sharesUrl ConnectUri 43.0 URL of the shares for the particular folder:
/services/data/v43.0/folders/<folderid>/shares
176
Reference Folder Operations
ConnectFolderTypeEnum
Type Description
Dashboard Dashboard folders.
FolderSummaryRepresentation
type ConnectFolderTypeEnum 43.0 Defined by the type of entity the folder contains.
childrenUrl ConnectUri 43.0 URL that represents the first level subfolders of the
specified folder:
/services/data/v43.0/folders/<folderid>/children
depth Int 43.0 Depth of the folder in the tree. A folder with depth
0 is the root folder.
177
Reference Folder Operations
"/services/data/v43.0/folders/00lxx000000flSFAAY/share-recipients?shareType=User&limit=100",
"sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares",
"supportedShareTypes" : [ "user", "role", "roleandsubordinates",
"roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates",
"customerportaluser" ],
"type" : "report",
"url" : "/services/data/v43.0/folders/00lxx000000flSFAAY"
}
PATCH
Updates the label or name of the folder with the specified folder ID.
• Users with manage access on the folder can change the folder label.
• Only admin users can change the folder name.
/services/data/v43.0/folders/<folderid>
Request Body
FolderInputRepresentation
name String 42.0 Folder unique name. This is a mandatory field for admins; for non-admins,
it is auto-generated.
type ConnectFolderTypeEnum 42.0 Defined by the type of entity the folder contains:
parentId String 43.0 ID of the parent folder. This field is valid only for subfolders.
178
Reference Folder Shares
"childrenUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/children",
"depth" : 0,
"id" : "00lxx000000flSFAAY",
"label" : "report_folder1",
"name" : "report_folder1",
"shareRecipientsUrl" :
"/services/data/v43.0/folders/00lxx000000flSFAAY/share-recipients?shareType=User&limit=100",
"sharesUrl" : "/services/data/v43.0/folders/00lxx000000flSFAAY/shares",
"supportedShareTypes" : [ "user", "role", "roleandsubordinates",
"roleandsubordinatesinternal", "group", "portalrole", "portalroleandsubordinates",
"customerportaluser" ],
"type" : "report",
"url" : "/services/data/v43.0/folders/00lxx000000flSFAAY"
}
DELETE
Deletes the folder that has the specified folder ID.
/services/data/v43.0/folders/<folderid>
Folder Shares
Extracts a list of current folder shares (GET), adds new shares (POST), or replaces existing shares (PUT).
The following user permissions are needed to access this resource.
POST/PUT:
• Manage access to the folder
GET:
• View access to the folder
Syntax
URI
/services/data/v41.0/folders/<folderId>/shares
Formats
JSON
HTTP methods
Method Description
GET Returns a list of current folder shares.
PUT Creates new shares to replace the existing shares in the share list for the folder.
POST Creates new shares and appends them to the existing share list for the folder.
179
Reference Folder Shares
Parameters
Parameter Description
folderId Perform the operation for this unique folder ID.
GET
Response Body
ConnectFolderAccessTypeEnum
Type Description
View View access to the folder.
ConnectFolderShareTypeEnum
Type Description
Group Users in a specified public group.
RoleAndSubordinates Users with a specified role and users with a role subordinate to that role.
RoleAndSubordinatesInternal Users with a specified role and users with a role subordinate to that role, except public portal
users.
180
Reference Folder Shares
Type Description
AllCspUsers All Customer Success Portal users.
PortalRoleAndSubordinates PortalRoleAndSubordinates. Portal users with a specified role, and portal users with a role
subordinate to that role.
ChannelProgramGroup PRM Portal users who are members of the specified channel programs and levels group.
Output Example 1
Sample raw response for a folder not shared with anyone.
{
“shares” : []
}
Output Example 2
Sample raw response for a folder shared with two users and a public group.
{
"shares" : [ {
"accessType" : "view",
"shareId" : "0AFR00000004LtpOAE",
"shareType" : "group",
"sharedWithId" : "00GR0000000Mi1nMAC",
"sharedWithLabel" : "Demo Group",
"url" : "/services/data/v41.0/folders/00lR0000000MQT5IAO/shares/0AFR00000004LtpOAE"
}, {
"accessType" : "edit",
"shareId" : "0AFR00000004LtkOAE",
"shareType" : "user",
"sharedWithId" : "005R0000000Kg8yIAC",
"sharedWithLabel" : "Brian Alison",
"url" : "/services/data/v41.0/folders/00lR0000000MQT5IAO/shares/0AFR00000004LtkOAE"
}, {
"accessType" : "manage",
"shareId" : "0AFR00000004LtlOAE",
"shareType" : "user",
"sharedWithId" : "005R0000000Kg8cIAC",
"sharedWithLabel" : "Fred Williamson",
"url" : "/services/data/v41.0/folders/00lR0000000MQT5IAO/shares/0AFR00000004LtlOAE"
} ]
}
181
Reference Folder Share by ID
PUT/POST
Request Body
Folder Share by ID
For a specified share ID, extracts folder share information (GET), updates the access level on the share (PATCH), or deletes the share
(DELETE).
The following user permissions are needed to access this resource.
PATCH/DELETE:
• Manage access to the folder
GET:
• View access to the folder
Syntax
URI
/services/data/v41.0/folders/<folderId>/shares/<shareId>
Formats
JSON
182
Reference Folder Share by ID
HTTP methods
Method Description
GET Returns information for the specified folder share.
Parameters
Parameter Description
folderId ID of the folder containing the share.
shareId Perform the operation for this unique folder share ID.
GET
Response Body
ConnectFolderAccessTypeEnum
Type Description
View View access to the folder.
ConnectFolderShareTypeEnum
Type Description
Group Users in a specified public group.
183
Reference Folder Share by ID
Type Description
Role Users with a specified role.
RoleAndSubordinates Users with a specified role and users with a role subordinate to that role.
RoleAndSubordinatesInternal Users with a specified role and users with a role subordinate to that role, except public portal
users.
PortalRoleAndSubordinates PortalRoleAndSubordinates. Portal users with a specified role, and portal users with a role
subordinate to that role.
ChannelProgramGroup PRM Portal users who are members of the specified channel programs and levels group.
Output Example
{
“shareId” : “004xx000001Sy1GAAS”
“accessType” : “manage”,
“shareType” : “user”
“sharedWithId” : “005xx000001Sy1GAAS”
“sharedWithLabel” : “User1”
}
PATCH
Request Body
FolderShareInputRepresentation
184
Reference Folder Share Recipients
shareType 41.0 The type of the entity that the folder can be shared with.
DELETE
Deletes the folder share that has the specified folder ID.
/services/data/v43.0/folders/<folderid>/shares/<shareId>
Syntax
URI
/services/data/v41.0/folders/<folderId>/share-recipients?shareType=<shareType>
Formats
JSON
HTTP methods
Method Description
GET Returns a list of recipients with whom the folder can be shared.
Parameters
shareType Return data for the recipients of the specified type, such as user, User
group, or role.
185
Reference Folder Share Recipients
GET
Response Body
FolderShareRecipientRepresentation
imageUrl ConnectUri 42.0 The url of the image for the recipient.
imageColor String 42.0 The color of the image for the recipient.
ConnectFolderShareTypeEnum
Type Description
Group Users in a specified public group.
RoleAndSubordinates Users with a specified role and users with a role subordinate to that role.
RoleAndSubordinatesInternal Users with a specified role and users with a role subordinate to that role, except public portal
users.
186
Reference Folder Share Recipients
Type Description
AllCspUsers All Customer Success Portal users.
PortalRoleAndSubordinates PortalRoleAndSubordinates. Portal users with a specified role, and portal users with a role
subordinate to that role.
ChannelProgramGroup PRM Portal users who are members of the specified channel programs and levels group.
Output Example 1
Get share recipients of type user.
/services/data/v41.0/folders/00lR0000000MQT5IAO/share-recipients?shareType=User
{
"shareRecipients" : [ {
"shareType" : "user",
"shareWithId" : "005R0000000Kg8wIAC",
"shareWithLabel" : "Hank Chen"
}, {
"shareType" : "user",
"shareWithId" : "005R0000000KkU6IAK",
"shareWithLabel" : "Integration User"
}, {
"shareType" : "user",
"shareWithId" : "005R0000000Kg8xIAC",
"shareWithLabel" : "Nadia Smith"
}, {
"shareType" : "user",
"shareWithId" : "005R0000000Kg8zIAC",
"shareWithLabel" : "Sarah Vasquez"
} ]
}
Output Example 2
Search for share recipients of type Public Group, with search term Group.
/services/data/v41.0/folders/00lR0000000MQT5IAO/share-recipients?shareType=Group&searchTerm=Group
{
"shareRecipients" : [ {
"shareType" : "group",
"shareWithId" : "00GR0000000EypUMAS",
"shareWithLabel" : "Finance"
}, {
"shareType" : "group",
"shareWithId" : "00GR0000000EypeMAC",
"shareWithLabel" : "Marketing"
}, {
"shareType" : "group",
"shareWithId" : "00GR0000000NvpIMAS",
"shareWithLabel" : "Products"
187
Reference Folder Child Operations
}, {
"shareType" : "group",
"shareWithId" : "00GR0000000EypZMAS",
"shareWithLabel" : "Sales"
}, {
"shareType" : "group",
"shareWithId" : "00GR0000000EypjMAC",
"shareWithLabel" : "Technology"
} ]
}
Syntax
URI
/services/data/v43.0/folders/<folderid>/children
Formats
JSON
HTTP methods
Method Description
GET Gets information about the child folders of the specified
folder.
Parameters
pageSize Integer 43.0 Integer that indicates how many results each page
returns. Default is 10.
GET
Gets information about the child folders of the specified folder.
188
Reference Reports
/services/data/v43.0/folders/<folderid>/children
Output Payload
FolderCollectionRepresentation
Sample Output Response
{
"folders" : [ {
"childrenUrl" : "/services/data/v43.0/folders/00lR0000000Mf56IAC/children",
"id" : "00lR0000000Mf56IAC",
"label" : "BW33",
"name" : "BW33",
"parentId" : "00lR0000000E84WIAS",
"type" : "report",
"url" : "/services/data/v43.0/folders/00lR0000000Mf56IAC"
} ],
"totalSize" : 1,
"url" : "/services/data/v43.0/folders/00lR0000000E84WIAS/children?page=1&pageSize=10"
}
Reports
Resources for the Reports API are available at /services/data/<latest API version>/analytics/reports. You
can query each resource with a HTTP method (such as GET). Use these resources to integrate report data directly into your applications.
Describe GET Gives report metadata. This includes information about fields that are defined in the
report as detail columns, summaries, custom summary formulas, filters, and groupings.
Execute Sync GET Gives report summary level data with or without details.
POST Returns specific results if you define dynamic filters, groupings, or aggregates in the
metadata of a POST request.
Execute Async POST Returns an instance that stores summary level data with or without details for a report
run asynchronously. To get specific results, define filters in the metadata of the request.
Instances List GET List of instances of a report that were requested for an asynchronous run.
Instance Results GET Depending on the type of your request, gives summary level data with or without details
for an instance of a report run asynchronously.
Report List GET List of reports that were recently viewed by the API user.
POST Makes a copy of a report.
189
Reference Report
Report
Saves changes to a report or deletes a report.
Resource URL
Data URL
Summary
/services/data/<latest API version>/analytics/reports/<report ID>
Formats
JSON
HTTP Methods
Method Description
PATCH Saves changes to a report. See this example.
190
Reference Report
allowedInCustomDetailFormula Boolean Specifies whether a field can be referenced in a row-level formula (true)
or not (false).
customDetailFormula Custom Detail Formula An array of objects that describes row-level formulas.
on page 214[]
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.
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row limit
filters on dashboards. Can be configured on a report for Top-N reports.
The Name and Value fields in dashboardSetting are used
as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For example,
West Coast and East Coast.
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.
191
Reference Report
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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
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",
192
Reference Report
"operator": "notEqual"
}
]
}
}
reportFilters Filter details[] List of each custom filter in the report along with the field name, filter
operator, and filter value.
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 Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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
193
Reference Report
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering (true)
or not (false).
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
reportTypeMetadata Report type metadata Fields in each section of a report type plus filter information for those
fields.
Report metadata
194
Reference Report
customDetailFormula Custom Detail Formula An array of objects that describes row-level formulas.
on page 203[]
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.
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row
limit filters on dashboards. Can be configured on a report for Top-N
reports. The Name and Value fields in dashboardSetting
are used as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For
example, West Coast and East Coast.
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.
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 can’t have
column groupings.
• BucketField_(ID) for bucket fields.
• ID of a custom field when the custom field is used for a column
grouping.
195
Reference Report
hasDetailRows Boolean Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
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.
196
Reference Report
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 Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report
data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering
(true) or not (false).
topRows Top rows Describes a row limit filter applied to the report.
197
Reference Report
Chart
summaries Array of strings Unique identities for summary or custom summary formula fields
in the report. For example:
• a!Amount represents the average for the Amount column.
• s!Amount represents the sum of the Amount column.
• 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.
Groupings down
sortOrder String Order in which data is sorted within a row grouping. Value can be:
• Asc for ascending order.
• Desc for descending order.
198
Reference Report
sortAggregate String Summary field that’s used to sort data within a grouping in a report
that’s in summary format. Applies if you have the Aggregate Sort
feature enabled as part of its pilot program. The value is null when
data within a grouping is not sorted by a summary field. In this
example, data grouped by Account Owner is sorted by the sum of
Annual Revenue.
{
"aggregates": ["s!SALES","RowCount"],
"groupingsDown": [
{
"name": "USERS.NAME",
"sortOrder": "Desc",
"dateGranularity": "None",
"sortAggregate": "s!SALES"
}
]
}
199
Reference Report
"showChanges" : true
}
}
}
showChanges Boolean Indicates whether to display a change column for a given historical
column.
Groupings across
sortOrder String Order in which data is sorted within a column grouping. Value can
be:
• Asc for ascending order.
• Desc for descending order.
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
200
Reference Report
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. Valid values are:
• equals
• notEqual
• lessThan
• greaterThan
• lessOrEqual
• greaterOrEqual
• contains
• notContain
• startsWith
• includes
• excludes
• within (DISTANCE criteria only)
201
Reference Report
Bucket field
nullTreatedAsZero Boolean Specifies whether null values are converted to zero (true) or not
(false).
otherBucketLabel String Name of the fields grouped as “Other” (in buckets of BucketType
PICKLIST).
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).
202
Reference Report
Cross filter
includesObject Boolean Specifies whether objects returned have a relationship with the
relatedEntity (true) or not (false).
primaryEntityField String The name of the object on which the cross filter is evaluated.
relatedEntityJoinField String The name of the field used to join the primaryEntityField
and relatedEntity.
formula String Specifies the formula expression to be evaluated. All report type fields,
except bucketed fields and historical tracking fields can be referenced.
formulaType String Specifies the return type of the formula. Valid values include:
• date
• datetime
• number
• text
formulaType String The format of the numbers in the custom summary formula. Possible
values are number, currency, and percent.
203
Reference Describe
downGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
acrossGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
formula String The operations performed on values in the custom summary formula.
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.
204
Reference Describe
Response Body
Property Type Description
reportMetadata Report metadata Unique identifiers for groupings and summaries.
reportTypeMetadata Report type metadata Fields in each section of a report type plus filter information for those
fields.
Report metadata
customDetailFormula Custom Detail Formula An array of objects that describes row-level formulas.
on page 214[]
205
Reference Describe
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row
limit filters on dashboards. Can be configured on a report for Top-N
reports. The Name and Value fields in dashboardSetting
are used as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For
example, West Coast and East Coast.
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.
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 can’t 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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
206
Reference Describe
reportFilters Filter details[] List of each custom filter in the report along with the field name, filter
operator, and filter value.
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.
207
Reference Describe
showGrandTotal Boolean Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report
data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering
(true) or not (false).
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
Chart
208
Reference Describe
summaries Array of strings Unique identities for summary or custom summary formula fields
in the report. For example:
• a!Amount represents the average for the Amount column.
• s!Amount represents the sum of the Amount column.
• 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.
Groupings down
sortOrder String Order in which data is sorted within a row grouping. Value can be:
• Asc for ascending order.
• Desc for descending order.
dateGranularity String Interval set on a date field that’s 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
209
Reference Describe
showChanges Boolean Indicates whether to display a change column for a given historical
column.
210
Reference Describe
Groupings across
sortOrder String Order in which data is sorted within a column grouping. Value can
be:
• Asc for ascending order.
• Desc for descending order.
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
filterType String Describes the type of value used to filter report data. Valid values
are:
• fieldToField—Filters report data by comparing values
of one field with the values of a second field.
• fieldValue—Filters report data by comparing values of a
field with a defined value.
• null—If null, the filterType defaults to fieldValue.
In this example, the first filter is a field-to-field filter that compares
the Amount field with Projected Amount field. The second filter is
a field filter that returns records for which a row-level formula
returns more than 0.
"reportFilters" : [ {
"column" : "AMOUNT",
"filterType" : "fieldToField",
"isRunPageEditable" : true,
"operator" : "notEqual",
211
Reference Describe
"value" : "PROJECTED_AMOUNT"
}, {
"column" : "CDF1",
"filterType" : "fieldValue",
"isRunPageEditable" : true,
"operator" : "greaterThan",
"value" : "0"
} ]
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. Valid values are:
• equals
• notEqual
• lessThan
• greaterThan
• lessOrEqual
• greaterOrEqual
• contains
• notContain
• startsWith
• includes
• excludes
• within (DISTANCE criteria only)
value String Value by which a field is filtered. For example, the field Age can
be filtered by a numeric value.
For datetime fields, if you make a POST request and specify a
calendar date without including a time, then a default time gets
included. The time defaults to midnight minus the difference
between your timezone and Greenwich Mean Time (GMT). For
example, if you specify 8/8/2015 and your timezone is Pacific
Standard Time (GMT-700), then the API returns
2015-08-08T07:00:00Z.
Bucket field
212
Reference Describe
nullTreatedAsZero Boolean Specifies whether null values are converted to zero (true) or not
(false).
otherBucketLabel String Name of the fields grouped as “Other” (in buckets of BucketType
PICKLIST).
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).
Cross filter
includesObject Boolean Specifies whether objects returned have a relationship with the
relatedEntity (true) or not (false).
primaryEntityField String The name of the object on which the cross filter is evaluated.
relatedEntityJoinField String The name of the field used to join the primaryEntityField
and relatedEntity.
213
Reference Describe
formula String Specifies the formula expression to be evaluated. All report type fields,
except bucketed fields and historical tracking fields can be referenced.
formulaType String Specifies the return type of the formula. Valid values include:
• date
• datetime
• number
• text
formulaType String The format of the numbers in the custom summary formula. Possible
values are number, currency, and percent.
downGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
acrossGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
formula String The operations performed on values in the custom summary formula.
Top rows
214
Reference Describe
dataTypeFilterOperatorMap Filter operator Lists all the possible field data types that can be used to filter
reference 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
type’s filter criteria. Use this API name in the metadata to
define filter criteria for a report.
label: Of type string, this is the display name for each filter
criteria available to fields of a particular data type. For example,
multipicklist fields can have for filter criteria, “equals,”
“not equal to,” “includes,” and “excludes.” Bucket fields are
considered to be of string data type.
divisionInfo Division info[] Default division and list of all possible record-level divisions
that can be used in a report.
objects Objects info[] List of objects included in report type. Available in API version
54.0 and later.
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.
215
Reference Describe
standardFilterInfos 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.
Categories
columns Column map Information for all fields in the report type organized under a
particular section’s unique API name.
Column map
bucketable Boolean Specifies whether a field can be used as the basis for a bucket
column (true) or not (false).
entityColumnName String Describes the relationship between an sObject and a report field
by returning the sObject and sObject field name that a report field
maps to.
The value returned is formatted as sObject.sObject
field. The property is part of an object that describes a report
field, such as an object in the columns[] array of a report type
object from reportTypeMetadata.
For example, on the LAST_UPDATE_BY column, the value of
entityColumnName is “User.Name”, which tells us that
it’s mapped to the Name field on the User sObject.
"reportTypeMetadata" : {
"categories" : [ {
216
Reference Describe
"columns" : {
"LAST_UPDATE_BY" : {
"allowedInCustomDetailFormula" :
true,
"bucketable" : true,
"dataType" : "string",
"entityColumnName" : "User.Name",
"fieldToFieldFilterable" : false,
"filterValues" : [ ],
"filterable" : true,
"inactiveFilterValues" : [ ],
"isCustom" : false,
"isLookup" : true,
"label" : "Last Modified By",
"maxLength" : null,
"uniqueCountable" : true
}
}
} ]
}
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
can’t 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.
filterable Boolean False means that the field is of a type that can’t be filtered. For
example, fields of the type Encrypted Text can’t be filtered.
maxLength Integer Indicates the maximum permited number of characters for the
value of a column field. If there is no limit, use null.
217
Reference Describe
dateGranularityInfos
Division Info
values String All division values. Division values have two properties:
label: Display name of a division.
name: Unique API name of a division.
Objects Info
joinType String Present for custom report types. Indicates how the object is joined.
Valid values are:
• ROOT—Primary object
• INNER—Inner join
• OUTER—Outer join
Scope Info
218
Reference Describe
standardDateFilterDurations Standard date filter Details about each possible relative date filter defined under
durations[] the standard date filter grouping.
label String Display name of a date filter. Valid date filters are relative date
filters—like Current FY and Current FQ—and custom
date filters.
value String API name of a date filter. Valid date filters are relative date
filters—like THIS_FISCAL_YEAR and
NEXT_FISCAL_QUARTER—and custom date filters.
detailColumnInfo Detail column Two properties for each field that has detailed data identified by its
information unique API name. The detailed data fields are also listed in the report
metadata.
219
Reference Describe
historicalColumnInfo Historical column Provides additional information on columns that exist only in historical
information trending reports. (This property is applicable only to historical trending
reports.)
dataType String Data type of the summarized or custom summary formula field.
acrossGroupingContext String Column grouping in the report where the custom summary formula
is displayed. As this example shows in the JSON response and in
the custom summary formula editor of the matrix report, the
custom summary formula is set at the grand summary level for the
columns.
{
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"FORMULA1" : {
"label" : "Stalled Oppty Avg",
"dataType" : "Percent",
"acrossGroupingContext" :
"GRAND_SUMMARY",
"downGroupingContext" :
"GRAND_SUMMARY"
},
}
}
}
downGroupingContext String Row grouping in the report where the custom summary formula
is displayed. In this example, the custom summary formula for a
summary report is displayed at the first grouping level This example
is shown in both the JSON response and in the custom summary
formula editor of the summary report.
220
Reference Describe
{
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
...},
"FORMULA1" : {
"label" : "Average Won",
"dataType" : "Number",
"acrossGroupingContext" : null,
"downGroupingContext" : "TYPE"
},
}
}
}
dataType String The data type of the field that has detailed data. Possible values
are:
• string
• boolean
• combobox
• currency
• date
• datetime
• double
• email
• html
• id
• int
• multipicklist
• number
• percent
221
Reference Describe
entityColumnName String Describes the relationship between an sObject and a report field
by returning the sObject and sObject field name that a report field
maps to.
The value returned is formatted as sObject.sObject
field. The property is part of an object that describes a report
field, such as an object in the columns[] array of a report type
object from reportTypeMetadata.
For example, on the LAST_UPDATE_BY column, the value of
entityColumnName is “User.Name”, which tells us that
it’s mapped to the Name field on the User sObject.
"reportTypeMetadata" : {
"categories" : [ {
"columns" : {
"LAST_UPDATE_BY" : {
"allowedInCustomDetailFormula" :
true,
"bucketable" : true,
"dataType" : "string",
"entityColumnName" : "User.Name",
"fieldToFieldFilterable" : false,
"filterValues" : [ ],
"filterable" : true,
"inactiveFilterValues" : [ ],
"isCustom" : false,
"isLookup" : true,
"label" : "Last Modified By",
"maxLength" : null,
"uniqueCountable" : true
}
}
} ]
}
222
Reference Describe
filterable Boolean False means that the field is of a type that can’t be filtered. For
example, fields of the type Encrypted Text can’t be filtered.
uniqueCountable Boolean Specifies whether a field supports unique count (true) or not
(false)
dataType String Data type of the field used for grouping. Possible values are:
• string
• boolean
• combobox
• currency
• date
• datetime
• double
• email
• html
• id
• int
• multipicklist
• number
• percent
• phone
• picklist
• reference
• text
223
Reference Execute Sync
historicalColumn String The specific historical column name. Example: The historical column
for Opportunity__hd.Amount__hst.N_DAYS_AGO:1
is Opportunity__hd.Amount__hst.
historicalSnapshotDate String The snapshot date for this historical column. Example: For the
historical column
Opportunity__hd.Amount__hst.N_DAYS_AGO:1,
the snapshot date is N_DAYS_AGO:1, which is one
day ago.
isHistoricalChange Boolean True if the column represents change between two historical
columns.
SEE ALSO:
Execute Sync
Execute Async
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.
224
Reference Execute Sync
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>
Formats
JSON
HTTP Methods
Method Description
GET Get report results. See this example.
POST Get specific results by passing dynamic filters, groupings, and aggregates in the report metadata. See this example.
allowedInCustomDetailFormula Boolean Specifies whether a field can be referenced in a row-level formula (true)
or not (false).
customDetailFormula Custom Detail Formula An array of objects that describes row-level formulas.
on page 214[]
225
Reference Execute Sync
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.
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row limit
filters on dashboards. Can be configured on a report for Top-N reports.
The Name and Value fields in dashboardSetting are used
as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For example,
West Coast and East Coast.
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.
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 can’t 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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
226
Reference Execute Sync
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.
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.
227
Reference Execute Sync
showGrandTotal Boolean Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering (true)
or not (false).
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
Response Body
Property Type Description
attributes Attributes Key report attributes and child resource URLs.
228
Reference Execute Sync
Note: For reports that have too many records, use filters to
refine results.
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 Collection of column groupings, keys, and their values.
groupingsDown Groupings down Collection of row groupings, keys, and their values.
hasDetailRows Boolean When true,the fact map returns values for both summary level
and record level data.
When false, the fact map returns summary values.
reportExtendedMetadata Report extended Additional information about columns, summaries, and groupings.
metadata
Attributes
instancesUrl String Resource URL to run a report asynchronously. The report can be
run with or without filters to get summary or both summary and
detailed data. Results of each instance of the report run are stored
under this URL.
229
Reference Execute Sync
Fact map
aggregates Aggregates[] Summary level data including record count for a report.
Data cells
label String Display name of the value as it appears for a specified cell in the
report.
Aggregates
Groupings across
Groupings
230
Reference Execute Async
key String Unique identity for a row or column grouping. The identity is used
by the fact map to specify data values within each grouping.
label String Display name of a row or column grouping. For date and time
fields, the label is the localized date or time.
groupings Array Second or third level row or column groupings. If there are none,
the value is an empty array.
dategroupings Array Start date and end date of the interval defined by date
granularity.
Groupings down
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
231
Reference Execute Async
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.
allowedInCustomDetailFormula Boolean Specifies whether a field can be referenced in a row-level formula (true)
or not (false).
customDetailFormula Custom Detail Formula An array of objects that describes row-level formulas.
on page 214[]
232
Reference Execute Async
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row limit
filters on dashboards. Can be configured on a report for Top-N reports.
The Name and Value fields in dashboardSetting are used
as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For example,
West Coast and East Coast.
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.
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 can’t 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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
233
Reference Execute Async
reportFilters Filter details[] List of each custom filter in the report along with the field name, filter
operator, and filter value.
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,
234
Reference Execute Async
showGrandTotal Boolean Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering (true)
or not (false).
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
Response Body
Property Type Description
id String Unique ID for an instance of a report that was run asynchronously.
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.
235
Reference Instances List
url String URL where results of the report run for that instance are stored. The value is null if the
report couldn’t be run because of an error.
ownerId String API name of the user that created the instance.
completionDate Date, time Date, time when the instance of the report run finished. Only available if the report instance
string ran successfully or couldn’t 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 Date and time when an instance of the report run was requested. Date-time information
string 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 Return a list of asynchronous runs of a report. See this example.
236
Reference Instance Results
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.
• 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 couldn’t be run because of an error.
ownerId String API name of the user that created the instance.
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 string Date, time when the instance of the report run finished. Only available if the
report instance ran successfully or couldn’t be run because of an error. Date-time
information is in ISO-8601 format.
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:
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>
237
Reference Instance Results
Formats
JSON
HTTP Methods
Method Description
GET Retrieves results of an asynchronous report run. See this example.
DELETE If the given report instance has a status of Success or Error, delete the report instance and return an empty
response body.
reportMetadata Report metadata Information about the fields used to build the report.
factMap Fact map Collection of summary level data or both detailed and summary level data.
reportExtendedMetadata Report extended Information on report groupings, summary fields, and detailed data columns,
metadata which is available if detailed data is requested.
Attributes
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.
238
Reference Report List
completionDate Date, time string Date, time when the instance of the report run finished. Only available if
the report instance ran successfully or couldn’t be run because of an error.
Date-time information is in ISO-8601 format.
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:
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 URL
List reports
/services/data/<latest API version>/analytics/reports
Copy report
/services/data/<latest API version>/analytics/reports?cloneId=<report ID>
Formats
JSON
HTTP Methods
Method Description
GET List of reports that were recently viewed by the API user. See this example.
239
Reference Report List
Method Description
To clone an existing report, see this example.
instancesUrl String Information for each instance of the report that was run asynchronously.
allowedInCustomDetailFormula Boolean Specifies whether a field can be referenced in a row-level formula (true)
or not (false).
240
Reference Report List
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.
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row limit
filters on dashboards. Can be configured on a report for Top-N reports.
The Name and Value fields in dashboardSetting are used
as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For example,
West Coast and East Coast.
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.
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 can’t 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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
241
Reference Report List
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.
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.
242
Reference Query
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 Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering (true)
or not (false).
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
Query
Returns report data without saving changes to an existing report or creating a new one.
243
Reference Query
Resource URL
/services/data/<latest API version>/analytics/reports/query
Formats
JSON
HTTP Methods
Method Description
POST Run a report without creating or saving the report. Customize your report using reportMetadata that you specify
in the request body. See this example on page 60.
Request Body
Report metadata
244
Reference Query
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.
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row
limit filters on dashboards. Can be configured on a report for Top-N
reports. The Name and Value fields in dashboardSetting
are used as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For
example, West Coast and East Coast.
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.
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 can’t 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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
245
Reference Query
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.
246
Reference Query
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 Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report
data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
supportsRoleHierarchy Boolean Indicates whether the report type supports role hierarchy filtering
(true) or not (false).
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
247
Reference Query
Chart
summaries Array of strings Unique identities for summary or custom summary formula fields
in the report. For example:
• a!Amount represents the average for the Amount column.
• s!Amount represents the sum of the Amount column.
• 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.
Groupings down
sortOrder String Order in which data is sorted within a row grouping. Value can be:
• Asc for ascending order.
• Desc for descending order.
dateGranularity String Interval set on a date field that’s used as a row grouping. Value can
be:
• Day
• Calendar Week
• Calendar Month
• Calendar Quarter
• Calendar Year
• Fiscal Quarter
• Fiscal Year
248
Reference Query
sortAggregate String Summary field that’s used to sort data within a grouping in a report
that’s in summary format. Applies if you have the Aggregate Sort
feature enabled as part of its pilot program. The value is null when
data within a grouping is not sorted by a summary field. In this
example, data grouped by Account Owner is sorted by the sum of
Annual Revenue.
{
"aggregates": ["s!SALES","RowCount"],
"groupingsDown": [
{
"name": "USERS.NAME",
"sortOrder": "Desc",
"dateGranularity": "None",
"sortAggregate": "s!SALES"
}
]
}
249
Reference Query
showChanges Boolean Indicates whether to display a change column for a given historical
column.
Groupings across
sortOrder String Order in which data is sorted within a column grouping. Value can
be:
• Asc for ascending order.
• Desc for descending order.
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
filterType String Describes the type of value used to filter report data. Valid values
are:
• fieldToField—Filters report data by comparing values
of one field with the values of a second field.
• fieldValue—Filters report data by comparing values of a
field with a defined value.
250
Reference Query
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. Valid values are:
• equals
• notEqual
• lessThan
• greaterThan
• lessOrEqual
• greaterOrEqual
• contains
• notContain
• startsWith
• includes
• excludes
• within (DISTANCE criteria only)
value String Value by which a field is filtered. For example, the field Age can
be filtered by a numeric value.
For datetime fields, if you make a POST request and specify a
calendar date without including a time, then a default time gets
included. The time defaults to midnight minus the difference
between your timezone and Greenwich Mean Time (GMT). For
example, if you specify 8/8/2015 and your timezone is Pacific
251
Reference Query
Bucket field
nullTreatedAsZero Boolean Specifies whether null values are converted to zero (true) or not
(false).
otherBucketLabel String Name of the fields grouped as “Other” (in buckets of BucketType
PICKLIST).
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).
Cross filter
includesObject Boolean Specifies whether objects returned have a relationship with the
relatedEntity (true) or not (false).
primaryEntityField String The name of the object on which the cross filter is evaluated.
252
Reference Query
relatedEntityJoinField String The name of the field used to join the primaryEntityField
and relatedEntity.
formula String Specifies the formula expression to be evaluated. All report type fields,
except bucketed fields and historical tracking fields can be referenced.
formulaType String Specifies the return type of the formula. Valid values include:
• date
• datetime
• number
• text
formulaType String The format of the numbers in the custom summary formula. Possible
values are number, currency, and percent.
downGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
acrossGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
253
Reference Query
Top rows
Response Body
Property Type Description
attributes Attributes Key report attributes and child resource URLs.
Note: For reports that have too many records, use filters to
refine results.
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 Collection of column groupings, keys, and their values.
groupingsDown Groupings down Collection of row groupings, keys, and their values.
hasDetailRows Boolean When true,the fact map returns values for both summary level
and record level data.
When false, the fact map returns summary values.
reportExtendedMetadata Report extended Additional information about columns, summaries, and groupings.
metadata
254
Reference Query
Attributes
instancesUrl String Resource URL to run a report asynchronously. The report can be
run with or without filters to get summary or both summary and
detailed data. Results of each instance of the report run are stored
under this URL.
Fact map
aggregates Aggregates[] Summary level data including record count for a report.
Data cells
label String Display name of the value as it appears for a specified cell in the
report.
Aggregates
255
Reference Query
Groupings across
Groupings
key String Unique identity for a row or column grouping. The identity is used
by the fact map to specify data values within each grouping.
label String Display name of a row or column grouping. For date and time
fields, the label is the localized date or time.
groupings Array Second or third level row or column groupings. If there are none,
the value is an empty array.
dategroupings Array Start date and end date of the interval defined by date
granularity.
256
Reference Report Fields
Groupings down
Report Fields
The Report Fields resource returns report fields available for specified reports. Use the resource to determine the best fields for use in
dashboard filters by seeing which fields different source reports have in common. Available in API version 40.0 and later.
Resource URL
/services/data/<latest API version>/analytics/reports/<report ID>/fields
Formats
JSON
HTTP Methods
Method Description
POST If the request body is empty, returns a list of all possible report fields. Otherwise, returns a list of fields that specified
reports share.
equivalentFields Array of Fields Fields available for each specified report. Each object in this array is a list of
common fields categorized by report type.
equivalentFieldIndices Map of Fields Map of each field’s API name to the index of the field in the
equivalentFields array.
257
Reference Report Fields
258
Reference Report Fields
259
Reference Report Fields
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Activity",
"maxLength" : null
},
"LAST_UPDATE_BY_ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : true,
"label" : "Last Modified Alias",
"maxLength" : 8
},
"LAST_UPDATE_BY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Modified By",
"maxLength" : null
},
"LAST_UPDATE" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Modified Date",
"maxLength" : null
},
"LAST_STAGE_CHANGE_DATE" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Stage Change Date",
"maxLength" : null
}
},
"label" : "Opportunity Information",
"labelSuffix" : "(Opportunities)"
}, {
"columns" : {
"FULL_NAME" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Opportunity Owner",
"maxLength" : null
},
"OWNER_MANAGER" : {
"dataType" : "string",
"filterValues" : [ ],
260
Reference Report Fields
"filterable" : true,
"isLookup" : false,
"label" : "Opportunity Owner: Manager",
"maxLength" : null
},
"ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : true,
"label" : "Opportunity Owner Alias",
"maxLength" : 8
},
"ROLLUP_DESCRIPTION" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : true,
"label" : "Owner Role",
"maxLength" : 80
}
},
"label" : "Opportunity Owner Information",
"labelSuffix" : "(Opportunities)"
} ],
"LeadList" : [ {
"columns" : {
"EMAIL_BOUNCED_DATE" : {
"dataType" : "datetime",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Email Bounced Date",
"maxLength" : null
}
},
"label" : "Lead: Ph/Fax/Email",
"labelSuffix" : "(Leads)"
}, {
"columns" : {
"CREATED_ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : true,
"label" : "Created Alias",
"maxLength" : 8
},
"CREATED_DATE" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Create Date",
261
Reference Report Fields
"maxLength" : null
},
"CREATED" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Created By",
"maxLength" : null
},
"CREATED_MONTH" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Created Month",
"maxLength" : null
},
"LAST_ACTIVITY" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Activity",
"maxLength" : null
},
"LAST_UPDATE" : {
"dataType" : "date",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Modified",
"maxLength" : null
},
"LAST_UPDATE_BY_ALIAS" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : true,
"label" : "Last Modified Alias",
"maxLength" : 8
},
"LAST_UPDATE_BY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
"isLookup" : false,
"label" : "Last Modified By",
"maxLength" : null
},
"OWNER_ROLE_DISPLAY" : {
"dataType" : "string",
"filterValues" : [ ],
"filterable" : true,
262
Reference Report Fields
"isLookup" : true,
"label" : "Owner Role Display",
"maxLength" : 80
}
},
"label" : "Lead General",
"labelSuffix" : "(Leads)"
} ]
},
"equivalentFieldIndices" : {
"ACCOUNT_CREATED_DATE" : 19,
"ACCOUNT_LAST_UPDATE" : 19,
"ACCOUNT_OWNER" : 15,
"CREATED_ALIAS" : 16,
"CREATED_DATE" : 19,
"LAST_UPDATE_BY_ALIAS" : 16,
"ALIAS" : 16,
"EMAIL_BOUNCED_DATE" : 19,
"CLOSE_MONTH" : 17,
"LAST_UPDATE_BY" : 15,
"CREATED_MONTH" : 17,
"LAST_ACTIVITY" : 17,
"ACCOUNT_LAST_ACTIVITY" : 17,
"CLOSE_DATE" : 17,
"CREATED" : 15,
"LAST_UPDATE" : 19,
"CLOSE_DATE2" : 17,
"OWNER_MANAGER" : 15,
"LAST_STAGE_CHANGE_DATE" : 19,
"ROLLUP_DESCRIPTION" : 7,
"FULL_NAME" : 15,
"ACCOUNT_OWNER_ALIAS" : 16,
"OWNER_ROLE_DISPLAY" : 7
},
"equivalentFields" : [ {
"LeadList" : [ {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
} ],
"Opportunity" : [ {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
}, {
"name" : "FULL_NAME"
}, {
"name" : "OWNER_MANAGER"
}, {
"name" : "ACCOUNT_OWNER"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_ALIAS"
263
Reference Report Fields
}, {
"name" : "LAST_UPDATE_BY_ALIAS"
} ],
"Opportunity" : [ {
"name" : "CREATED_ALIAS"
}, {
"name" : "LAST_UPDATE_BY_ALIAS"
}, {
"name" : "ALIAS"
}, {
"name" : "ACCOUNT_OWNER_ALIAS"
} ]
}, {
"LeadList" : [ {
"name" : "LAST_UPDATE_BY"
}, {
"name" : "CREATED"
} ],
"Opportunity" : [ {
"name" : "LAST_UPDATE_BY"
}, {
"name" : "CREATED"
}, {
"name" : "FULL_NAME"
}, {
"name" : "OWNER_MANAGER"
}, {
"name" : "ACCOUNT_OWNER"
} ]
}, {
"LeadList" : [ {
"name" : "LAST_UPDATE_BY_ALIAS"
}, {
"name" : "CREATED_ALIAS"
} ],
"Opportunity" : [ {
"name" : "LAST_UPDATE_BY_ALIAS"
}, {
"name" : "CREATED_ALIAS"
}, {
"name" : "ALIAS"
}, {
"name" : "ACCOUNT_OWNER_ALIAS"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "EMAIL_BOUNCED_DATE"
} ],
"Opportunity" : [ {
"name" : "CREATED_DATE"
264
Reference Report Fields
}, {
"name" : "LAST_STAGE_CHANGE_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "ACCOUNT_CREATED_DATE"
}, {
"name" : "ACCOUNT_LAST_UPDATE"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_MONTH"
}, {
"name" : "LAST_ACTIVITY"
} ],
"Opportunity" : [ {
"name" : "CLOSE_DATE"
}, {
"name" : "CLOSE_DATE2"
}, {
"name" : "CLOSE_MONTH"
}, {
"name" : "LAST_ACTIVITY"
}, {
"name" : "ACCOUNT_LAST_ACTIVITY"
} ]
}, {
"LeadList" : [ {
"name" : "LAST_UPDATE"
}, {
"name" : "CREATED_DATE"
}, {
"name" : "EMAIL_BOUNCED_DATE"
} ],
"Opportunity" : [ {
"name" : "LAST_UPDATE"
}, {
"name" : "LAST_STAGE_CHANGE_DATE"
}, {
"name" : "CREATED_DATE"
}, {
"name" : "ACCOUNT_CREATED_DATE"
}, {
"name" : "ACCOUNT_LAST_UPDATE"
} ]
}, {
"LeadList" : [ {
"name" : "OWNER_ROLE_DISPLAY"
} ],
"Opportunity" : [ {
"name" : "ROLLUP_DESCRIPTION"
} ]
}, {
"LeadList" : [ {
265
Reference Report Fields
"name" : "LAST_ACTIVITY"
}, {
"name" : "CREATED_MONTH"
} ],
"Opportunity" : [ {
"name" : "LAST_ACTIVITY"
}, {
"name" : "CLOSE_DATE"
}, {
"name" : "CLOSE_DATE2"
}, {
"name" : "CLOSE_MONTH"
}, {
"name" : "ACCOUNT_LAST_ACTIVITY"
} ]
}, {
"LeadList" : [ {
"name" : "EMAIL_BOUNCED_DATE"
}, {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
} ],
"Opportunity" : [ {
"name" : "LAST_STAGE_CHANGE_DATE"
}, {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "ACCOUNT_CREATED_DATE"
}, {
"name" : "ACCOUNT_LAST_UPDATE"
} ]
}, {
"LeadList" : [ {
"name" : "LAST_ACTIVITY"
}, {
"name" : "CREATED_MONTH"
} ],
"Opportunity" : [ {
"name" : "CLOSE_DATE2"
}, {
"name" : "CLOSE_DATE"
}, {
"name" : "CLOSE_MONTH"
}, {
"name" : "LAST_ACTIVITY"
}, {
"name" : "ACCOUNT_LAST_ACTIVITY"
} ]
}, {
"LeadList" : [ {
"name" : "LAST_ACTIVITY"
266
Reference Report Fields
}, {
"name" : "CREATED_MONTH"
} ],
"Opportunity" : [ {
"name" : "CLOSE_MONTH"
}, {
"name" : "CLOSE_DATE"
}, {
"name" : "CLOSE_DATE2"
}, {
"name" : "LAST_ACTIVITY"
}, {
"name" : "ACCOUNT_LAST_ACTIVITY"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
} ],
"Opportunity" : [ {
"name" : "FULL_NAME"
}, {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
}, {
"name" : "OWNER_MANAGER"
}, {
"name" : "ACCOUNT_OWNER"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_ALIAS"
}, {
"name" : "LAST_UPDATE_BY_ALIAS"
} ],
"Opportunity" : [ {
"name" : "ALIAS"
}, {
"name" : "CREATED_ALIAS"
}, {
"name" : "LAST_UPDATE_BY_ALIAS"
}, {
"name" : "ACCOUNT_OWNER_ALIAS"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
} ],
"Opportunity" : [ {
"name" : "OWNER_MANAGER"
267
Reference Report Fields
}, {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
}, {
"name" : "FULL_NAME"
}, {
"name" : "ACCOUNT_OWNER"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
} ],
"Opportunity" : [ {
"name" : "ACCOUNT_OWNER"
}, {
"name" : "CREATED"
}, {
"name" : "LAST_UPDATE_BY"
}, {
"name" : "FULL_NAME"
}, {
"name" : "OWNER_MANAGER"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_ALIAS"
}, {
"name" : "LAST_UPDATE_BY_ALIAS"
} ],
"Opportunity" : [ {
"name" : "ACCOUNT_OWNER_ALIAS"
}, {
"name" : "CREATED_ALIAS"
}, {
"name" : "LAST_UPDATE_BY_ALIAS"
}, {
"name" : "ALIAS"
} ]
}, {
"LeadList" : [ {
"name" : "LAST_ACTIVITY"
}, {
"name" : "CREATED_MONTH"
} ],
"Opportunity" : [ {
"name" : "ACCOUNT_LAST_ACTIVITY"
}, {
"name" : "CLOSE_DATE"
}, {
"name" : "CLOSE_DATE2"
}, {
268
Reference Report Error Codes
"name" : "CLOSE_MONTH"
}, {
"name" : "LAST_ACTIVITY"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "EMAIL_BOUNCED_DATE"
} ],
"Opportunity" : [ {
"name" : "ACCOUNT_CREATED_DATE"
}, {
"name" : "LAST_STAGE_CHANGE_DATE"
}, {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "ACCOUNT_LAST_UPDATE"
} ]
}, {
"LeadList" : [ {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "EMAIL_BOUNCED_DATE"
} ],
"Opportunity" : [ {
"name" : "ACCOUNT_LAST_UPDATE"
}, {
"name" : "LAST_STAGE_CHANGE_DATE"
}, {
"name" : "CREATED_DATE"
}, {
"name" : "LAST_UPDATE"
}, {
"name" : "ACCOUNT_CREATED_DATE"
} ]
} ],
"mergedGroups" : { }
}
269
Reference Report Error Codes
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 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 Can’t run the report because it doesn’t 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.
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 Filter the date in the correct format. Accepted formats are yyyy-MM-dd'T'HH:mm:ss'Z' and yyyy-MM-dd.
400 The request is invalid because there is no metadata. Specify metadata in the request body.
403 The report can't be deleted because there are one or more dashboards referencing it.
403 You don't have permission to create reports in the given folder.
270
Reference Report Types
403 The report definition is obsolete. Your administrator has disabled all reports for the custom object, or its relationships
have changed.
403 You don’t have permission to run reports. Check that you have the Run Reports user permission.
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.
410 The requested resource has been retired or removed. Delete or update any references to the resource.
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 report’s metadata. Try to re-submit your query.
500 We ran into an error when running this report. Try to re-submit your query.
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.
501 Historical trend data is unavailable in the report format requested. Change the report format to matrix and try again.
Report Types
Use the Report Types API to get information about what report types are available in your org. The Report Types API is available in API
version 39.0 and later.
Resources for the Report Types API are available at /services/data/<latest API
version>/analytics/report-types. You can query each resource with an HTTP method.
271
Reference Report Type List
Note: You can use either report-types or reportTypes when referring to a report type resource. The two are equivalent.
Hide and Unhide Report Types PATCH Sets the hidden parameter to
/services/data/<latest API true or false for a specific
version>/analytics/reports/show-hide-report_type report type.
272
Reference Report Type
Syntax
URI
/services/data/vXX.X/analytics/report-types
Formats
JSON
HTTP methods
Method Description
GET Returns a list of report types.
report-types[]
An array of report type objects. Each object contains the following fields:
isHidden Boolean Indicates whether an administrator has hidden the report type (true) or
not (false). Hidden report types don’t appear in the report builder when
creating a report.
isHistorical Boolean Optional. true for historical tracking report types. If this property is missing,
the value is assumed to be false.
label String The end user-facing name of the report type in the report builder.
supportsJoinedFormat Boolean Specifies whether a report type is compatible with joined reports (true) or
not (false).
Report Type
Return metadata about a report type.
273
Reference Report Type
Syntax
URI
/services/data/vXX.X/analytics/reportTypes/type
Formats
JSON
HTTP methods
Method Description
GET Return metadata about a report type
reportTypeMetadata Report type metadata Fields in each section of a report type plus filter information for those
fields.
detailColumnInfo Detail column Two properties for each field that has detailed data identified by its
information unique API name. The detailed data fields are also listed in the report
metadata.
groupingColumnInfo Grouping column Map of each row or column grouping to its metadata. Contains values
information for each grouping identified in the groupingsDown and
groupingsAcross list.
historicalColumnInfo Historical column Provides additional information on columns that exist only in historical
information trending reports. (This property is applicable only to historical trending
reports.)
274
Reference Report Type
dataType String Data type of the summarized or custom summary formula field.
acrossGroupingContext String Column grouping in the report where the custom summary formula
is displayed. As this example shows in the JSON response and in
the custom summary formula editor of the matrix report, the
custom summary formula is set at the grand summary level for the
columns.
{
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
"FORMULA1" : {
"label" : "Stalled Oppty Avg",
"dataType" : "Percent",
"acrossGroupingContext" :
"GRAND_SUMMARY",
"downGroupingContext" :
"GRAND_SUMMARY"
},
}
}
}
downGroupingContext String Row grouping in the report where the custom summary formula
is displayed. In this example, the custom summary formula for a
summary report is displayed at the first grouping level This example
is shown in both the JSON response and in the custom summary
formula editor of the summary report.
{
"reportExtendedMetadata" : {
"aggregateColumnInfo" : {
...},
"FORMULA1" : {
"label" : "Average Won",
"dataType" : "Number",
"acrossGroupingContext" : null,
"downGroupingContext" : "TYPE"
275
Reference Report Type
},
}
}
}
dataType String The data type of the field that has detailed data. Possible values
are:
• string
• boolean
• combobox
• currency
• date
• datetime
• double
• email
• html
• id
• int
• multipicklist
• number
• percent
• phone
• picklist
• reference
• text
• textarea
• time
• url
276
Reference Report Type
"fieldToFieldFilterable" : false,
"filterValues" : [ ],
"filterable" : true,
"inactiveFilterValues" : [ ],
"isCustom" : false,
"isLookup" : true,
"label" : "Last Modified By",
"maxLength" : null,
"uniqueCountable" : true
}
}
} ]
}
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
can’t 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.
277
Reference Report Type
uniqueCountable Boolean Specifies whether a field supports unique count (true) or not
(false)
dataType String Data type of the field used for grouping. Possible values are:
• string
• boolean
• combobox
• currency
• date
• datetime
• double
• email
• html
• id
• int
• multipicklist
• number
• percent
• phone
• picklist
• reference
• text
• textarea
• time
• url
278
Reference Report Type
historicalColumn String The specific historical column name. Example: The historical column
for Opportunity__hd.Amount__hst.N_DAYS_AGO:1
is Opportunity__hd.Amount__hst.
historicalSnapshotDate String The snapshot date for this historical column. Example: For the
historical column
Opportunity__hd.Amount__hst.N_DAYS_AGO:1,
the snapshot date is N_DAYS_AGO:1, which is one
day ago.
isHistoricalChange Boolean True if the column represents change between two historical
columns.
Report metadata
279
Reference Report Type
customDetailFormula Custom Detail Formula An array of objects that describes row-level formulas.
on page 288[]
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.
dashboardSetting Name/value pair Allows saving of dashboard settings to allow for reports with row
limit filters on dashboards. Can be configured on a report for Top-N
reports. The Name and Value fields in dashboardSetting
are used as Grouping and Aggregate in dashboard components.
detailColumns Array of strings Unique API names for the fields that have detailed data.
division String Determines the division of records to include in the report. For
example, West Coast and East Coast.
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.
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 can’t have
column groupings.
• BucketField_(ID) for bucket fields.
280
Reference Report Type
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 Indicates whether to include detailed data with the summary data.
hasRecordCount Boolean Indicates whether the report shows the record count.
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"
}
]
}
}
281
Reference Report Type
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 Indicates whether the report shows the grand total.
showSubtotals Boolean Indicates whether the report shows subtotals, such as column or row
totals.
sortBy Array of strings API name of the field on which the report is sorted and the direction
of the sort (asc or desc).
Example:
"sortBy":[{"sortColumn":"Account_ID","sortOrder":"Asc"}]
standardDateFilter Array of strings Standard date filters available in reports. Each standard date filter
contains the following properties:
column: API name of the date field on which you filter the report
data.
durationValue: The range for which you want to run the report.
The value is a date literal or 'CUSTOM.'
startDate: Start date.
endDate: End date.
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.
282
Reference Report Type
topRows Top rows Describes a row limit filter applied to the report.
userOrHierarchyFilterId String Unique user or role ID of the user or role used by the report's role
hierarchy filter.
If specified, a role hierarchy filter is applied to the report. If unspecified,
no role hierarchy filter is applied to the report.
Chart
summaries Array of strings Unique identities for summary or custom summary formula fields
in the report. For example:
• a!Amount represents the average for the Amount column.
• s!Amount represents the sum of the Amount column.
• 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.
Groupings down
sortOrder String Order in which data is sorted within a row grouping. Value can be:
• Asc for ascending order.
283
Reference Report Type
dateGranularity String Interval set on a date field that’s 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 Summary field that’s used to sort data within a grouping in a report
that’s in summary format. Applies if you have the Aggregate Sort
feature enabled as part of its pilot program. The value is null when
data within a grouping is not sorted by a summary field. In this
example, data grouped by Account Owner is sorted by the sum of
Annual Revenue.
{
"aggregates": ["s!SALES","RowCount"],
"groupingsDown": [
{
"name": "USERS.NAME",
"sortOrder": "Desc",
"dateGranularity": "None",
"sortAggregate": "s!SALES"
}
]
}
284
Reference Report Type
"Opportunity__hd.Amount__hst" : {
"decreaseIsPositive" : false,
"showChanges" : true
}
}
}
showChanges Boolean Indicates whether to display a change column for a given historical
column.
Groupings across
sortOrder String Order in which data is sorted within a column grouping. Value can
be:
• Asc for ascending order.
• Desc for descending order.
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
285
Reference Report Type
Filter details
filterType String Describes the type of value used to filter report data. Valid values
are:
• fieldToField—Filters report data by comparing values
of one field with the values of a second field.
• fieldValue—Filters report data by comparing values of a
field with a defined value.
• null—If null, the filterType defaults to fieldValue.
In this example, the first filter is a field-to-field filter that compares
the Amount field with Projected Amount field. The second filter is
a field filter that returns records for which a row-level formula
returns more than 0.
"reportFilters" : [ {
"column" : "AMOUNT",
"filterType" : "fieldToField",
"isRunPageEditable" : true,
"operator" : "notEqual",
"value" : "PROJECTED_AMOUNT"
}, {
"column" : "CDF1",
"filterType" : "fieldValue",
"isRunPageEditable" : true,
"operator" : "greaterThan",
"value" : "0"
} ]
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. Valid values are:
• equals
• notEqual
• lessThan
• greaterThan
• lessOrEqual
• greaterOrEqual
• contains
• notContain
• startsWith
• includes
• excludes
286
Reference Report Type
value String Value by which a field is filtered. For example, the field Age can
be filtered by a numeric value.
For datetime fields, if you make a POST request and specify a
calendar date without including a time, then a default time gets
included. The time defaults to midnight minus the difference
between your timezone and Greenwich Mean Time (GMT). For
example, if you specify 8/8/2015 and your timezone is Pacific
Standard Time (GMT-700), then the API returns
2015-08-08T07:00:00Z.
Bucket field
nullTreatedAsZero Boolean Specifies whether null values are converted to zero (true) or not
(false).
otherBucketLabel String Name of the fields grouped as “Other” (in buckets of BucketType
PICKLIST).
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).
287
Reference Report Type
Cross filter
includesObject Boolean Specifies whether objects returned have a relationship with the
relatedEntity (true) or not (false).
primaryEntityField String The name of the object on which the cross filter is evaluated.
relatedEntityJoinField String The name of the field used to join the primaryEntityField
and relatedEntity.
formula String Specifies the formula expression to be evaluated. All report type fields,
except bucketed fields and historical tracking fields can be referenced.
formulaType String Specifies the return type of the formula. Valid values include:
• date
• datetime
• number
• text
formulaType String The format of the numbers in the custom summary formula. Possible
values are number, currency, and percent.
288
Reference Report Type
downGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
acrossGroupType String Where to display the aggregate of the custom summary formula.
Possible values are all, custom, and grand_total.
formula String The operations performed on values in the custom summary formula.
Top rows
dataTypeFilterOperatorMap Filter operator Lists all the possible field data types that can be used to filter
reference 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
type’s filter criteria. Use this API name in the metadata to
define filter criteria for a report.
289
Reference Report Type
divisionInfo Division info[] Default division and list of all possible record-level divisions
that can be used in a report.
objects Objects info[] List of objects included in report type. Available in API version
54.0 and later.
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[]
standardFilterInfos 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.
Categories
columns Column map Information for all fields in the report type organized under a
particular section’s unique API name.
290
Reference Report Type
Column map
bucketable Boolean Specifies whether a field can be used as the basis for a bucket
column (true) or not (false).
entityColumnName String Describes the relationship between an sObject and a report field
by returning the sObject and sObject field name that a report field
maps to.
The value returned is formatted as sObject.sObject
field. The property is part of an object that describes a report
field, such as an object in the columns[] array of a report type
object from reportTypeMetadata.
For example, on the LAST_UPDATE_BY column, the value of
entityColumnName is “User.Name”, which tells us that
it’s mapped to the Name field on the User sObject.
"reportTypeMetadata" : {
"categories" : [ {
"columns" : {
"LAST_UPDATE_BY" : {
"allowedInCustomDetailFormula" :
true,
"bucketable" : true,
"dataType" : "string",
"entityColumnName" : "User.Name",
"fieldToFieldFilterable" : false,
"filterValues" : [ ],
"filterable" : true,
"inactiveFilterValues" : [ ],
"isCustom" : false,
"isLookup" : true,
"label" : "Last Modified By",
"maxLength" : null,
"uniqueCountable" : true
}
}
} ]
}
291
Reference Report Type
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
can’t 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.
filterable Boolean False means that the field is of a type that can’t be filtered. For
example, fields of the type Encrypted Text can’t be filtered.
maxLength Integer Indicates the maximum permited number of characters for the
value of a column field. If there is no limit, use null.
uniqueCountable Boolean Specifies whether a field supports unique count (true) or not
(false)
dateGranularityInfos
Division Info
values String All division values. Division values have two properties:
label: Display name of a division.
name: Unique API name of a division.
292
Reference Report Type
Objects Info
joinType String Present for custom report types. Indicates how the object is joined.
Valid values are:
• ROOT—Primary object
• INNER—Inner join
• OUTER—Outer join
Scope Info
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.
standardDateFilterDurations Standard date filter Details about each possible relative date filter defined under
durations[] the standard date filter grouping.
293
Reference Recently Used Report Types
value String API name of a date filter. Valid date filters are relative date
filters—like THIS_FISCAL_YEAR and
NEXT_FISCAL_QUARTER—and custom date filters.
Syntax
URI
/services/data/<latest API version>/analytics/report-types/recent/by-user
Formats
JSON
HTTP Methods
Method Description
GET Returns a list of report types used by reports recently created by the current user.
Property Description
describeUrl A URL link to the report type’s metadata.
isHidden Indicates whether an administrator has hidden the report type (true) or not (false). Hidden report
types don’t appear in the report builder when creating a report.
isHistorical Indicates whether it’s a historical tracking report type (true) or not (false).
supportsJoinedFormat Indicates whether a report type is compatible with joined reports (true) or not (false).
294
Reference Recently Created Reports
Example:
Sample Request
analytics/report-types/AccountList/recent-reports?pageSize=3&isCurrentUser=true&offset=3
Sample Response
[
{
"createdByUser" : "Admin User",
"createdDate" : "2021-11-03T17:31:53.000+0000",
"id" : "00Oxx0000011ghvEAA",
"name" : "New Accounts Report1"
},
{
"createdByUser" : "Admin User",
"createdDate" : "2021-10-19T17:20:44.000+0000",
"id" : "00Oxx0000011gLVEAY",
"name" : "Sample Report: # of Accounts"
}
]
Syntax
URI
/services/data/<latest API
version>/analytics/report-types/<report-type-API-name>/recent-reports
Formats
JSON
HTTP Methods
Method Description
GET Returns a list of recently created reports for a specific report type.
Parameters
Parameter Description
pageSize Integer
Required for GET calls. Specifies number of recently created reports to return.
isCurrentUser Boolean
Optional for GET calls. Specifies if results are limited to current user (true) or all other users (false).
Default value is false.
295
Reference Hide and Unhide Report Types
Parameter Description
offset Integer
Optional for GET calls. Specifies offset of returned report list. Default value is 0.
Property Description
createdByUser Name of user who created report.
id Id of report.
Example:
Sample Request
analytics/report-types/AccountList/recent-reports?pageSize=3&isCurrentUser=true&offset=3
Sample Response
[
{
"createdByUser" : "Admin User",
"createdDate" : "2021-11-03T17:31:53.000+0000",
"id" : "00Oxx0000011ghvEAA",
"name" : "New Accounts Report1"
},
{
"createdByUser" : "Admin User",
"createdDate" : "2021-10-19T17:20:44.000+0000",
"id" : "00Oxx0000011gLVEAY",
"name" : "Sample Report: # of Accounts"
}
]
Syntax
URI
/services/data/<latest API version>/analytics/reports/show-hide-report_type
296
Reference Hide and Unhide Report Types
Formats
JSON
HTTP Methods
Method Description
PATCH Sets the hidden parameter to true or false for a specific report type.
Parameters
Parameter Description
templateId Required for PATCH calls. Specifies report type API name.
hidden Required for PATCH calls. Specifies if report type is hidden (true) or not (false).
Example:
Sample Request Body
Hide a report type
{
"templateId" : <Report Type API Name>,
"hidden" : "true"
}
297
INDEX
Resources (continued)
A Fact map 57
Analytics Download API
Filter report results 57, 224
GET a dashboard PDF 109
GET analytics download 119
GET a dashboard PNG 111
GET analytics notifications limits 133
GET a lens PNG 110
GET analytics notifications list 120
GET a report PNG 111
Get basic report metadata 204
Analytics Notifications API
GET dashboard describe 149, 160
GET a list of analytics notifications 112, 117
GET dashboard list 135
GET a list of report types 46
GET dashboard results 136
Analytics Notifications API Examples
GET dashboard status 159
DELETE delete an analytics notification 117
Get extended report metadata 204
POST create an analytics notification 114
GET folder share recipients 185
PUT save an analytics notification 115
GET folder share types 171, 175, 188
GET folder shares 179, 182
D Get recent reports list 239
Dashboards API GET recently created reports for specific report type 295
filtering results 78 GET recently used report type list 294
getting dashboard metadata 100 GET report data 57, 224
getting list of dashboards 74 GET report fields 257
getting results 74 GET report instance results 237
getting status 79 GET report instances 236
refreshing 80 GET report type list 163, 272
returning details about dashboard components 85 GET report type metadata 273
saving a dashboard 80, 84 PATCH report 190
PATCH report type list 296
R POST analytics notifications list 120
Reference POST folder shares 179, 182
Dashboard error codes 161 POST report data 57, 224
Dashboard List 134 POST report instance 231, 236
Dashboard Results 134 POST Report Query Resource 243
Dashboard Status 134 PUT analytics notification 127
Download 119 PUT folder shares 179, 182
Folders 170 run report asynchronously 231
Notifications 120 Summary level results 57, 224
Report Describe 189
Report Execute 189 S
Report Instances 189 Salesforce Reports and Dashboards REST API
Report List 189 asynchronous 51–52
Report Types 163, 271 dashboard, clone 109
Reports API Examples dashboard, delete 109
POST create a report 5 filter reports 51
Resources GET request 42, 52
DELETE analytics notification 127 list report runs 52
DELETE report 190 POST request 51
Detailed results 57, 224 recently viewed 56
298
Index
Salesforce Reports and Dashboards REST API (continued) Salesforce Reports and Dashboards REST API (continued)
report list 56 report, query 60
report metadata 42 report, save 71
report, clone 72 synchronous 51
report, delete 74
299