Requesting Reports
  • 2 Minutes to read
  • Dark
    Light

Requesting Reports

  • Dark
    Light

Article summary

You can use the Analytics API to get your report data in two ways: with the Report ID or by configuring a JSON file.

You cannot use live elements in these reports.

Which Method Should I Use?

Method

Best for:

Request by ID

Ease of use.
If your reports change often and you need to be certain you have the exact elements in the current report from the User interface, you can access this quickly with just the ID.

Request by JSON Configuration

Total customization.
When you want direct control over the report and total customization possibilities, you should retrieve dashboards or elements by directly sending the entire JSON file. This will allow you to build custom reports based on an existing report from the UI. This method requires much more time for configuration, depending on the level of customization

Method 1: Request by ID

This method will always reflect the latest configuration in the UI, including any saved updates or changes made to the dashboard or its elements. It also simplifies filter modifications without requiring direct access to JSON structures or scripts.

With this method, you can only customize one setting: the time range. You can add a different time range in your request, which will not affect the saved settings in the report. This can be done by adding a normal time range in the call's body.  You can’t add any quick filters.

Report ID

If you want to use this method, you’ll need to add the IDs to your view. Go to your Report Overview and select the cog icon on the right side for Report ID. Next, you can toggle the ID column to on in Table Configuration.

Showing report IDs_GIF_Final.gif

Now you can copy the ID from the overview page.

Element IDs

If you don’t need the full report, you can optionally add element IDs to the call. This will only return the requested parts. There are two ways to find these.

Individual IDs can be found in the reports at the top of all supported elements. You can enable Report Element IDs by setting Always display Element IDs to yes on a report level.

You can also get a copy of all available Element IDs by going to the three-dot menu in a report and selecting Copy as JSON > Element IDs.

Showing Element IDs_GIF_Final.gif

Method 2: Request by JSON Configuration

If you’d like more control over the report, you can copy the JSON of a report from the User Interface and edit it as needed. You could create one from scratch, but using an existing report should save time and effort. Using this method instead of the Report ID also means that any changes made in the UI will not affect your API report.

  1. Find a report you want to use as a starting point and open it.

  2. Then, select the three-dot menu in the upper right-hand corner and select copy as JSON.

  3. Next, click Report Configuration. The JSON will include all dashboard elements, the currently selected time range, and any applied quick filters.  

  4. Paste the JSON into a text editor. Before sending your request, you can completely customize the file.

Method 2 report configuration_GIF_Final.gif


Was this article helpful?