POST api/documents/generate

Generates/caches PDFs for every document in the list of the specified URLs and a template name.

Request Information

URI Parameters

None.

Body Parameters

Document requests DTO array.

Collection of DocumentRequestListItemDTO
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.

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",
    "TemplateCategory": "sample string 2",
    "TemplateCode": "sample string 3",
    "DocumentId": "sample string 4"
  },
  {
    "URL": "sample string 1",
    "TemplateCategory": "sample string 2",
    "TemplateCode": "sample string 3",
    "DocumentId": "sample string 4"
  }
]

text/html

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

application/xml, text/xml

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

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 'List`1'.

Response Information

Resource Description

DocumentsCacheResultDTO
NameDescriptionTypeAdditional information
Documents

Info on the generated documents.

DocumentArchiveResultDocumentDTO

None.

ErrorMessage

When caching was partially successful, this error message contains information about the unsuccesfully cached documents. If no errors occurred, this field is empty.

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Documents": {
    "DocumentId": "sample string 1",
    "BlobLink": "sample string 2"
  },
  "ErrorMessage": "sample string 1"
}

text/html

Sample:
{"Documents":{"DocumentId":"sample string 1","BlobLink":"sample string 2"},"ErrorMessage":"sample string 1"}

application/xml, text/xml

Sample:
<DocumentsCacheResultDTO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Common.WebAPI.DTOs">
  <Documents>
    <BlobLink>sample string 2</BlobLink>
    <DocumentId>sample string 1</DocumentId>
  </Documents>
  <ErrorMessage>sample string 1</ErrorMessage>
</DocumentsCacheResultDTO>