Salesforce Reports and Dashboards API via Apex

The Salesforce Reports and Dashboards API via Apex gives you programmatic access to your report data as defined in the report builder.

The API enables you to integrate report data into any web or mobile application, inside or outside the Salesforce platform. For example, you might use the API to trigger a Chatter post with a snapshot of top-performing reps each quarter.

The Salesforce Reports and Dashboards API via Apex revolutionizes the way that you access and visualize your data. You can:

  • Integrate report data into custom objects.
  • Integrate report data into rich visualizations to animate the data.
  • Build custom dashboards.
  • Automate reporting tasks.

At a high level, the API resources enable you to 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 data and metadata.

  • Requirements and Limitations

    The Salesforce Reports and Dashboards API via Apex is available for organizations that have API enabled.

  • Run Reports

    You can run a report synchronously or asynchronously through the Salesforce Reports and Dashboards API via Apex.

  • List Asynchronous Runs of a Report

    You can retrieve up to 2,000 instances of a report that you ran asynchronously.

  • Get Report Metadata

    You can retrieve report metadata to get information about a report and its report type.

  • Get Report Data

    You can use the ReportResults class to get the fact map, which contains data that’s associated with a report.

  • Filter Reports

    To get specific results on the fly, you can filter reports through the API.

  • Decode the Fact Map

    The fact map contains the summary and record-level data values for a report.

  • Test Reports

    Like all Apex code, Salesforce Reports and Dashboards API via Apex code requires test coverage.

See Also