URL of website that loads in the device's default mobile web browser when the URL button is tapped by the app user.
Supports 1 variable, appended to the end of the URL string.
Maximum 2000 characters.
https://www.luckyshrub.com/shop?promo={{1}}
<URL_BUTTON_VAR_EXAMPLE>
String
Required if using a URL button.
URL of website. Supports 1 variable.
If using a variable, add sample variable property to the end of the URL string. The URL loads in the device's default mobile web browser when the customer taps the URL button.
A message bubble is required. Message bubbles are text-only and support variables.
Carousel Cards
Carousel templates support up to 10 carousel cards. Cards must have a media header (image or video) and can optionally include body text and up to 2 quick reply buttons, phone number buttons, or URL buttons (button types can be mixed).
The media header format and buttons must be the same across all cards that make up a carousel template.
Media assets will be cropped to a wide ratio based on the customer's device.
Example Request
{"name":"summer_carousel_promo_2023","language":"en_US","category":"MARKETING","components": [ {"type":"BODY", "text": "Summer is here, and we have the freshest produce around! Use code {{1}} to get {{2}} off your next order.",
"example": {"body_text": [ ["15OFF","15%" ] ] } }, {"type":"CAROUSEL","cards": [ {"components": [ {"type":"HEADER","format":"IMAGE","example": {"header_handle": ["4::aW..." ] } }, {"type":"BODY","text":"Rare lemons for unique cocktails. Use code {{1}} to get {{2}} off all produce.","example": {"body_text": [ ["15OFF","15%" ] ] } }, {"type":"BUTTONS","buttons": [ {"type":"QUICK_REPLY","text":"Send more like this" }, {"type":"URL","text":"Buy now","url":"https://www.luckyshrub.com/shop?promo={{1}}","example": ["https://www.luckyshrub.com/shop?promo=summer_lemons_2023" ] } ] } ] }, {"components": [ {"type":"HEADER","format":"IMAGE","example": {"header_handle": ["4::aW..." ] } }, {"type":"BODY","text":"Exotic fruit for unique cocktails! Use code {{1}} to get {{2}} off all exotic produce.","example": {"body_text": [ ["20OFFEXOTIC","20%" ] ] } }, {"type":"BUTTONS","buttons": [ {"type":"QUICK_REPLY","text":"Send more like this" }, {"type":"URL","text":"Buy now","url":"https://www.luckyshrub.com/shop?promo={{1}}","example": ["https://www.luckyshrub.com/shop?promo=exotic_produce_2023" ] } ] } ] } ] } ]}'
It is only possible to send Templates with an Active status. A message template's status can change automatically from Active to Paused or Disabled based on feedback from customers. For this reason, we recommend that you monitor status changes to take appropriate actions whenever a message template that you rely upon becomes, or is in danger of becoming, paused or disabled.
Properties
Placeholder
Description
Example Value
<BUBBLE_TEXT_VARIABLE>
String
Required if the message bubble uses variables.
Message bubble text variable.
There is no maximum character limit on this value, but counts against the message bubble limit of 1024 characters.
20OFF
<BUTTON_INDEX>
Integer
Required.
Zero-indexed order in which button appears at the bottom of the template message. 0 indicates the first button, 1 indicates second button, etc.
0
<CARD_INDEX>
Integer
Required.
Zero-indexed order in which card appears within the card carousel. 0 indicates first card, 1 indicates second card, etc.
0
<CARD_BODY_VARIABLE>
String
Required if card body text uses a variable.
Card body text variable.
There is no maximum character limit on this value, but counts against the card body text limit of 160 characters.
20OFF
<HEADER_ASSET_ID>
Media asset handle
Required.
Uploaded media asset ID. Use the /media endpoint to generate an ID.
24230790383178626
<QUICK_REPLY_BUTTON_PAYLOAD>
String
Optional.
Value to be included in messages webhooks (messages.button.payload) when the button is tapped.
Name of the template to be sent in the template message.
summer_carousel_promo_2023
<TO>
String
Required.
Phone number of customer who the template message should be sent to.
16505555555
<URL_BUTTON_PAYLOAD>
String
Required if the URL button uses a variable.
URL button variable value.
last_chance_2023
Post Body
{"messaging_product":"whatsapp","recipient_type":"individual","to":"<TO>","type":"template","template": {"name":"<TEMPLATE_NAME>","language": {"code":"<TEMPLATE_LANGUAGE_CODE>" },"components": [/* Message bubble; can omit if template message bubble has no variables */ {"type":"BODY","parameters": [ {"type":"TEXT","text":"<BUBBLE_TEXT_VARIABLE>" } ] },/* Carousel cards */ {"type":"CAROUSEL","cards": [/* Card one */ {"card_index": <CARD_INDEX>,"components": [ {"type":"HEADER","parameters": [ {/* Required if template uses image header, otherwise omit */"type":"IMAGE","image": {"id":"<HEADER_ASSET_ID>" }/* Required if template uses video header, otherwise omit */"type": "VIDEO","video": {"id":"<HEADER_ASSET_ID>" } } ] },/* Can be omitted if card body text in template has no variables */ {"type":"BODY","parameters": [ {"type":"text","text":"<CARD_BODY_VARIABLE>" } ] }, {"type":"BUTTON","sub_type":"QUICK_REPLY","index":"<BUTTON_INDEX>","parameters": [ {"type":"PAYLOAD","payload":"<QUICK_REPLY_BUTTON_PAYLOAD>" } ] }, {"type":"BUTTON","sub_type":"URL","index":"BUTTON_INDEX","parameters": [ {"type":"PAYLOAD","payload":"<URL_BUTTON_PAYLOAD>" } ] } ] } ] },/* Additional cards would follow, using same structure as card above. Must define a card for every card that the template uses. */ ] }}
Example Request
Example request to send a carousel template that uses a message bubble requiring values for two variables, and 2 carousel cards that each use an image header and require values for body text and button variables.