Download an authenticated PDF report for a fall risk result.
The report route generates a PDF for an existing fall risk result.
GET /api/fall-risk-results/{fallRiskResultId}/report
Authenticate the request with the credential issued for the client. The optional query parameters are:
| Parameter | Description |
|---|---|
name | Display name used when rendering the report. |
gender | Display value used by the report. |
birthDate | Birth date used by the report. |
uid | Optional owner identifier used to hydrate user details. If supplied, it must match the result owner. |
locale | Report locale. The deployed default is zh-Hant; pass a supported locale such as en when needed. |
uid is optional in the deployed handler. It does not let a caller look up a
different user. The result access check still applies.
Example binary download:
const response = await fetch(
"https://your-client.gofa.app/api/fall-risk-results/result-id/report?locale=en",
{
headers: { Authorization: `Bearer ${firebaseIdToken}` },
},
);
if (!response.ok) throw new Error(`Report failed (${response.status})`);
const pdfBytes = await response.arrayBuffer();
await Bun.write("fall-risk-report.pdf", pdfBytes);The success response has Content-Type: application/pdf, an attachment
Content-Disposition filename, and no-store cache headers. Do not log the
response bytes or expose a report URL as a public bearer link.
Possible failures include 401/403 for authentication or access, 404 when
the result is not available to the caller, 402 for a product membership gate
in the applicable SilverCare handoff, and 500 when report generation fails.
The PDF is a generated presentation of the stored result. Treat its health information as sensitive and apply the same retention and access controls as the API result.