Generate
Generates a PDF document from a template and input data.
This is the primary endpoint used for document generation.
- HTTP Method:
POST - Endpoint:
https://eledo.online/api/RESTv1/Generate
Request body
| Name | Type | Required | Description |
|---|---|---|---|
templateId | String | Yes | Template identifier |
templateVersion | Integer | No | Template version |
file | Object | Yes* | Input data for the template |
Minimal example
The following payload is the minimal reliably working request:
{
"templateId": "...",
"file": null
}
Response
Success
- Content-Type:
application/pdf - Body: Binary PDF data
Headers
| Header | Description |
|---|---|
Content-Disposition | Contains the generated filename |
Example:
content-disposition: attachment; filename="0_0.pdf"; filename*=UTF-8''0_0.pdf
Error
- Content-Type:
application/json
| Name | Type | Description |
|---|---|---|
errors | Array | List of errors |
Observed behavior
The following behavior has been observed in real integrations.
File parameter
- The
filefield must be present in the request file: nullis accepted{}(empty object) is also accepted- Omitting the
filefield may result in errors
Recommendation:
Always include the file field (use null if no data is required)
Input validation
- Partial payloads are accepted
- Missing fields do not cause failure
- Incorrect types may still produce a PDF with missing values
Recommendation:
Do not rely on strict validation — validate inputs on the client side if needed
Response handling
- Successful responses return binary PDF data
- Errors return JSON
- Response type should be detected via
Content-Type
Filename handling
- The filename is provided in
Content-Disposition - Two variants may be present:
filename="..."filename*=UTF-8''...
Recommendation:
Handle both formats when extracting filenames
How it works
- Select a template (
templateId) - Provide input data (
file) - The API renders and returns a PDF
Next steps
Was this article helpful?
Yes
No