GRANSKA

Download an example's report

GEThttps://api.granska.cloud/v1/examples/:exampleId/result.pdf

Downloads an example document's analysis report as the same PDF the app exports.

Bearer tokenSpends no quota

What you get

The analysis report of one example document, as the same PDF a user gets from the download button after opening that example in the app: the same layout, the same fonts and the same wording, built from the example's stored analysis and from your workspace's configuration.

The response is Content-Type: application/pdf with a Content-Disposition filename made only of letters, digits, -, _ and ., so it is safe to write to disk as it stands. Save the body as binary; it is not JSON.

This is the report about the example, not the example itself. The example document is pdfBase64 in GET /v1/examples/:profileId.

Which examples

Exactly the ones GET /v1/examples/:profileId lists to you: your own organisation's and the shared ones, on profiles your organisation can use. Any other id answers 404, the same as an id that does not exist.

What it does not do

It renders, it does not store. The PDF is built when you ask for it and streamed back with Cache-Control: no-store.

It costs no run. Rendering is not an analysis, and this route draws nothing from your quota.

It never starts an analysis. An example published without a finished analysis has no report to render and answers 409. To get a report for it, decode its pdfBase64, upload the PDF through POST /v1/upload-url and analyse it with POST /v1/analyze.

Request
curl https://api.granska.cloud/v1/examples/example_lss_avslag/result.pdf \
  -H "Authorization: Bearer $TOKEN" \
  --fail --output example-report.pdf
Response
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="example-example_lss_avslag.pdf"
Cache-Control: no-store

%PDF-1.3 … (the example's report, as binary PDF)

Request

ParameterDescription
exampleId
string·path·required
The id GET /v1/examples/:profileId lists the example under.

Errors

Every refusal is the ordinary JSON error envelope, never a partial PDF: check the status before saving the body. With curl --fail, as in the example, a refusal leaves no file behind.

ErrorWhen
401
UNAUTHORIZED
The Authorization header is missing, is not a readable bearer token, or names no tenant.
401
TOKEN_EXPIRED
The access token was issued by this gateway and has since expired. Not probed: it needs a token older than its own lifetime.
404
NOT_FOUND
No example with that id that GET /v1/examples/:profileId would list to you: it does not exist, it belongs to another organisation, or it is on a profile your organisation was not granted. The three are one answer on purpose.
409
CONFLICT
The example holds no stored report to render. The app builds one for such an example with a fresh, charged run, which this route never starts. Not probed: it needs an example published without a finished analysis.
500
INTERNAL_ERROR
An unexpected server-side failure. Not probable from outside — reaching it means something is wrong.