Skip to main content

WhatsApp Business Integration

WhatsApp Business integration allows you to send and receive messages, media, and interactive content through WhatsApp’s official Business API. This integration is perfect for customer support, sales, and marketing automation.

Getting Started

Prerequisites

  • WhatsApp Business Account
  • Facebook Business Manager account
  • Verified phone number
  • Business verification (for some features)

Setup Process

1

Create WhatsApp Business Account

  1. Go to business.whatsapp.com
  2. Sign up with your business information
  3. Verify your business details
  4. Complete the onboarding process
2

Connect to Kaie

  1. Navigate to Integrations in your Kaie dashboard
  2. Select “WhatsApp Business” from the available integrations
  3. Click “Connect Account”
  4. Authorize Kaie to access your WhatsApp Business account
3

Configure Settings

  1. Set your business display name
  2. Upload your business logo
  3. Configure message templates
  4. Set up webhook endpoints

Message Types

Text Messages

Send simple text messages to customers.
  • Plain text messages
  • Emoji support
  • Basic formatting (bold, italic, strikethrough)
  • Variable substitution
{
  "type": "text",
  "text": "Hello {{customer_name}}, how can I help you today?",
  "preview_url": false
}

Media Messages

Send images, videos, documents, and audio files.
  • Images: JPG, PNG, GIF (max 5MB)
  • Videos: MP4, 3GPP (max 16MB)
  • Documents: PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX (max 100MB)
  • Audio: AAC, M4A, AMR, MP3, OGG (max 16MB)
{
  "type": "image",
  "image": {
    "link": "https://example.com/image.jpg",
    "caption": "Check out our latest product!"
  }
}

Interactive Messages

Send buttons, lists, and quick replies for better user engagement.
  • Up to 3 buttons per message
  • Call-to-action buttons
  • URL buttons
  • Quick reply buttons
  • Up to 10 list items
  • Section headers
  • Descriptions and emojis
  • Interactive selection

Template Messages

Send pre-approved message templates for marketing and notifications.
  • Marketing: Promotional content
  • Utility: Account updates, notifications
  • Authentication: OTP, verification codes
  • Must be approved by WhatsApp
  • Follow specific formatting rules
  • Include required parameters
  • Respect messaging policies

Webhook Configuration

Setting Up Webhooks

Configure webhooks to receive incoming messages and status updates.
  • messages: Incoming customer messages
  • message_status: Delivery and read receipts
  • message_errors: Failed message notifications
  1. Go to your WhatsApp Business API settings
  2. Add webhook URL: https://api.kaie.ai/webhooks/whatsapp
  3. Verify webhook with challenge token
  4. Subscribe to required events

Webhook Payload Structure

Understand the structure of incoming webhook data.
{
  "object": "whatsapp_business_account",
  "entry": [
    {
      "id": "WHATSAPP_BUSINESS_ACCOUNT_ID",
      "changes": [
        {
          "value": {
            "messaging_product": "whatsapp",
            "metadata": {
              "display_phone_number": "PHONE_NUMBER",
              "phone_number_id": "PHONE_NUMBER_ID"
            },
            "messages": [
              {
                "id": "MESSAGE_ID",
                "from": "CUSTOMER_PHONE_NUMBER",
                "timestamp": "TIMESTAMP",
                "text": {
                  "body": "MESSAGE_TEXT"
                },
                "type": "text"
              }
            ]
          },
          "field": "messages"
        }
      ]
    }
  ]
}

Workflow Integration

Message Triggers

Set up workflows that respond to incoming WhatsApp messages.
  • Message Content: Respond to specific text
  • Media Type: React to images, videos, etc.
  • Customer Type: New vs. existing customers
  • Time-based: Business hours only
  • Customer Support: Answer common questions
  • Order Status: Provide order updates
  • Appointment Booking: Schedule meetings
  • Product Information: Share product details

Automated Responses

Configure AI-powered responses for customer inquiries.
  • Instant Replies: Quick responses to common questions
  • AI-Generated: Intelligent responses using AI Brain
  • Template-Based: Pre-written responses for specific scenarios
  • Escalation: Route complex issues to human agents
  • Set response time limits
  • Configure escalation rules
  • Define conversation flows
  • Set up fallback responses

Advanced Features

Rich Media Support

Send engaging content with images, videos, and documents.
  • High-quality image sharing
  • Caption support
  • Thumbnail generation
  • Format optimization
  • Video preview generation
  • Caption support
  • Format conversion
  • Size optimization

Interactive Elements

Create engaging conversations with interactive components.
  • Pre-defined response options
  • Easy customer selection
  • Workflow branching
  • Data collection
  • Visit website
  • Call phone number
  • Send email
  • Custom actions

Message Status Tracking

Monitor message delivery and engagement.
  • Sent: Message sent to WhatsApp
  • Delivered: Message delivered to customer
  • Read: Customer opened the message
  • Failed: Message delivery failed
  • Track campaign performance
  • Monitor customer engagement
  • Identify delivery issues
  • Optimize send times

Best Practices

Message Guidelines

Follow WhatsApp’s messaging policies and best practices.
  • Keep messages relevant and valuable
  • Avoid spammy or promotional content
  • Respect customer preferences
  • Follow WhatsApp’s terms of service
  • Send messages during business hours
  • Respect customer time zones
  • Avoid excessive messaging
  • Allow opt-out options

Performance Optimization

Optimize your WhatsApp integration for better performance.
  • Use appropriate message types
  • Optimize media file sizes
  • Test message rendering
  • Monitor delivery rates
  • Minimize response times
  • Use efficient trigger conditions
  • Implement proper error handling
  • Monitor workflow performance

Troubleshooting

Common Issues

Resolve common WhatsApp integration problems.
  • Check phone number format
  • Verify webhook configuration
  • Review message content
  • Check rate limits
  • Verify API credentials
  • Check token expiration
  • Review permissions
  • Test webhook connectivity

Error Codes

Understand common error codes and their solutions.
Error CodeDescriptionSolution
100Invalid parameterCheck message format
131000Message undeliverableVerify phone number
131021Re-engagement messageUse template message
131026Unsupported message typeUse supported format

Next Steps

Explore more integration options: