With this API you'll be able to submit a WhatsApp template creation request to Meta. Note that a template can not be used until Meta approves it. Typically, the templates are approved within 5 minutes from the request submission but may take up to 24 hours. This might change in the future though and we'll update accordingly. You'll have to fetch the templates from time to time to get their latest status.
language - a language object. It only has one property called code and you can see all the supported language codes here
template_components - a list of the components that represent the template structure
Template Components
WhatsApp templates have media size limits. To know about them visit Meta documentation
Header
Template headers have 4 types:
TYPE_TEXT - text header. If you want to specify the dynamic text content in the header you can do so like this {{1}}. ONLY ONE VARIABLE IS ALLOWED IN THE HEADER.
Body
In the body component, you specify the template's main text content.
The template body supports the variables. These are dynamic fields that can be replaced with different text values when you send out the templates. See here for information on how to send the templated messages.
If you want to specify the variable in the template body, use the following syntax:
{{1}} # just one variable
{{1}} {{2}} # two variables
{{1}} {{2}} {{3}} # three variables
{{1}} {{2}} {{3}} {{4}} # four variables
# and etc
Whenever you specify the number wrapped around the curly braces (e.g {{1}}), you indicate it is a variable.
The variables must be numerated from 1-15 For example, if you have 4 variables their numbers must be strictly increasing with each. We do not allow duplicates in the variable numbers and you can not skip the number.
Footer
The message template footer.
Button
The buttons are interactive components that you use to interact with your recipients.
You can use up to 3 buttons per template.
There are two types of buttons supported on the templates:
quickReply - when a Quick Reply button is tapped, a message containing the button text is sent in the conversation. Quick Reply buttons can trigger auto responses.
url - take your customers to your website. WhatsApp automatically disapproves shortened links (eg. bit.ly). Please use the full URL and add UTM parameters if required for tracking.
phoneNumber - allow your customers to call you directly.
Note that you can't have Quick Reply and Call-To-Action buttons simultaneously(up to 3 quick reply buttons OR call to action with either URL and/or phone)