Help Center> Message & SMS> FAQs> Template> How Do I Configure Variables in an SMS Template?
Updated on 2022-09-01 GMT+08:00

How Do I Configure Variables in an SMS Template?

When calling the SMS Sending API or Batch SMS Sending API, you can use the templateParas parameter to configure variables.

templateParas is a list of SMS template variables used to fill in the variables in the template specified by the templateId parameter in sequence. Its value is in JSONArray format. For details, see Template and Variable Specifications.

The number and the length of variables in the list must be consistent with those defined in the template specified by the templateId parameter. For example, if the template specified by templateId contains two variables with lengths of 5 and 6, the list must contain two corresponding variables with lengths 5 and 6, respectively.

If the template content is "You have ${NUM_5} parcels delivered to ${TXT_6}, this parameter can be set to '["3","Gate of People's Park"]'.

Template FAQs

more