DocumentTemplates
Get one DocumentTemplate
Retrieve a single DocumentTemplate record by its Id.
GET
Get one DocumentTemplate
A DocumentTemplate is a location-scoped reusable layout for generating customer, booking, contract, and proposal documents. Designer templates (Editor = Designer) are authored as a design (DesignJson) with fields, conditions, repeats and signature blocks for a DataContext and compiled to Liquid HTML; Classic templates use Liquid source or an uploaded mail-merge document.
Authentication
This endpoint requires OAuth2 authentication. Include a valid bearer token in the
Authorization header.
The authenticated user must be a full unrestricted administrator or have the DocumentTemplate-Read role.Path Parameters
Code Examples
Response
200
ID of the required location that owns this document template; only operators linked to that location can see or use it..
Required name used to identify this document template to operators; also used as the file name of documents generated from it..
Liquid HTML source rendered for Classic templates when TemplateOutputFormat is Html or Word. The variables available come from the data context built for the record the document is generated for (Location, Customer, Contract, Proposal and Booking roots), falling back to a small legacy set when no context can be built. For Designer templates this is generated from DesignJson on every save, so any value sent here is overwritten; change DesignJson instead..
Selects the generated format: Html, Word (Liquid source converted to a Word document) or Binary (the uploaded BinaryDocument used for mail merge, so it only makes sense together with an uploaded file). Saving a Designer template forces this back to Html.. See
eDocumentTemplateFormat enum values: 1 = Html, 2 = Word, 3 = Binary.Which editor owns the template: Classic (uploaded Word document merged with TX Text Control, or raw Liquid HTML) or Designer (a design authored in the Document Designer and compiled to Liquid HTML). Designer templates require DataContext and DesignJson, are validated and compiled on every save, and have TemplateOutputFormat forced to Html and any uploaded BinaryDocument cleared..
What the template is about: Customer, Contract, Proposal or Booking. Decides which data roots (Location, Customer, Contract, Proposal, Booking) the design can use. Designer templates must set one of the four; saving a Designer template while this is Unspecified is rejected. Classic templates leave it Unspecified..
Document Designer design (JSON, schema version 1) for Designer templates, holding the blocks, fields, conditions, repeats and signature blocks. Validate it with the document_template_designer tool before saving; the platform validates it again and compiles it into Document (Liquid HTML) on save, and a failed validation aborts the save. Ignored for Classic templates..
Read-only schema version of the last compiled design, set by the platform when a Designer template is saved (currently 1); 0 when the template has never been compiled from a design. Change DesignJson to recompile..
Read-only UTC timestamp of the last time Document was compiled from DesignJson, set by the platform when a Designer template is saved; empty for Classic templates..
Example Response