HTTP API
Download Generated Reports
Download Report | Get your awesome documents with this simple HTTP API
Download the generated report
Download a generated document using a unique render ID
. This render ID
is obtained from a successful call to the POST /render/{templateId-or-versionId}
endpoint. The retrieved document is provided as a file stream, which can be directly downloaded or viewed.
Authentication header is not needed to call this API.
Response header
The Content-Disposition
can be changed to "attachment;" if the query parameter ?download=true
is added when calling the endpoint.
{
// mime-type
"Content-Type" : "application/pdf",
// Content-disposition with filename
"Content-Disposition" : "inline; filename="url-encoded-report-name.docx""
}
Response body
On success, the file is returned.
On error, a JSON is returned with details of the problem.
Status Code | Body | |
---|---|---|
200 | File stream | |
400 | { "success" : false, "error" : "Invalid renderId"} |
|
404 | { "success" : false, "error" : "File not found"} |
Curl Example
The command downloads the generated report into the file "FILENAME.pdf".
If an error occurs (status 4XX or 5XX), the error is also saved into the file. Each render ID can be downloaded only one time.
curl --location --request GET 'https://api.carbone.io/render/RENDER_ID' \
--header 'carbone-version: 5' \
-o 'FILENAME.pdf'