v3

latestOpenAPI 3.0.02026-07-31162156.9 KB
Journeys

generateDocument

Builds document generated from a template with journey values."

Supported input document types:

  • .docx

Supported output document types:

  • .pdf
  • .docx but limited to only text based variables

Uses Document API to generate the document. Uses Template Variables API to replace variables in the document.

post/v1/journey/document:generate

Request body

file_idstring required

Entity id for the template being used

context_entity_idstring uuid

Entity id used to resolve entity and relational template variables

languagestring

Language code for the document

Example request

{
  "file_id": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
  "language": "de"
}

Response

Generated document output

job_idstring uuid
job_status'STARTED' | 'PROCESSING' | 'SUCCESS' | 'FAILED'

Status of the job

messagestring

A message explaining the progress

Example response

{
  "pdf_output": {
    "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.pdf",
    "output_document": {
      "s3ref": {
        "bucket": "document-api-preview-prod",
        "key": "preview/my-template.pdf"
      }
    }
  },
  "docx_output": {
    "preview_url": "https://document-api-prod.s3.eu-central-1.amazonaws.com/preview/my-template-OR-001.docx",
    "output_document": {
      "s3ref": {
        "bucket": "document-api-preview-prod",
        "key": "preview/my-template.docx"
      }
    }
  },
  "template_settings": {
    "custom_margins": {
      "top": 2.54,
      "bottom": 2.54
    },
    "suggested_margins": {
      "top": 2.54,
      "bottom": 2.54
    },
    "display_margin_guidelines": true,
    "file_entity_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d"
  }
}