WhatsApp Business

WhatsApp Business API integration with managed OAuth. Send messages and manage templates

WhatsApp Business is a community skill for WhatsApp Business API integration, covering message sending, template management, conversation handling, media attachments, and automated customer communication for business messaging.

What Is This?

Overview

WhatsApp Business provides programmatic access to WhatsApp messaging for business communication and customer engagement. It covers message sending that delivers text, images, documents, and interactive messages to customer phone numbers through the official Business API, template management that creates and manages pre-approved message templates required for initiating customer conversations, conversation handling that tracks message threads and maintains conversation state across multiple customer interactions, media attachments that send images, PDFs, videos, and other file types within messages, and automated responses that handle common customer inquiries with bot-driven workflows. The skill enables businesses to integrate WhatsApp into their customer support and marketing automation systems.

Who Should Use This

This skill serves customer support teams automating WhatsApp responses, marketing teams running messaging campaigns, and e-commerce businesses sending order confirmations, shipping updates, and post-purchase follow-up messages to customers at scale.

Why Use It?

Problems It Solves

Manual WhatsApp messaging does not scale for businesses with high customer communication volumes. WhatsApp Business App lacks automation capabilities and API access for integration with existing business systems such as CRMs or order management platforms. Starting customer conversations requires pre-approved templates due to WhatsApp anti-spam policies. Tracking conversation context across multiple customer service agents becomes difficult without centralized messaging infrastructure.

Core Highlights

Message sender delivers text and media to customer phone numbers via official API. Template engine manages pre-approved message formats for conversation initiation. Conversation tracker maintains message threads and interaction history. Media handler sends images, documents, and videos within messages.

How to Use It?

Basic Usage

import requests
import os

token = os.environ['WHATSAPP_TOKEN']
phone_id = os.environ['WHATSAPP_PHONE_ID']

url = (
    f'https://graph.facebook.com'
    f'/v18.0/{phone_id}/messages'
)

data = {
    'messaging_product': 'whatsapp',
    'to': '+1234567890',
    'type': 'template',
    'template': {
        'name': 'hello_world',
        'language': {'code': 'en_US'}
    }
}

response = requests.post(
    url,
    json=data,
    headers={
        'Authorization': f'Bearer {token}'
    }
)

Real-World Examples

order_message = {
    'messaging_product': 'whatsapp',
    'to': '+1234567890',
    'type': 'template',
    'template': {
        'name': 'order_confirmation',
        'language': {'code': 'en'},
        'components': [{
            'type': 'body',
            'parameters': [
                {'type': 'text',
                 'text': 'ORD-12345'},
                {'type': 'text',
                 'text': '$99.99'}
            ]
        }]
    }
}

requests.post(url, json=order_message,
    headers={'Authorization':
             f'Bearer {token}'})

media_msg = {
    'messaging_product': 'whatsapp',
    'to': '+1234567890',
    'type': 'image',
    'image': {
        'link': 'https://example.com'
                '/product.jpg'
    }
}
requests.post(url, json=media_msg,
    headers={'Authorization':
             f'Bearer {token}'})

Advanced Tips

Use webhook endpoints to receive incoming messages and build two-way conversation flows rather than only sending outbound notifications. Create message templates with variable placeholders to personalize messages while staying within WhatsApp approval requirements. Implement rate limiting and queue management to handle high volumes of outbound messages without hitting API limits. Logging API responses and tracking message status codes helps identify delivery failures early and improves overall reliability.

When to Use It?

Use Cases

Send automated order confirmations and shipping updates to customers who opt in to WhatsApp notifications. Build a customer support chatbot that handles common inquiries such as order status or return policies, and escalates complex issues to human agents. Run marketing campaigns with personalized promotional messages sent to opted-in customer segments.

Related Topics

WhatsApp Business API, messaging automation, customer engagement platforms, chatbots, conversational marketing, and notification systems.

Important Notes

Requirements

Approved WhatsApp Business Account with access to the official Business API through Meta. Access token and phone number ID configured for sending messages programmatically. Pre-approved message templates created through the WhatsApp Business Manager for initiating conversations.

Usage Recommendations

Do: obtain explicit opt-in consent from customers before sending WhatsApp messages to comply with privacy regulations. Use approved message templates for the first message in a conversation since freeform messages are only allowed within 24-hour response windows. Implement webhook handlers to process delivery receipts and incoming messages.

Don't: send unsolicited marketing messages to users who have not opted in since this violates WhatsApp policies and may result in account suspension. Exceed rate limits since API throttling can cause message delivery delays. Ignore message template approval requirements since unapproved templates cannot be sent.

Limitations

Message templates must be pre-approved by WhatsApp which can take several hours to days depending on review queue. The 24-hour conversation window limits freeform messaging to recent customer interactions only. API access requires approval and is not available for all business types or regions. Costs apply per conversation based on WhatsApp Business pricing tiers, which vary by country and conversation category.