Reports API Resource Reference
Property
dataType groupingLevel
Type
String
Integer
Execute Sync
Description
Data type of the field used for grouping. Possible values are:
•
string
•
boolean
•
double
•
int
•
percent
•
currency
•
date
•
datetime
•
time
•
picklist
•
multipicklist
•
id
•
reference
•
textarea
•
phone
•
combobox
•
url
•
email
•
html
Level of the grouping. Value can be:
•
0
,
1
, or
2
. Indicates first, second, or third row level grouping in summary reports.
•
0
or
1
. Indicates first or second row or column level grouping in a matrix report.
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.
143
Reports API Resource Reference Execute Sync
Resource URL
/services/data/
<latest API version>
/analytics/reports/
<report ID>
Formats
JSON
HTTP Methods
Method
GET
POST
Description
Get report results. See this example
.
Get specific results by passing dynamic filters, groupings, and aggregates in the report metadata. See this
example
.
POST Request Body
Property
aggregates buckets chart crossFilters customSummaryFormula currency detailColumns
Type
Array of strings
Bucket field
Chart[]
Cross filter on page
137[]
Custom summary formula
String
Array of strings
Description
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.
Describes a bucket field.
Details about the chart used in a report.
Cross filters applied to the report.
Describes a custom summary formulas.
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.
Unique API names for the fields that have detailed data.
144
Reports API Resource Reference Execute Sync
Property
developerName division folderId groupingsAcross groupingsDown hasDetailRows hasRecordCount historicalSnapshotDates id name reportBooleanFilter
Type
String
String
String
Groupings across[]
Groupings down[]
Boolean
Boolean
Array of strings
String
String
String
Description
Report API name.
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.
ID of the folder that contains the report.
Note:
When the report is in the My Personal Custom Reports folder, folderId = userId. When the report is in the Unfiled Public
Reports folder, folderId = orgId.
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.
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.
Indicates whether to include detailed data with the summary data.
Indicates whether the report shows the record count.
List of historical snapshot dates.
Unique report ID.
Display name of the report.
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": [
{
145
Reports API Resource Reference
Property
reportFilters reportFormat reportType scope
Type
Filter details[]
String
Report type
String showGrandTotal showSubtotals sortBy standardDateFilter
Boolean
Boolean
Array of strings
Array of strings
Execute Sync
Description
"value":
"Analyst,Integrator,Press,Other",
"column": "TYPE",
"operator": "notEqual"
},
{
"value": "100,000",
"column": "SALES",
"operator": "greaterThan"
},
{
"value": "Small",
"column": "Size",
"operator": "notEqual"
}
]
}
}
List of each custom filter in the report along with the field name, filter operator, and filter value.
Format of the report. Value can be:
•
TABULAR
•
SUMMARY
•
MATRIX
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.
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.
Indicates whether the report shows the grand total.
Indicates whether the report shows subtotals, such as column or row totals.
API name of the field on which the report is sorted and the direction of the sort (asc or desc).
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.'
146
Reports API Resource Reference
Property
standardFilters supportsRoleHierarchy topRows userOrHierarchyFilterId
Type
Array of strings
Boolean
Top rows
String
Execute Sync
Description
startDate
: Start date.
endDate
: End date.
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.
Indicates whether the report type supports role hierarchy filtering (true) or not (false).
Describes a row limit filter applied to the report.
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
attributes allData factMap groupingsAcross groupingsDown hasDetailRows
Type
Attributes
Boolean
Fact map
Groupings across
Groupings down
Boolean
Description
Key report attributes and child resource URLs.
When
True
, all report results are returned.
When
False
, results are returned for the same number of rows as a report run in Salesforce.
Note:
For reports that have too many records, use filters to refine results.
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
.
Collection of column groupings, keys, and their values.
Collection of row groupings, keys, and their values.
When true
,the fact map returns values for both summary level and record level data.
When false
, the fact map returns summary values.
147
Reports API Resource Reference Execute Sync
Property
reportExtendedMetadata reportMetadata
Type
Report extended metadata
Report metadata
Description
Additional information about columns, summaries, and groupings.
Unique identifiers for groupings and summaries.
Attributes
Property
describeUrl instancesUrl type reportName reportId
Type
String
String
String
String
String
Description
Resource URL to get report metadata.
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.
API resource format.
Display name of the report.
Unique report ID.
Fact map
Property
rows aggregates
Type
Data cells[]
Aggregates[]
Description
Array of detailed report data listed in the order of the detail columns provided by the report metadata.
Summary level data including record count for a report.
Data cells
Property
value label
Type
Detail column info data type
Description
The value of a specified cell.
If the response is an empty string, then API version 36.0 and earlier returns null. API version 37.0 and later returns an empty string.
String Display name of the value as it appears for a specified cell in the report.
Aggregates
Property
value
Type
Number
Description
Numeric value of the summary data for a specified cell.
148
Reports API Resource Reference
Property
label
Groupings across
Property
groupings
Groupings
Property
value key label groupings dategroupings
Execute Sync
Type
String
Description
Formatted summary data for a specified cell.
Type
Groupings[]
Description
Information for each column grouping as a list.
Type
String
String
String
Array
Array
149
Description
Value of the field used as a row or column grouping. The value depends on the field’s data type.
•
Currency fields:
–
amount
: Of type currency. Value of a data cell.
–
currency
: Of type picklist. The ISO 4217 currency code, if available; for example, USD for US dollars or CNY for
Chinese yuan. (If the grouping is on the converted currency, this is the currency code for the report and not for the record.)
•
Picklist fields: API name. For example, a custom picklist field,
Type of Business
with values 1, 2, 3 for Consulting,
Services, and Add-On Business, has
1
,
2
, or
3
as the grouping value.
•
ID fields: API name.
•
Record type fields: API name.
•
Date and time fields: Date or time in ISO-8601 format.
•
Lookup fields: Unique API name. For example, for the
Opportunity Owner
lookup field, the ID of each opportunity owner’s Chatter profile page can be a grouping value.
Unique identity for a row or column grouping. The identity is used
by the fact map
to specify data values within each grouping.
Display name of a row or column grouping. For date and time fields, the label is the localized date or time.
Second or third level row or column groupings. If there are none, the value is an empty array.
Start date and end date of the interval defined by date granularity
.