← 返回
开发者工具 Key 中文

WhatsApp Business API

Complete WhatsApp Business Cloud API for messages, templates, media, webhooks, flows, and business profiles.
完整的 WhatsApp Business Cloud API,涵盖消息、模板、媒体、Webhooks、流程及商家资料。
ivangdavila ivangdavila 来源
开发者工具 clawhub v1.0.0 1 版本 99903 Key: 需要
★ 0
Stars
📥 1,030
下载
💾 21
安装
1
版本
#latest

概述

WhatsApp Business API

Official Meta Cloud API integration. See auxiliary files for detailed operations.

Quick Start

curl -X POST "https://graph.facebook.com/v21.0/$WHATSAPP_PHONE_NUMBER_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"messaging_product":"whatsapp","to":"1234567890","type":"text","text":{"body":"Hello!"}}'

Setup

On first use, read setup.md. Preferences stored in ~/whatsapp-business-api/memory.md.

When to Use

Any WhatsApp Business operation: send messages, templates, media, interactive elements, manage webhooks, handle conversations, update business profiles.

Architecture

~/whatsapp-business-api/
├── memory.md      # Account context + phone numbers
├── templates.md   # Approved templates reference
└── webhooks.md    # Webhook configurations

Quick Reference

TopicFile
-------------
Setup & memorysetup.md, memory-template.md
Messages (text, media, interactive)messages.md
Templates (create, manage, send)templates.md
Media (upload, download, manage)media.md
Webhooks & Eventswebhooks.md
Business Profile & Phone Numbersbusiness.md
Flows (interactive forms)flows.md
Best practices & limitsbest-practices.md

Core Rules

  1. International format — Phone numbers without + or leading zeros: 1234567890
  2. 24-hour window — Free replies within 24h of customer message; templates required to initiate
  3. Template approval — Templates need Meta approval (24-48h); test in sandbox first
  4. Idempotency — Use biz_opaque_callback_data to track message state
  5. Webhook verification — Always verify webhook signature with app secret
  6. Rate limits — 80 messages/second per phone number; 1000 template messages/day (tier 1)
  7. Media limits — Images <5MB, videos <16MB, documents <100MB

Authentication

Required environment variables:

  • WHATSAPP_ACCESS_TOKEN — System User access token (permanent) or User access token (60-day)
  • WHATSAPP_PHONE_NUMBER_ID — Your registered phone number ID
  • WHATSAPP_BUSINESS_ACCOUNT_ID — Your WABA ID (for templates)
  • WHATSAPP_APP_SECRET — App secret for webhook verification
curl "https://graph.facebook.com/v21.0/$WHATSAPP_PHONE_NUMBER_ID" \
  -H "Authorization: Bearer $WHATSAPP_ACCESS_TOKEN"

Token Types

TypeDurationUse Case
--------------------------
System User TokenPermanentProduction apps
User Token60 daysDevelopment, testing
Temporary Token24 hoursQuick tests

Common Traps

  • Phone format with + or 00 → API rejects
  • Missing messaging_product: "whatsapp" → 400 error
  • Template not approved → message fails silently
  • Webhook signature not verified → security vulnerability
  • Sending outside 24h window without template → blocked

External Endpoints

EndpointPurpose
-------------------
https://graph.facebook.com/v21.0/*Cloud API

Security & Privacy

Environment variables used:

  • WHATSAPP_ACCESS_TOKEN — for API authentication
  • WHATSAPP_APP_SECRET — for webhook signature verification

Sent to Meta: Messages, media, customer phone numbers via graph.facebook.com

Stays local: Tokens (never logged), ~/whatsapp-business-api/ preferences

Never: Log message content, skip webhook verification, store tokens in code

Trust

This skill sends data to Meta (facebook.com/whatsapp).

Related Skills

Install with clawhub install if user confirms:

  • api — REST API patterns
  • webhook — Webhook handling
  • chat — Conversational patterns

Feedback

  • If useful: clawhub star whatsapp-business-api
  • Stay updated: clawhub sync

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 21:53 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,537
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,388 📥 321,447
office-efficiency

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 454 📥 150,811