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

  1. Clone WAHA repository
  2. Install Node.js dependencies
  3. Configure environment variables
  4. Start the server
2

Connect WhatsApp

  1. Access WAHA dashboard (default: http://localhost:3000)
  2. Click "Connect New WhatsApp"
  3. Scan QR code with your WhatsApp
  4. 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

  1. Log into your AI4Africa dashboard
  2. Navigate to Bot Settings → WhatsApp Integration
  3. Select WAHA as provider
  4. Enter your WAHA server URL
  5. Save the webhook URL provided
4

Configure Webhooks

  1. In WAHA dashboard, go to Webhook Settings
  2. Enter the AI4Africa webhook URL
  3. Select events to forward (messages, status updates, etc.)
  4. 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:

  1. Sending a test message to your connected WhatsApp number
  2. Checking if messages appear in AI4Africa dashboard
  3. Verifying bot responses are received
  4. 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]