X

Posted on

Guide: How to create letters with our API

There is not enough hours in the working day, that’s why we offer the ability to automate sending letters using our platform. Our API enables you to programmatically send letters with ease.

Here are a few examples of ways to use our letter API. Examples are shown by screenshots of Postman. Be sure to view our API documentation pages first so you know how to make each request correctly.

Simply supply an existing PDF file

You may already have a PDF file that you want to post. That’s OK with us, just send the file with your API request along with the address you wish to send it to and we will do the rest.

API letter request

Be sure to look at our letter design guide for appropriate address clear zones and sizing.

Using a letter template

The most powerful way to create letters is by using templates. When using templates you can personalise certain elements for each recipient using variable tags. This is sometimes referred to as mail merge.

First log into your dash area and then visit the template designs page. Here you can create a new letter template using our designer editor.

Letter Design Editor

Save the template using a name you will remember. Now you will see the new template in your list of available templates. Here you will find the template ID which is needed for your API request.

Now send a request using the template field, include the recipient data and we will use that design.

letter-API-guide-03

Notice the recipient fields being sent in the example post request above. We have included a custom field “recipient[voucher]”. The request will collect any custom field and look for that field in your template to replace. For example if the template had the text “Your voucher code is: {voucher}” it will be replaced with “Your voucher code is: VOUCHER1234”.

Be sure to look at our API page for reference to the correct field names.