whatsapp-cloud-api by bellopushon/whatsapp-cloud-api
npx skills add https://github.com/bellopushon/whatsapp-cloud-api --skill whatsapp-cloud-api在以下场景中激活此技能:
| 项目 | 值 |
|---|---|
| 基础 URL | https://graph.facebook.com/v21.0 |
| 发送消息 | POST /{phone-number-id}/messages |
| 上传媒体 | POST /{phone-number-id}/media |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Authorization: Bearer {access-token} |
| 必填字段 | "messaging_product": "whatsapp" |
| 电话格式 | E.164: +{country}{number} (例如,+18091234567) |
| 速率限制 | 80 条消息/秒 (Cloud API) |
所有消息都通过单一端点发送:
POST https://graph.facebook.com/v21.0/{phone-number-id}/messages
Authorization: Bearer {access-token}
Content-Type: application/json
响应:
{
"messaging_product": "whatsapp",
"contacts": [{ "input": "+16505555555", "wa_id": "16505555555" }],
"messages": [{ "id": "wamid.HBgL..." }]
}
| 类型 | type 字段 | 详情 |
|---|---|---|
| 文本 | text | 纯文本,最多 4096 个字符,支持 URL 预览 |
| 图片 | image | JPEG/PNG,最大 5MB,可选标题 |
| 视频 | video | MP4,最大 16MB,可选标题 |
| 音频 | audio | AAC/MP3/OGG,最大 16MB |
| 文档 | document | 任何格式,最大 100MB,可选文件名 |
| 贴纸 | sticker | WebP,静态 100KB / 动态 500KB |
| 位置 | location | 纬度,经度,名称,地址 |
| 联系人 | contacts | 结构化的联系人卡片 |
| 回应 | reaction | 对消息的表情回应 |
| 交互式消息 | interactive | 按钮,列表,产品 |
| 模板 | template | 预先批准的消息模板 |
有关完整规范和代码示例,请参阅 references/MESSAGING.md。
您的服务器会收到用于传入消息和状态更新的 POST 请求。
传入消息结构:
{
"object": "whatsapp_business_account",
"entry": [{
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": { "phone_number_id": "ID", "display_phone_number": "NUM" },
"contacts": [{ "profile": { "name": "John" }, "wa_id": "16315551234" }],
"messages": [{
"from": "16315551234",
"id": "wamid.ABC...",
"timestamp": "1683229471",
"type": "text",
"text": { "body": "Hello" }
}]
},
"field": "messages"
}]
}]
}
状态更新类型: sent → delivered → read | failed
有关 Webhook 验证、负载解析和所有状态类型,请参阅 references/WEBHOOKS.md。
有关完整生命周期、定价和类别规则,请参阅 references/CONVERSATIONS.md。
{
"messaging_product": "whatsapp",
"to": "+18091234567",
"type": "text",
"text": { "body": "Hello! How can we help you?" }
}
{
"messaging_product": "whatsapp",
"to": "+18091234567",
"type": "template",
"template": {
"name": "hello_world",
"language": { "code": "en_US" }
}
}
{
"messaging_product": "whatsapp",
"status": "read",
"message_id": "wamid.HBgL..."
}
| 代码 | 错误 | 操作 |
|---|---|---|
| 131030 | 收件人未使用 WhatsApp | 发送前验证号码 |
| 131047 | 需要重新互动 | 先发送模板消息 |
| 131050 | 用户停止了营销消息 | 尊重退订,仅发送服务/实用程序消息 |
| 131056 | 达到配对速率限制 | 减慢速度,实现退避策略 |
| 130429 | 超出速率限制 | 将消息排队,最大 80 条/秒 |
完整的错误参考和重试策略,请参阅 references/ERROR-CODES.md。
+{country}{number},无空格或破折号hub.challenge 值响应 GET 质询wamid ID — 用于回复、回应和已读回执wa_id 与输入 — API 会规范化电话号码;wa_id 是规范形式每周安装数
62
仓库
GitHub 星标数
2
首次出现
2026年2月10日
安全审计
安装于
opencode62
codex60
gemini-cli59
github-copilot59
amp58
kimi-cli58
Activate this skill when:
| Item | Value |
|---|---|
| Base URL | https://graph.facebook.com/v21.0 |
| Send Message | POST /{phone-number-id}/messages |
| Upload Media | POST /{phone-number-id}/media |
| Auth | Authorization: Bearer {access-token} |
| Required Field | "messaging_product": "whatsapp" |
| Phone Format | E.164: +{country}{number} (e.g., +18091234567) |
| Rate Limit | 80 messages/second (Cloud API) |
All messages go through a single endpoint:
POST https://graph.facebook.com/v21.0/{phone-number-id}/messages
Authorization: Bearer {access-token}
Content-Type: application/json
Response:
{
"messaging_product": "whatsapp",
"contacts": [{ "input": "+16505555555", "wa_id": "16505555555" }],
"messages": [{ "id": "wamid.HBgL..." }]
}
| Type | type Field | Details |
|---|---|---|
| Text | text | Plain text, max 4096 chars, supports URL preview |
| Image | image | JPEG/PNG, max 5MB, optional caption |
| Video | video | MP4, max 16MB, optional caption |
| Audio | audio | AAC/MP3/OGG, max 16MB |
| Document | document |
For full specs and code examples, see references/MESSAGING.md.
Your server receives POST requests for incoming messages and status updates.
Incoming message structure:
{
"object": "whatsapp_business_account",
"entry": [{
"changes": [{
"value": {
"messaging_product": "whatsapp",
"metadata": { "phone_number_id": "ID", "display_phone_number": "NUM" },
"contacts": [{ "profile": { "name": "John" }, "wa_id": "16315551234" }],
"messages": [{
"from": "16315551234",
"id": "wamid.ABC...",
"timestamp": "1683229471",
"type": "text",
"text": { "body": "Hello" }
}]
},
"field": "messages"
}]
}]
}
Status update types: sent → delivered → read | failed
For webhook verification, payload parsing, and all status types, see references/WEBHOOKS.md.
For full lifecycle, pricing, and category rules, see references/CONVERSATIONS.md.
{
"messaging_product": "whatsapp",
"to": "+18091234567",
"type": "text",
"text": { "body": "Hello! How can we help you?" }
}
{
"messaging_product": "whatsapp",
"to": "+18091234567",
"type": "template",
"template": {
"name": "hello_world",
"language": { "code": "en_US" }
}
}
{
"messaging_product": "whatsapp",
"status": "read",
"message_id": "wamid.HBgL..."
}
| Code | Error | Action |
|---|---|---|
| 131030 | Recipient not on WhatsApp | Validate number before sending |
| 131047 | Re-engagement required | Send a template message first |
| 131050 | User stopped marketing messages | Respect opt-out, send only service/utility |
| 131056 | Pair rate limit hit | Slow down, implement backoff |
| 130429 | Rate limit exceeded | Queue messages, max 80/sec |
For full error reference and retry strategies, see references/ERROR-CODES.md.
+{country}{number}, no spaces or dasheshub.challenge valuewamid IDs — Needed for replies, reactions, and read receiptswa_id vs input — The API normalizes phone numbers; wa_id is canonicalWeekly Installs
62
Repository
GitHub Stars
2
First Seen
Feb 10, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode62
codex60
gemini-cli59
github-copilot59
amp58
kimi-cli58
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
111,700 周安装
GitHub Copilot 提示词构建器 - 专业提示工程工具,提升AI编程效率
8,300 周安装
AI实施方案生成器 - 创建机器可读、结构化的自动化执行计划
8,300 周安装
Python MCP 服务器生成器 - 快速构建 Model Context Protocol 服务器工具
8,400 周安装
MCP-CLI:命令行访问MCP服务器的工具,支持GitHub、文件系统、数据库交互
8,300 周安装
GitHub Copilot PRD生成工具 - AI产品经理助手,自动创建详细产品需求文档
8,300 周安装
GitHub Copilot代码审查与重构工具 - 资深工程师AI助手,自动优化代码质量与规范
8,400 周安装
| Any format, max 100MB, optional filename |
| Sticker | sticker | WebP, static 100KB / animated 500KB |
| Location | location | latitude, longitude, name, address |
| Contacts | contacts | Structured contact cards |
| Reaction | reaction | Emoji reaction to a message |
| Interactive | interactive | Buttons, lists, products |
| Template | template | Pre-approved message templates |