curl --request GET \
--url https://api.testdino.com/api/public/v1/{projectId}/reports/pdf \
--header 'Authorization: Bearer <token>'"<string>"Generate a PDF summary of recent test results.
Covers test run summaries, pass/fail trends, flaky tests, and environment breakdowns over the last days (1–30). Optionally scope by branch, environment, or tags. Returns a binary PDF stream and is rate-limited to 1 request per minute per token.
curl --request GET \
--url https://api.testdino.com/api/public/v1/{projectId}/reports/pdf \
--header 'Authorization: Bearer <token>'"<string>"429 with a Retry-After header.| Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | attachment; filename="TestDino-Report-<project>-<days>d-<date>.pdf" |
curl "$BASE/${PROJECT_ID}/reports/pdf?days=7" \
-H "Authorization: Bearer $TESTDINO_API_TOKEN" \
-OJ
-OJ writes the response to the filename from Content-Disposition.import fs from "node:fs";
const res = await fetch(
`${BASE}/${PROJECT_ID}/reports/pdf?days=7`,
{ headers: { Authorization: `Bearer ${TOKEN}` } }
);
if (res.status === 429) {
const retry = Number(res.headers.get("Retry-After") ?? 60);
throw new Error(`PDF rate-limited. Retry in ${retry}s.`);
}
const filename = res.headers
.get("content-disposition")
?.match(/filename="([^"]+)"/)?.[1] ?? "report.pdf";
const buffer = Buffer.from(await res.arrayBuffer());
fs.writeFileSync(filename, buffer);
import re, requests
res = requests.get(
f"{BASE}/{PROJECT_ID}/reports/pdf",
headers={"Authorization": f"Bearer {TOKEN}"},
params={"days": 7},
)
if res.status_code == 429:
retry = int(res.headers.get("Retry-After", 60))
raise RuntimeError(f"PDF rate-limited. Retry in {retry}s.")
match = re.search(r'filename="([^"]+)"', res.headers.get("content-disposition", ""))
filename = match.group(1) if match else "report.pdf"
with open(filename, "wb") as f:
f.write(res.content)
429, the response includes a Retry-After header (in seconds). A simple backoff:
async function downloadWithRetry(url, attempts = 3) {
for (let i = 0; i < attempts; i++) {
const res = await fetch(url, { headers: { Authorization: `Bearer ${TOKEN}` } });
if (res.ok) return Buffer.from(await res.arrayBuffer());
if (res.status !== 429) throw new Error(`PDF failed: ${res.status}`);
const retry = Number(res.headers.get("Retry-After") ?? 60);
await new Promise(r => setTimeout(r, retry * 1000));
}
throw new Error("PDF generation exhausted retries");
}
Project PAT (tdp_) token with public-api scope
The project identifier (e.g. project_abc123). Must match the project associated with your PAT.
Lookback period in days (1–30, default 7). Determines how far back the report covers.
1 <= x <= 30Filter report data to a specific git branch.
Filter results by environment name (e.g. production, staging). Use the /filters endpoint to discover available environments.
Comma-separated run tags to filter report data (e.g. smoke,regression).
PDF binary stream
The response is of type file.
Was this page helpful?