WhatsApp Business Integration Setup
Connect your own WhatsApp Business number to AskYourDatabase for direct messaging capabilities. This guide will walk you through setting up a Twilio account, configuring WhatsApp Business API, and connecting it to your chatbot.
Overview
By setting up your own WhatsApp Business integration, you can:
- Use your own WhatsApp Business phone number
- Have full control over message delivery and rates
- Customize WhatsApp templates and branding
- Access detailed messaging analytics through Twilio
Prerequisites
Before starting, ensure you have:
- A verified WhatsApp Business account
- A Twilio account (we'll help you create one)
- Your chatbot already created and configured in AskYourDatabase
Step 1: Create a Twilio Account
-
Sign up for Twilio
- Go to console.twilio.com (opens in a new tab)
- Click "Sign up" and create your account
- Complete email verification
-
Verify your account
- Provide phone number verification
- Add billing information (required for WhatsApp Business API)
-
Get your account credentials
- Note down your Account SID and Auth Token from the dashboard
- These will be needed later for configuration
Step 2: Set Up WhatsApp Business Account
-
Access WhatsApp Senders
- In your Twilio Console, navigate to Messaging → Senders → WhatsApp senders
- Click "Create new sender"
-
Register your WhatsApp Business number
- Select "Use an existing WhatsApp Business Account"
- Follow the WhatsApp Business Account registration process
- Verify your business information and phone number
-
Complete WhatsApp Business verification
- Provide required business documentation
- Wait for Meta's approval (typically 1-3 business days)
- Ensure your WhatsApp Business Account ID is noted
Step 3: Configure WhatsApp Sender in Twilio
-
Create WhatsApp Sender
- In Twilio Console, go to Messaging → Senders → WhatsApp senders
- Click "Create new sender"
-
Configure sender details
- Business display name: Your business name as it appears to customers
- WhatsApp Business Account ID: From your Meta Business Manager
- Phone number: Your WhatsApp Business phone number (format: +1234567890)
-
Set webhook URL
- Webhook URL for incoming messages:
https://www.askyourdatabase.com/api/whatsapp/webhook
- HTTP Method: POST
- Content Type: application/x-www-form-urlencoded
- Webhook URL for incoming messages:
- Save configuration
- Review all settings
- Click "Create sender"
- Wait for the sender to be activated (status should show "Online")
Step 4: Configure Message Templates (Optional)
WhatsApp Business API requires approved templates for certain message types:
-
Access Content Template Builder
- In Twilio Console, go to Messaging → Content Template Builder
- Create templates for common scenarios (welcome messages, notifications)
-
Submit for approval
- Design your templates following WhatsApp's guidelines
- Submit to Meta for approval
- Wait for approval (typically 24-48 hours)
Step 5: Connect to AskYourDatabase
-
Add phone number to customer list
- In your AskYourDatabase dashboard, go to your chatbot settings
- Navigate to WhatsApp tab
- Add the WhatsApp Business phone numbers that should have access
- Format: +1234567890 (include country code)
-
Test the integration
- Send a test message from an authorized phone number to your WhatsApp Business number
- Verify that the chatbot responds correctly
- Check that messages appear in your AskYourDatabase chat history
Important Configuration Notes
Webhook URL
Always use the exact webhook URL:
https://www.askyourdatabase.com/api/whatsapp/webhook
Phone Number Format
- Always include the country code (e.g., +1 for US)
- No spaces, dashes, or special characters
- Correct: +15551234567
- Incorrect: (555) 123-4567, +1 555-123-4567
Message Limits
- WhatsApp Business API has rate limits
- Twilio provides 1,000 free messages per month for new accounts
- Check Twilio pricing for additional message costs
Troubleshooting
Common Issues
"Phone number not authorized" error
- Ensure the phone number is added to your customer list in AskYourDatabase
- Check that the number format includes the country code
- Verify the number matches exactly (no extra spaces or characters)
Webhook not receiving messages
- Verify the webhook URL is set correctly in Twilio
- Check that your WhatsApp sender status is "Online"
- Ensure messages are being sent from authorized phone numbers
WhatsApp sender showing "Offline"
- Complete Meta Business verification process
- Check that your WhatsApp Business Account is active
- Verify all required business information is provided
Testing Your Setup
-
Send a test message
From: [Authorized phone number] To: [Your WhatsApp Business number] Message: "Hello, show me my data"
-
Expected response
- The chatbot should respond with a relevant answer
- Response time should be within a few seconds
- Message should appear in your AskYourDatabase dashboard
-
Check logs
- Monitor your Twilio Console logs for delivery status
- Check AskYourDatabase chat history for message records
Security Considerations
- Webhook Security: The webhook endpoint validates Twilio signatures automatically
- Access Control: Only phone numbers in your customer list can interact with the chatbot
- Data Privacy: All messages are encrypted and stored securely
- Compliance: Ensure your WhatsApp usage complies with Meta's Business API policies
Pricing Information
Twilio Costs
- Setup: Free account creation
- Messages: Pay per message sent/received (rates vary by country)
- Phone Number: Monthly fee for WhatsApp Business number (if applicable)
WhatsApp Business API Costs
- Business-initiated messages: Charged per message
- User-initiated responses: Free within 24-hour window
- Template messages: Separate pricing for marketing messages
Visit Twilio's pricing page (opens in a new tab) for current rates.
Next Steps
After successful setup:
- Test thoroughly with different message types and scenarios
- Train your team on WhatsApp Business messaging best practices
- Monitor usage through Twilio Console analytics
- Scale up by adding more authorized phone numbers as needed
Support
If you encounter issues during setup:
- Check Twilio's WhatsApp Business API documentation
- Review Meta's WhatsApp Business API policies
- Contact AskYourDatabase support for chatbot-specific questions
- Use Twilio Support for account and messaging issues
Note: WhatsApp Business API approval and setup can take several business days. Plan accordingly when implementing this integration for production use.