← Back to Guides
integrationAdvanced25 min read time

Connect WhatsApp Business API

Complete guide for integrating WhatsApp Business API with Bravin AI, including provider setup, webhooks, and automation.

Author: Bravin AI Team
Published on January 25, 2024
Updated on March 10, 2024

Introduction

WhatsApp Business API allows you to automate conversations with customers on WhatsApp, the world's most popular messaging platform.

Benefits:

  • Access to 2+ billion WhatsApp users
  • 98%+ open rates (vs. 20% email)
  • Multimedia support (images, video, documents)
  • Official verification (green checkmark)

WhatsApp Business API is different from the WhatsApp Business app. The API requires a Business Solution Provider (BSP).

Prerequisites

1. Facebook Business Manager Account

  • Create an account at business.facebook.com
  • Verify business identity

2. Dedicated Phone Number

  • Cannot be used on personal WhatsApp
  • Must be able to receive SMS for verification

3. Business Solution Provider Bravin AI recommends:

  • Twilio
  • MessageBird
  • 360Dialog

Facebook verification process takes 3-5 business days.

Provider Setup

Step 1: Register with BSP Choose a provider and create an account. For Twilio:

Never share Twilio credentials publicly or in frontend code!

Required Credentials
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_PHONE_NUMBER=+1234567890

Configure Webhooks

Webhooks are essential for receiving messages in real-time.

In Twilio Console:

  1. Go to Phone Numbers → Active Numbers
  2. Select your WhatsApp number
  3. Under "When a message comes in", set:

Bravin AI automatically processes all received messages and routes them to the AI agent.

Webhook URL
https://api.bravin.ai/webhooks/whatsapp/YOUR_ACCOUNT_ID

Message Templates

WhatsApp requires approved templates to initiate conversations (first 24h).

Create a Template:

  1. Go to WhatsApp → Message Templates
  2. Click Create Template
  3. Define name, category, language
  4. Add content with variables

Templates are reviewed by WhatsApp within 24-48 hours. Make sure they comply with their policies.

Template Example
Hi {{1}}! 👋
Your order #{{2}} has been confirmed and will arrive in {{3}} days.
Questions? Message us anytime!

Test Integration

1. Test Inbound Message

  • Send a WhatsApp message to your connected number
  • Check Dashboard → Conversations
  • You should see the message and agent response

2. Test Outbound Message

  • Use an approved template
  • Send from Dashboard to your number
  • Verify receipt and formatting

Test with 3-5 complete conversations before announcing to customers.

Best Practices

1. Respect 24h Window

  • After customer message, you have 24h for free responses
  • Then you must use templates

2. Explicit Opt-in

  • Get customer permission for WhatsApp
  • Provide opt-out option

3. Monitor Rating

  • WhatsApp Rating must be > 80% (High Quality)
  • Below 80% = warning, below 60% = restrictions

4. Respond Quickly

  • Target: < 5 minutes for first interaction
  • Use AI agent for 24/7 availability

Violating WhatsApp policies can lead to permanent account suspension.

Was this guide helpful?