Send Personalized Texts Using Templates

Templates can save time and effort when the same message format is required. Furthermore, your customers will receive personalized messages even when you’ve applied templates. All you have to do is use the embed tags into the template text.

Get all templates

To get all templates, use:

GET /api/v2/templates

with the parameters:

NameRequired?ExampleDescription
pageNo3Fetch the specified results page. The default is 1.
limitNo25The number of results per page. The default is 10.

You will receive the standard paginated response:

ParameterExampleDescription
page3The current fetched page.
limit25The number of results per page.
pageCount150The total number of pages.
resourcesArray of template resourcesSee next section for template resource format details.

Get a specific template

To get a single template, use:

GET /api/v2/templates/{id}

where id is a template ID. Note, this command has no parameters.

The response format you will receive is:

ParameterExampleDescription
id519Template ID.
lastModified2014-09-11T08:12:01+0000Time when template was last modified.
nameAppointment reminderTemplate name.
contentHello {First name}!Template text. May contain the tags listed below.

Custom fields list (Merge tags)

All tags should be inputted inside curly braces (e.g., {First name} for First name).

TagDescription
First nameContact first name.
Last nameContact last name.
Company nameContact company.
PhoneContact phone number.
EmailEmail.
Custom fieldsContact custom field values.

Create a new template

There are times when creating a new template makes sense (such as when targeting specific clients or improving your business strategies). You can create new SMS templates for marketing purposes or SMS templates for business campaigns.

To create a new template, use:

POST /api/v2/templates

with the following parameters:

NameRequired?ExamplesDescription
nameYes Appointment reminderTemplate name.
contentYes Hello {First name}! Template text. May contain tags listed above.

If successful, you will receive the standard link response:

ParameterExampleDescription
id519ID of the new template.
href/api/v2/templates/519Link to the new template.

Edit a template

To modify a template name or its content, use:

PUT /api/v2/templates/{id}

where id is the template ID, with the following parameters:

NameRequired?ExampleDescription
nameYesAppointment reminderTemplate name.
contentYesHello {First name}!Template text. May contain tags listed above.

If successful, you will receive the standard link response:

ParameterExampleDescription
id519Id of modified template.
href/api/v2/templates/519Link to template.

Delete a template

To delete a template, use:

DELETE /api/v2/templates/{id}

where id is the template ID. Note, this command has no parameters. If successful, this command will return the standard delete response (204 No Content), otherwise you will receive the standard error response.

The next step

Now you have learned how to create and manage SMS templates, please also check the Messages: Send section to learn how to send personalized text messages using these templates.