SendTemplate

SendTemplate API is used to send an Email/SMS message to recipients from a template defined by the given Template ID.

For email messages, this API also allows you to insert attachments to the template. Please use AttachmentList field to add attachments.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

The request consists of several important parameters. The steps to use this function are listed below:

  1. A template must be created through the interface before calling this function. A template ID is assigned by the administator or by the system to each created template. templateId is used to define which template to instanciate. This parameter is required.

  2. In case the template contains any customization variable than the developer needs to be made aware since these parameters have to be sent with the params variable in the request. The format of this parameter is JSON. JSON message may change from template to template. This parameter is set to null if the template does not have any personalization variables.

  3. sendId is used to group messages with a Group ID. The Group ID may be used to get reports of all corresponding messages under a batch report. For example, Send ID may be the Campaign ID in your system so that a consolidated report for a campaign can be obtained from the reporting interface with a single click to related report function. This parameter can be set to null.

  4. if saveContent is set to true, the whole message content (created by combining the template with the params plus attachments) per request is saved in the database. Note that the size in the database rapidly grows if this parameter is set to true.

  5. if saveParams is set to true, all request by the client for the template is saved in the database.

IMPORTANT NOTE-1: After customization of the template, if some parameters are left "not customized" with params the calling client set, the message relay is rejected! For example, there is {{name}} parameter on the template and params parameter doesn't have name parameter, the message is rejected to be relayed by the API!

IMPORTANT NOTE-2: For email messages, AttachmentList property is used to add attachments to the relayed template. If the template already has saved attachments, the attachments with the request and the exisiting template attachments will be combined and both attachments will both be sent.

string

The unique message id which will be assigned to the message. If not given or set to null, the system creates and assigns a unique message id to the message.

string
required

PublicId to instantiate. This is a required parameter. The template may be created by calling the related api or through Enterprise Studio Admin Panel.

rcptToList
array of strings
required

For email messages: The email addresses which receive email messages in To field. It may be set to null or may not be set at all.

For sms messages: The mobile numbers which receive text messages in their mobile numbers. This is a required parameter for text messages.

For push messages*: The tokens which receive push messages in your mobile application. Tokens should start with I-(IOS), A-(Android) or H-(HarmonyOS). This is a required parameter for push messages.

rcptToList*
ccList
array of strings

Carbon Copy recipient list (cc) - The email addresses which will receive email messages in Cc field. It may be set to null or may not be set at all. This parameter is only used for email messages.

ccList
bccList
array of strings

Blind Copy recipient list (bcc) - The email addresses which will receive email messages in Bcc field. It may be set to null or may not be set at all.This parameter is only used for email messages.

bccList
string

Send id is used to group messages under a tag so that reporting with a single id is possible. Typical example of send id is a campaign id, bulk id in your campaign system.

It may be set to null or may not be set at all.

integer

Optional. Overrides template Pool selection.

integer

Optional. Overrides template From Name and From Address selection.

integer

Optional. Overrides template Reply Name and Reply Address selection.

string

The parameter json having parameters to personalize the messages.

The templates usually have parameters. This json is used to send parameters to the template.

For example, the template may contain {{name}} parameter name is the parameter. While instanciating this template, the params may have

{"name":"John"}

JSON so that name parameter will be replaced with John.

**It can be set to null

boolean

if set to "true", the params sent by request is saved into the database in order to keep the parameters to instanciate the template.

It can be set to null or may not set at all.

boolean

if set to "true", the whole personalized content is saved into the database.

Please note that this is a huge content saved in the database so the disk size must be arranged accordingly.

It can be set to null.

string

This parameter is used in sms messages and sets the start time of a message for the operator to relay.

string

This parameter is used in sms messages and sets the latest time of a message for the operator to relay.

integer

TrustDay value for 'OTP' type sms messages.

string
enum

This parameter is used in sms messages and set to warn the operator to prioritize the message. Default: BULK

Allowed:
boolean

This parameter is used in sms messages and enables the short url service for replacing links in the sms text message.

attachmentList
array of objects

Attachment objects.

attachmentList
Headers
string
required

The access token

string
enum
Defaults to application/json

Generated from available response content types

Responses

403

Please login again to get new token.

Language
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
Sent OTP Response
Regular Sent Response
Operator Change
Sim Card Change
Blocked by Blacklist
Regular Response
MSISDN Denied