Connect your WhatsApp Business account to Tavio using the Meta Cloud API. Customers message your WhatsApp number and receive AI-powered responses.
Prerequisites
- A Meta Business account with WhatsApp Business API access
- A verified WhatsApp Business phone number
- A Meta App with WhatsApp product enabled
Required Credentials
Configure these in Dashboard > Channels > WhatsApp:
| Field | Description |
|---|---|
| phone_number_id | Your WhatsApp Business phone number ID from Meta dashboard |
| access_token | Permanent access token from Meta App settings |
| verify_token | A secret string you create for webhook verification |
Webhook Setup
In your Meta App's WhatsApp settings, set the webhook URL to:
Webhook URL
text
https://bankmind.aihookd.site/api/channels/whatsappSubscribe to the messages webhook field. Meta will send a GET request to verify the webhook using your verify_token, then POST message events to the same URL.
Message Flow
- Customer sends a WhatsApp message to your business number
- Meta forwards the message to your webhook URL
- Tavio extracts the message text, sender phone number, and message ID
- The message is routed through the unified AI pipeline
- The AI response is sent back via the Meta Cloud API to the customer
Inbound Payload
Meta webhook payload (simplified)
json
{
"object": "whatsapp_business_account",
"entry": [{
"changes": [{
"value": {
"messages": [{
"from": "254712345678",
"type": "text",
"text": { "body": "What is my account balance?" },
"timestamp": "1700000000"
}]
}
}]
}]
}Sending Responses
Tavio sends replies using the Meta Cloud API. Responses are capped at 500 tokens to fit WhatsApp message best practices.
Outbound API call (handled by Tavio)
bash
curl -X POST "https://graph.facebook.com/v18.0/PHONE_NUMBER_ID/messages" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "254712345678",
"type": "text",
"text": { "body": "Your current balance is KES 15,420.00" }
}'