- 2 Minutes to read
- Print
- DarkLight
Requesting Reports
- 2 Minutes to read
- Print
- DarkLight
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. |
Request by JSON Configuration | Total 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.
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.
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.
Find a report you want to use as a starting point and open it.
Then, select the three-dot menu in the upper right-hand corner and select copy as JSON.
Next, click Report Configuration. The JSON will include all dashboard elements, the currently selected time range, and any applied quick filters.
Paste the JSON into a text editor. Before sending your request, you can completely customize the file.