POST api/Documents/Generate

Generates a document using a particular template.

Request

Parameters

Name Description Default
download Whether to include the content of the generated document in the response. True
convertToPdf Whether to convert to PDF. False

Body

Content Type: application/xml
Schema: http://download.overtech.com.au/schemas/GenerateDocument.xsd
Metadata describing the document, template and build parameters.

Response

Body

Content Type: application/octet-stream
Contents of the generated document, an error message or an empty response.

Status Codes

Code Condition
201 CreatedThe document was successfully generated.
204 No ContentThe document was successfully generated but the server intentionally returned no content.
400 Bad RequestInvalid template, attachment or metadata.
401 Unauthorized Access token is invalid, expired or not specified.
403 ForbiddenUser does not have permission to create the document.
406 Not Acceptable Content type specified in the Accept header isn't supported.
500 Internal Server Error An internal error occurred.

Remarks

If the build parameters specify that the document is to be registered, the number (unique ID) of the generated document will be returned in the X-Document-ID response header.

A more specific content type (e.g. application/pdf) may be included in the response headers.