Sending WABA Templates and OTP via WazzaBee API
The public WazzaBee API now supports sending approved WhatsApp templates (HSM), including the AUTHENTICATION category for sending OTP codes.
Method: POST /v1/messages/send
The messaging endpoint has been extended. To send a template, you must pass the templateName parameter (along with related data) instead of text.
An authentication template has one variable, the code itself, and a COPY_CODE button. Pass the code in templateVariables under "1", and the API puts the same code into the button on its own. Example: {"1": "456789"}. If the request has no code, the message is not sent and its status shows an error with a hint.
Template buttons: templateButtons
The optional templateButtons array passes values into template buttons. For a URL button with a variable (a link like https://site.kz/check/{{1}}), put the end of the link in value. For a quick reply button, put your own payload in value, for example a customer or receipt ID: when the button is tapped, it comes back in the messages_button webhook in button.payload.
index: the button's position in the template, starting from zero. Button numbering is separate from the text variables{{1}},{{2}}.type:urlorquick_reply,urlby default.value: the end of the link or the payload, up to 2000 characters.
"templateButtons": [
{ "index": 0, "type": "quick_reply", "value": "rate_5:client_42" },
{ "index": 3, "type": "url", "value": "42" }
]Buttons you do not pass are sent as defined in the template. WhatsApp does not report URL button taps to anyone, only the linked website sees them. To record a customer action in your system (for example, "Stop"), use a quick reply button.
