Skip to content
API documentation
View as MarkdownOpen in Claude

Documents

Download a result report file

GET
/v1/{organizationId}/report/download/{reportId}

Sends the file of a released result report of one of your students: the bytes themselves, not JSON. Content-Disposition carries its name.

Every refusal of the report itself is the same 404 "Not found!": no report has this id or shortId, it is not released or was withdrawn, it belongs to another account’s student, or it has no file. So a download never shows whether a report exists in someone else’s hands.

Errors always arrive as JSON before the first byte. A transfer that ends early, or with fewer bytes than Content-Length, has failed: discard what you received.

Parameters

Path parameters

NameTypeDescription
organizationIdrequiredstringpattern ^[0-9a-f]{24}$

The organization’s _id: 24 hexadecimal digits, as listOrganizations (GET /v1/organization) lists it.

Example 64b7f0c2a1d3e4f5a6b7c8d9

reportIdrequiredstring

The report’s _id (24 hexadecimal digits) or its 10-character shortId, both from listStudentReports. A shortId is matched exactly, case included.

Responses

200 OK

The report file, streamed. Content-Type is whatever the object was stored with. Content-Disposition carries an ASCII filename and the real name as RFC 5987 filename*=UTF-8''…; prefer the latter.

Body

The file itself, as application/octet-stream or application/pdf.

Headers

Content-Disposition string

attachment; filename="<ascii>"; filename*=UTF-8''<percent-encoded>

Content-Length integer

Present when storage reports the size.

X-RateLimit-Limit integer

Requests your account may make to this operation per window (100).

X-RateLimit-Remaining integer

Requests left in the current window.

X-RateLimit-Reset integer

Seconds until the current window ends.

Example request

# $TOKEN: a short-lived token you minted with your API key and secret
# -f: an error status exits non-zero instead of being saved as report.pdf
curl -sS -f -o report.pdf 'https://api.main-team.org/v1/<organizationId>/report/download/<reportId>' \
  -H "Authorization: Bearer $TOKEN"

Search the API documentation

Guides, endpoints by name, path or permission, and error codes such as not_found.