Documentation

Using Tags

After you upload your .csv data you will get a list of tags that can be used within the .docx template. The easiest way to use them is to just click (copy) icon next to the tag you want to use.

To make sure tags will be properly recognized all the .csv headers are by default transformed to lower case and all the spaces are replaced with underscore character.


Custom Title

For premium user, the Custom Title option is available. This allows users to provided a custom title for their final file.

For creating a custom title you could use the following format You Text followed by the data object (which is ignored in the output) i.e. { data } , your place tags

A complete example Welcome Letter { data } - { last_name


Conditional Content

There are times you need to show different content based on the provided data. That's where conditional content shines.

For example: if in your template you need to differentiate gender and you have gender field in your .csv data then you can do it as below:

{#gender == 'female'}It's for her.{/}

The basic formula looks basically like this:

{#your_tag_here == 'Whatever it should be equal to'}Some content you want to show if your_tag_here is equal to your condition.{/}

You can also do it with numbers like this:

{#speed > 100}That was fast!#{/}

In case you want to put if/else statement:

{#isGood == true}So good#{'{/}'}{^isGood}Not so good...{/}
(the content with ^ is used if the first expression is not true)

Things to keep in mind:

  • there should be no space between hashtag and tag name
  • there is {/} at the end that encloses the content to show
  • you can nest conditions one into another (for more complex content)

Pro tip: use different tag colors for improved readability:

{#gender == 'female'}It's for her.{/}{#gender == 'male'}It's for him.{/}

Tags for conditional content are replaced so colors don't impact content within them.


Filters

Filters are a great way to augment your data on the fly! Let's say you need all the first names lower cased. To do that you would need to add tag to your tag like this:

{first_name | lower}

You can also chain filters together like this:

{first_name | lower | upperCaseFirstLetter}

Keep in mind that filters are applied in the order you put them!

Thanks to this without any additional work all the names will be all lower case.

If you need additional filters feel free to reach out and we will add it!

Available filters:

Filter namesDescription
lowerall characters to lower case
upperall characters to upper case
upperCaseFirstLetterfirst character to upper case

Available filters for numbers:

Filter namesDescription
add:Xadd X to number
subtract:Xsubtract X from number
multiply:Xmultiply number by X
divide:Xdivide number by X
toWordstransform numbers into words (i.e. 120 into "one hundred twenty")

If there is a filter missing that you want reach out to us!


API Documentation

POST /generate

Generate documents based on provided .csv data and .docx template.

Endpoint URL
https://doctempleapp.com/api/generate
Your personal API key
(please sign in)
This key is personal to you and only showed when you're signed in

Header parameters

NameTypeDescription
X-Doctemple-Api-KeyStringAPI key required to have access

Form-data parameters

NameTypeDescription
templateString or FileURL to the template .docx file or upload File directly
sourceDataString or FileURL to the .csv file or upload File directly. Csv file required with headers.
outboundWebhook(optional)StringEndpoint that will receive the download link
titleFormat (optional)StringTitle format (see docs for reference)
dropPrefix (optional)BooleanTitle format (see docs for reference)
convertToPdf (optional)BooleanConvert generated documents to .pdf. If there are more than 15 rows in the .csv file it defaults to false

Example response

{ "downloadLink": "https://storage.googleapis.com/templater-d1fb0.appspot.com/1611258132-3c03b5832a810493a075d2ebd6759b3df5e9a74b.zip" }

All the download links and files get expired and deleted after 3 days.

Response fields

NameTypeDescription
downloadLinkStringDirect link to the file. It's name is uniquely created by timestamp and 20 random character hash so your files are safe.