Docker Lambda API
The Docker image will run as an AWS Lambda function by default. The container is invoked with an event that contains the input data and the configuration. The event is a custom JSON object as described below for each action.
All actions will always respond with a JSON object. When the action is successful, the response will contain the statusCode
field with the value 200 or 204. When the action fails, the response will contain the statusCode
with a matching value between 400 and 599. The response will also contain the body
when the status code is not 204 for a successful action. The body
will contain the generated report as Base64 encoded string.
When the actions is not successful, a field error
will be present in the response with a description of the error.
The Docker Service does not make requests to other services or store data by default. It doesn't track analytics or collect any data. The only exception to this is if the report requires dynamic data from an external source. If that is the case for your report, it is because we agreed with you to use a specific external source.
Rendering Actions
Generate Report
Example:
Renders the report using the input data and the configuration. Check Generate Report for more details.
{
"action": "render",
"format": "pdf" | "png" | "webp" | "jpeg",
"responseFormat": "multipart" | "zip", // optional
"quality": number, // optional
"scaleFactor": 1 | 2 | 3, // optional
"pages": number | "all" | string // optional, when the value is a string, it is interpreted as a page range expression (ex: 1-5)
"debug": boolean | { debugLayout: boolean, debugBlocks: boolean, debugSource: boolean, debugPath: boolean } // optional
"data": {}, // JSON value
}
Generate Report with Transform
Renders the report using the input data and the configuration. Check Generate Report with Transform for more details.
Example:
{
"action": "render-transform",
"transform": "{transform_name}",
"data": {} // JSON value
"format": "pdf" | "png" | "webp" | "jpeg",
"responseFormat": "multipart" | "zip", // optional
"quality": number, // optional
"scaleFactor": 1 | 2 | 3, // optional
"pages": number | "all" | string // optional, when the value is a string, it is interpreted as a page range expression (ex: 1-5)
"debug": boolean | { debugLayout: boolean, debugBlocks: boolean, debugSource: boolean, debugPath: boolean } // optional
}
Informational Actions
Get Report Template Info
Returns information about the API. Check Get Report Template Info for more details.
Example:
{ "action": "info" }
Get Report Template JSON Schema
Returns the JSON Schema to validate the input data. Check Get Report Template JSON Schema for more details.
Example:
{ "action": "schema" }
Describe Transforms
Example:
Returns the list of transforms that can be applied to the input data. Check List Allowed Transforms for more details.
{ "action": "describe-transforms" }
Get Transform Description
Example:
Returns the description of the transform. Check Get Transform Description for more details.
{
"action": "describe-transform",
"transform": "{transform_name}"
}
Convert Transform Data to JSON
Example:
Returns the data as a JSON value that can be used as input for the render
action. Check Convert Transform Data to JSON for more details.
The file_name
field is described by calling the describe-transform
action. The file_content
is the content of the file to be transformed in Base64 encoding.
There is no need to use this action before calling the render-transform
action. The render-transform
actions will automatically convert the data to JSON. This endpoint is provided for convenience and testing.
{
"action": "transform",
"transform": "{transform_name}"
"data": {
[{file_name}]: [{file_content}]
}
}
Validation Actions
Validate Report Data
Validates the input data against the JSON Schema. Check Validate Report Data for more details.
There is no need to use this action before calling the render
action. The render
action will automatically validate the input data.
Example:
{
"action": "validate",
"strict": {true|false},
"data": {} // JSON value
}
Validate Transform Data
Validates the input data against the transform and its JSON Schema. Check Validate Transform Data for more details.
There is no need to use this action before calling the render-transform
action. The render-transform
action will automatically validate the input data.
Example:
{
"action": "validate-transform",
"transform": "{transform_name}",
"data": {} // JSON value
}