Limited Time Offer- LTO

cURL

curl --location '{{api_front_base_url}}/wa/api/v1/template/msg' \
--header 'apikey: {{apiKey}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source={{source phone number}}' \
--data-urlencode 'destination={{destination phone number}}' \
--data-urlencode 'src.name={{app_name}}' \
--data-urlencode 'template={"id":"{{template_id}}","params":{{template_params_list}},"expiration":{{expiration_time_in_UNIX_timestamp_in_milliseconds.}} }' \
--data-urlencode 'message={{message}}' \
--data-urlencode 'postbackTexts=[{"index":<qr_btn_index>,"text":"<postback_text>"}]'

📘

  • Expiration must be provided for LTO templates created where has_expiration is true
  • Include the message object in the curl above only if the template has media. Refer image, video and document template docs to get the corresponding message payloads.
  • Omit the postbackTexts parameter in the curl above if the template doesn’t have quick reply buttons, or if it has but there’s no need for postback text support.

Request Parameters

NameInDescriptionRequiredTypeExample
apikeyheaderYour account API keytruestring2xxc4x4xx2c94xxxc2f9xx9d43xxxx8a

Form Parameters

NameTypeDescriptionRequiredExample
sourcestringSender Whatsapp Numbertrue919163xxxxx3
src.namestringApp name that the source number belongs totrueDemoApp
destinationstringReceiver Whatsapp Numbertrue917839xxxxx3
templateobjectContains template id, list of template parameters, and expiration for LTO templatetrue
messageobjectOptional; required for media LTO templatesfalse

Object Structures

Template Object

NameTypeDescriptionRequiredExample
idstringTemplate IDtrue"template_id"
paramsarrayList of template parameters in LTO templatetrue["param1", "param2"]
expirationintegerExpiration time in UNIX timestamp in millisecondstrue1644912000000

Message Object

Image Header

NameTypeDescriptionExample
typestringType of message (must be "image")image
imageobjectImage object containing id / link
linkstringMedia URL of the image"<image_media_url>"
idstringMedia ID of the image"<image_media_id>"

Video Header

NameTypeDescriptionExample
typestringType of message (must be "video")video
videoobjectVideo object containing id / link
linkstringMedia URL of the video"<video_media_url>"
idstringMedia ID of the video"<video_media_id>"

Postback Texts

NameTypeDescriptionExample
indexintegerButton index (0-based)0
textstringPostback text for the buttonhello

Channel

NameTypeDescriptionExample
channelstringMessaging Platform Namewhatsapp

Status Codes

Status CodeDescriptionResponse Schema
202Success response{ "status": "success", "messageId": "message id" }
400Error response; in case of bad request{ "status": "error", "message": "Invalid Destination" }
401Error response; in case of authentication failure{ "status": "error", "message": "Authentication Failed" }
Language
Click Try It! to start a request and see the response here!