Example: WhatsApp Reply Buttons
This article shows how to build a Custom Tool in Frontline that sends interactive reply buttons using the WhatsApp Cloud API. Reply buttons are perfect for quick yes/no choices, short menus (up to 3 options), and low‑friction confirmations.
Heads‑up: Reply button messages are only available within the 24‑hour service window after the user’s last message (they are not template messages). If you need to message outside the 24‑hour window, use a template instead.
⚙️ What you’ll need
Phone Number ID for your WhatsApp Business number (Cloud API).
A valid Access Token.
Recipient phone in E.164 format (e.g.,
+598...).
🚀 Step‑by‑step in Frontline
1) Create the Custom Tool
Go to Platform → Tools → Create Tool.
Name: Send WhatsApp Buttons.
Tool type: Custom Tool.
When to use: e.g., ask for quick confirmation or route selection.
2) Configure the API request
Method:
POSTURL:
https://graph.facebook.com/v21.0/{PHONE_NUMBER_ID}/messagesHeaders:
Authorization: Bearer {ACCESS_TOKEN}Content-Type: application/json
Request Body (example):
{ "messaging_product": "whatsapp", "to": "{phone}", "type": "interactive", "interactive": { "type": "button", "body": { "text": "How can we help you today?" }, "footer": { "text": "Choose one option" }, "action": { "buttons": [ { "type": "reply", "reply": { "id": "sales", "title": "Sales" }}, { "type": "reply", "reply": { "id": "support", "title": "Support" }}, { "type": "reply", "reply": { "id": "billing", "title": "Billing" }} ] } } }3) Add data inputs
Add inputs like phone so your Agent can collect them in the conversation.
4) Test and save
Use Test Response. If you receive 200 OK and see the buttons on the device, click Save Tool.
🧠 How replies come back
When a user taps a button, WhatsApp sends an interactive reply with a button_reply payload that includes the selected id and title. Use these values in your Intents/Flows to branch the conversation (e.g., id = support → route to Support).
✅ Best practices
Maximum 3 buttons per message.
Keep button titles ≤ 20–25 chars for readability.
Use machine‑friendly IDs (e.g.,
sales,support).If session might be expired, prompt the user first to re‑open the 24‑hour window.
🔍 Troubleshooting
400 Bad Request: Confirm JSON structure (
interactive.type = button) and at least 1, max 3 buttons.401/403: Check token and Phone Number ID permissions.
Buttons not showing: Ensure you’re sending an interactive message, not plain
text.
Still have questions?
Reach out through the Help button in Frontline or contact your CSM for assistance.
