Template Bypass using Business Manager

With the bypass template feature, you can create templates directly from the WhatsApp Business Manager website (BM) and use these templates through Kaleyra’s Send Message API to send messages to the end customers.

The Bypass Template functionality is an alternative way of creating and using templates for your communication over the kaleya.io WhatsApp channel. Of course, you can still create templates through Kaleyra APIs.

The Bypass Template feature supports the following four types of buttons in any template created through BM:

  • URL Buttons
  • Copy Code (Coupon) Button
  • Quick Reply Buttons
  • Phone Number Buttons

The following types of headers can be added to any of the templates:

  • Text
  • Image
  • Video
  • Document

📘

Note:

URL (Static or Dynamic), Phone Number, and Quick Reply can be bypassed only if the header value is set as none.

Prerequisites:

Prerequisites for using the Bypass Template feature are:

  • Active Kaleyra.io account.
  • A WhatsApp business number.
  • A WhatsApp verified and approved profile.
  • Activated and verified WhatsApp Business Account (WABA).

Parameters and Data Types

Following is the list of parameters and data types that have been added to the sendMessage API:

ParameterData TypeDescriptionExampleMandatory
media_typeStringThis will hold the value indicating the type of media being attached while sending the message.media_type: image/video/documentIf used at the header level, then it is mandatory, else not.
coupon_codeStringThis field will hold the text that needs to be copied when the COPY CODE button is clicked.coupon_code: “250OFF”If the template has a copy code, then it is mandatory.
coupon_code_indexIntegerThis will hold the index/position of the COPY CODE button in the buttons array.
(Indexing always starts from 0)
If the template has two buttons: PHONE_NUMBER, COPY_CODE, then coupon_code_index : 1

If the template has three buttons: PHONE_NUMBER, URL, COPY_CODE, then coupon_code_index : 2
If the template has a copy code, then it is mandatory.
dynamic_url_indexIntegerThis will hold the index/position of the DYNAMIC URL button in the buttons array.
(Indexing always starts from 0)
If the template has two buttons: URL(Dynamic), COPY_CODE, then dynamic_url_index : 0

If the template has three buttons: PHONE_NUMBER, URL(DYNAMIC), COPY_CODE, then dynamic_url_index : 1
If the template has a dynamic URL, then it is mandatory.
quick_reply_buttonsIntegerThis will hold the number of QUICK_REPLY buttons in the template
MAXIMUM - 3
If the template has three QUICK_REPLY buttons
{"type":"QUICK_REPLY",

"quick_reply1":"Yes",

"quick_reply2":"No",

"Quick_reply3":"NA"
}
quick_reply_buttons : 3
If the template has quick reply buttons, then it is mandatory.
quick_reply_indexIntegerThis will hold the index/position of the QUICK REPLY button in the buttons array.
(Indexing always starts from 0)
If the template has four buttons: URL(Dynamic), COPY_CODE, PHONE_NUMBER, QUICK_REPLY, then, quick_reply_index : 3

If the template has three buttons: QUICK_REPLY, URL(DYNAMIC), COPY_CODE, then quick_reply_index : 0
If the template has quick reply buttons, then it is mandatory.

📘

Note:

A maximum of one COPY_CODE button and one URL BUTTON(STATIC/DYNAMIC) per template are supported currently.

Sample Code

Following is the sample header text with one variable, body with one variable, coupon code as first button, dynamic URL as second button, phone number as third button, and quick reply as fourth button including one button count:

curl --location 'https://api.kaleyra.io/v1/HXINxxxxxxxxxx4IN/messages' \
--header 'api-key: A5afcxxxxxxxxxxxxxxx6cb1dc' \
--form 'to="91xxxxxxxx74"' \
--form 'type="mediatemplate"' \
--form 'template_name="textvar1bodyvar1_couponcode_dynamic_phone_quickreply1"' \
--form 'params="\"abc\""' \
--form 'channel="whatsapp"' \
--form 'from="+918xxxxxxx27"' \
--form 'callback_url="https://webhook.site/a2axxxxx-0c1d-xxxx-axxa-12d9xxxxxf70"' \
--form 'param_header="\"value\""' \
--form 'quick_reply_buttons="1"' \
--form 'param_url="images"' \
--form 'dynamic_url_index="1"' \
--form 'quick_reply_index="3"' \
--form 'coupon_code="\"250OFF\""' \
--form 'coupon_code_index="0"'