Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    WhatsApp Business Notify — Python Cloud API Integration

    1

    Secure Python integration for WhatsApp Cloud API with webhook validation and session window management.

    $34.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    WhatsApp Business Notify — Python Cloud API Integration

    WhatsApp Business Notify — Python Cloud API Integration

    Example session with this skill installed

    I need a Python implementation for the WhatsApp Cloud API. I need to send templates, handle webhooks securely, and track the 24-hour session window.

    • Read your context and instructions
    • Compiled the whatsapp business notify

    I have generated a secure Python integration for the WhatsApp Business Cloud API. This includes the API client, webhook validator, and session management logic.

    WhatsApp Business Integration

    import hmac
    import hashlib
    import time
    from datetime import datetime, timezone, timedelta
    import requests
    
    class WhatsAppClient:
        def __init__(self, token, phone_number_id, version="v18.0"):
            self.base_url = f"https://graph.facebook.com/{version}/{phone_number_id}"
            self.headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
    
        def send_template(self, to, template_name, lang_code="en_US", components=None):
            payload = {
                "messaging_product": "whatsapp",
                "to": to,
                "type": "template",
                "template": {
                    "name": template_name,
                    "language": {"code": lang_code},
                    "components": components or []
                }
            }
            return requests.post(f"{self.base_url}/messages", json=payload, headers=self.headers)
    
    class WebhookValidator:
        @staticmethod
        def verify_signature(payload, signature, app_secret):
            expected = hmac.new(
                app_secret.encode('utf-8'),
                payload,
                hashlib.sha256
            ).hexdigest()
            return hmac.compare_digest(f"sha256={expected}", signature)
    
    class SessionManager:
        @staticmethod
        def is_window_open(last_inbound_timestamp):
            if not last_inbound_timestamp:
                return False
            now = datetime.now(timezone.utc)
            return now < last_inbound_timestamp + timedelta(hours=24)
    

    Next steps

    1. Add WHATSAPP_ACCESS_TOKEN and WHATSAPP_APP_SECRET to your .env file.
    2. Deploy the WebhookValidator logic to your endpoint to handle the Meta verification challenge.
    3. Register your message templates in the Meta Business Suite before attempting to send them via the client.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Building a production-ready WhatsApp integration requires more than just calling an endpoint. You have to manage 24-hour session windows, validate webhook signatures, handle asynchronous delivery statuses, and ensure opt-out compliance. This skill provides a structured Python implementation for the official WhatsApp Business Platform Cloud API. It eliminates the guesswork in managing message states and security protocols.

    What it does

    • API Client Implementation handles authenticated calls, timeout management, and error normalization for the Cloud API.
    • Session Management tracks inbound message timestamps to enforce the 24-hour customer service window.
    • Webhook Security validates incoming Meta signatures and handles verification challenges to prevent spoofing.
    • Template Handling manages approved templates, categories, and language codes for outbound notifications.
    • Reliability Logic implements bounded exponential backoff for transient failures and idempotent event processing.

    How it works

    1. Initialize Client using environment variables for phone number IDs and access tokens.
    2. Configure Webhooks by deploying the validation endpoint and setting up signature checking.
    3. Execute Messages by calling the service layer with text, media, or template-based payloads.
    4. Monitor Events to update message statuses from 'accepted' to 'delivered' or 'read' via webhooks.

    Frameworks & tools

    Python, WhatsApp Business Cloud API (Meta), and environment-based secret management. The implementation is designed to integrate with FastAPI, Flask, or Django.

    Why this beats prompting it yourself

    Generic prompts often ignore the complexity of the 24-hour session window and fail to implement mandatory webhook signature validation. This skill follows the official Meta implementation patterns, ensuring your account stays compliant and your webhooks stay secure.

    Use cases

    • Sending automated order confirmations using approved business templates.
    • Building a customer support bot that respects the 24-hour service window.
    • Syncing message delivery and read receipts back to a local database.
    • Managing user opt-outs and subscription preferences at the API level.

    Known limitations

    Requires an active Meta Developer App and a verified WhatsApp Business Account. Does not support unofficial WhatsApp Web scraping or automation.

    Requires active Meta Developer App and WhatsApp Business Account. Does not support unofficial Web automation. Users must provide their own persistence layer for message IDs.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 24 days ago

    Permissions

    Network Access
    Listed24 days ago

    What's inside

    Frequently Asked Questions

    This skill provides a production-grade Python framework that handles the complex 'plumbing' of the WhatsApp Business API, specifically managing security through webhook signature validation and enforcing the 24-hour customer service window required by Meta.

    The code is framework-agnostic and can be easily integrated into common Python web environments like FastAPI, Flask, or Django, making it compatible with almost any Python-based AI agent architecture.

    You will receive the complete Python service layer, including the API client, session management logic, webhook validation middleware, and a configuration guide for environment variables.

    Yes, you must have an active Meta Developer App, a verified WhatsApp Business Account (WABA), and a Phone Number ID provided by Meta to use this integration.

    The skill uses a robust validation layer that checks the X-Hub-Signature-256 header on every incoming request to ensure the data is coming directly from Meta and has not been tampered with.

    New in APIs & Backend