Get results of a saved report
/reporttemplates/{id}/resultsRuns a report that was already built in TestCollab and returns its aggregated rows. The report is identified by its id and its definition is resolved on the server, so nothing about how the report is built has to be sent with the request - which is what makes this endpoint suitable for a scheduled extract into a BI tool or a monitoring check. Each row carries one key per dimension (the grouped value) and one key per metric (the computed number); dimensions and metrics describe those keys in order, so a client can map the rows to columns without knowing the report. A report shared with the project (“Public”) can be run by any member of the project; a “Private” report only by the person who created it.
Example
Section titled “Example”Use resource IDs from your own project. Keep the API token in your server or CI environment.
import { createConfiguration, ReportTemplatesApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);const api = new ReportTemplatesApi(config);
const result = await api.getReportTemplateResults({ "id": 123});console.log(result);curl --request GET \ "https://api.testcollab.io/reporttemplates/123/results?token=$TESTCOLLAB_TOKEN"Parameters
Section titled “Parameters”| Name | Location | Type | Required | Description |
|---|---|---|---|---|
id |
path | number | Yes | Report ID |
date_from |
query | string | No | Start of the window (YYYY-MM-DD) to run the report over, replacing the date range saved with the report. Must be sent together with date_to, and the two cannot be more than 365 days apart. Omit both to use the report’s own range. |
date_to |
query | string | No | End of the window (YYYY-MM-DD), sent together with date_from |
Response
Section titled “Response”200 — Report results
| Field | Type | Required | Description |
|---|---|---|---|
dataset |
string | Yes | Records the report runs over Values: TestCase, TestPlan, Execution, Issue. |
granularity |
string | No | Bucket size applied to date dimensions Values: day, week, month. |
total_rows |
number | Yes | Records that matched the report before grouping, not the number of rows returned |
dimensions |
Array of Report Dimension | Yes | Fields the rows are grouped by, in order |
metrics |
Array of Report Metric | Yes | Values aggregated on each row |
rows |
Array of Report Result Row | Yes | One row per combination of dimension values |
{ "dataset": "TestCase", "granularity": "day", "total_rows": 123, "dimensions": [], "metrics": [], "rows": []}Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 |
Invalid date_from/date_to, a saved filter that cannot be applied (an unknown field, an operator the field does not offer, or a missing value), or more result rows than a single run may return |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Report not found |
500 |
Internal server error |