Newer Version Available

This content describes an older version of this product. View Latest

Execute Sync

Resource URL

Runs a report immediately with or without changing filters and returns the latest summary data with or without details for your level of access.

Data URL
Summary
1/services/data/<latest API version>/analytics/reports/<report ID>
Summary with detail
1/services/data/<latest API version>/analytics/reports/<report ID>?includeDetails=true

Formats

JSON

HTTP Methods

Method Description
GET Get report results.
POST Get specific results by passing filters in the report metadata.

POST Request Body

Property Type Description
name String Report name.
id String Unique report ID.
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.
reportFormat String Format of the report. Value can be:
  • TABULAR
  • SUMMARY
  • MATRIX
developerName String Report API name.
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.

aggregates 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.
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.
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.
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.”

1{
2...
3        "reportBooleanFilter": "(1 OR 2) AND 3",
4        "reportFilters": [
5            {
6                "value": "Analyst,Integrator,Press,Other",
7                "column": "TYPE",
8                "operator": "notEqual"
9            },
10            {
11                "value": "100,000",
12                "column": "SALES",
13                "operator": "greaterThan"
14            },
15            {
16                "value": "Small",
17                "column": "Size",
18                "operator": "notEqual"
19            }
20        ]
21    }
22}
reportFilters Filter details[] List of each custom filter in the report along with the field name, filter operator, and filter value.
detailColumns Array of strings Unique API names for the fields that have detailed data.
historicalSnapshotDates Array of strings List of historical snapshot dates.

Response Body

Property Type Description
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.

attributes Attributes Key report attributes and child resource URLs.
reportMetadata Report metadata Unique identifiers for groupings and summaries.
reportExtendedMetadata Report extended metadata Additional information about columns, summaries, and groupings.
groupingsDown Groupings down Collection of row groupings, keys, and their values.
groupingsAcross Groupings across Collection of column groupings, keys, and their values.
allData Boolean

When True, all report results are returned.

When False, results are returned for the same number of rows as a report run in Salesforce.

For reports that have too many records, use filters to refine results.

Note

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.

Attributes
Property Type Description
describeUrl String Resource URL to get report metadata.
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.
type String API resource format.
reportName String Display name of the report.
reportId String Unique report ID.
Groupings down
Property Type Description
groupings Groupings[] Information for each row grouping as a list.
Groupings across
Property Type Description
groupings Groupings[] Information for each column grouping as a list.
Groupings
Property Type Description
value String 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.
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.
Fact map
Property Type Description
rows Data cells[] Array of detailed report data listed in the order of the detail columns provided by the report metadata.
aggregates Aggregates[] Summary level data including record count for a report.
Data cells
Property Type Description
value Detail column info data type The value of a specified cell.
label String Display name of the value as it appears for a specified cell in the report.
Aggregates
Property Type Description
value Number Numeric value of the summary data for a specified cell.
label String Formatted summary data for a specified cell.

Examples