POST api/document/generate

Generates/caches a PDF for the specified URL/DTO and a template name.

Request Information

URI Parameters

None.

Body Parameters

Document request DTO.

DocumentRequestDTO
NameDescriptionTypeAdditional information
URL

URL for the GET request to fetch the DTO for. Security token will be propagated to this URL. Domains are not restricted. This value can be empty/null - in that case, the property DTO is inspected. URL must have a query parameter "lastModified" containing datetime of the last modification of the document, which regulates whether a cached version of the PDF will be returned, or a fresh copy will be generated anew. To always generate a new PDF set it to current datetime. Use the UTC time in the following format: "yyyy-MM-ddThh:mm:ss".

string

None.

DTO

This DTO is used if the property URL is empty/null. It specifies values for the parameters of the document template.

string

None.

TemplateCategory

Category of the document template.

string

None.

TemplateCode

Code of the document template.

string

None.

DocumentId

Unique ID identifying the document. This same ID is used for deletion.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "URL": "sample string 1",
  "DTO": "sample string 2",
  "TemplateCategory": "sample string 3",
  "TemplateCode": "sample string 4",
  "DocumentId": "sample string 5"
}

text/html

Sample:
{"URL":"sample string 1","DTO":"sample string 2","TemplateCategory":"sample string 3","TemplateCode":"sample string 4","DocumentId":"sample string 5"}

application/xml, text/xml

Sample:
<DocumentRequestDTO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Common.WebAPI.DTOs">
  <DTO>sample string 2</DTO>
  <DocumentId>sample string 5</DocumentId>
  <TemplateCategory>sample string 3</TemplateCategory>
  <TemplateCode>sample string 4</TemplateCode>
  <URL>sample string 1</URL>
</DocumentRequestDTO>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'DocumentRequestDTO'.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

application/json, text/json, text/html, application/xml, text/xml

Sample:

Sample not available.