WAHA WhatsApp Integration
Connect your AI4Africa bot to WhatsApp using WAHA (WhatsApp HTTP API) - a free and open-source solution
Prerequisites
Before you begin, ensure you have:
- A smartphone with WhatsApp installed
- Stable internet connection
- Your AI4Africa account credentials
- A server to host WAHA (for production)
Setup Guide
1
Install WAHA
Choose your preferred installation method:
Docker Installation (Recommended)
docker run -d --name waha -p 3000:3000 devlikeapro/whatsapp-http-api
Manual Installation
- Clone WAHA repository
- Install Node.js dependencies
- Configure environment variables
- Start the server
2
Connect WhatsApp
- Access WAHA dashboard (default: http://localhost:3000)
- Click "Connect New WhatsApp"
- Scan QR code with your WhatsApp
- Wait for connection confirmation
Keep your phone connected to the internet. If your phone goes offline, WAHA will attempt to reconnect automatically.
3
Configure in AI4Africa
- Log into your AI4Africa dashboard
- Navigate to Bot Settings → WhatsApp Integration
- Select WAHA as provider
- Enter your WAHA server URL
- Save the webhook URL provided
4
Configure Webhooks
- In WAHA dashboard, go to Webhook Settings
- Enter the AI4Africa webhook URL
- Select events to forward (messages, status updates, etc.)
- Save webhook configuration
Production Setup
For production environments, consider these additional steps:
- Deploy WAHA on a dedicated server
- Set up SSL/TLS for secure connections
- Configure automatic restarts
- Set up monitoring and alerts
- Use a dedicated business WhatsApp number
Testing Your Integration
Verify your setup by:
- Sending a test message to your connected WhatsApp number
- Checking if messages appear in AI4Africa dashboard
- Verifying bot responses are received
- Testing different message types (text, media, etc.)
Your bot should respond automatically to incoming messages when properly configured.
Troubleshooting
Common Issues
- Connection drops frequently
- QR code scan fails
- Messages not being forwarded
Solutions
- Check internet connectivity
- Restart WAHA service
- Verify webhook configuration
Need Help?
Contact our support team at [email protected]