Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计提醒

whatsapp-cloud-apiWhatsApp cloud API 文档

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

4,697

周安装

190

GitHub Stars

3

下载量

1,474
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:whatsapp-cloud-api(WhatsApp cloud API 文档)
来源仓库:https://github.com/bellopushon/whatsapp-cloud-api
仓库路径:skills/whatsapp-cloud-api
安装命令:
npx skills add https://github.com/bellopushon/whatsapp-cloud-api --skill whatsapp-cloud-api
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/bellopushon/whatsapp-cloud-api --skill whatsapp-cloud-api

简介

用于辅助 API 设计、接口文档和请求响应结构说明。

  • 适用于梳理 endpoint、生成 OpenAPI 草稿或检查字段命名。
  • 提供 WhatsApp Cloud API 的快速参考,包括认证和媒体上传接口。
  • 涉及接口文档生成时应避免凭空补字段,优先从现有 schema 提取事实。
  • whatsapp-cloud-api 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

WhatsApp Cloud API

When to Use

Activate this skill when:

  • Building or modifying WhatsApp messaging features
  • Sending messages (text, media, templates, interactive)
  • Processing incoming webhooks from WhatsApp
  • Working with template messages or conversation windows
  • Handling phone number formatting (E.164)
  • Debugging WhatsApp API errors or status updates
  • Implementing message status tracking (sent, delivered, read)

Quick Reference

ItemValue
Base URLhttps://graph.facebook.com/v21.0
Send MessagePOST /{phone-number-id}/messages
Upload MediaPOST /{phone-number-id}/media
AuthAuthorization: Bearer {access-token}
Required Field"messaging_product": "whatsapp"
Phone FormatE.164: +{country}{number} (e.g., +18091234567)
Rate Limit80 messages/second (Cloud API)

Core API — Send Message

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..." }]
}

Message Types

Typetype FieldDetails
TexttextPlain text, max 4096 chars, supports URL preview
ImageimageJPEG/PNG, max 5MB, optional caption
VideovideoMP4, max 16MB, optional caption
AudioaudioAAC/MP3/OGG, max 16MB
DocumentdocumentAny format, max 100MB, optional filename
StickerstickerWebP, static 100KB / animated 500KB
Locationlocationlatitude, longitude, name, address
ContactscontactsStructured contact cards
ReactionreactionEmoji reaction to a message
InteractiveinteractiveButtons, lists, products
TemplatetemplatePre-approved message templates

For full specs and code examples, see references/MESSAGING.md.

Webhooks

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: sentdeliveredread | failed

For webhook verification, payload parsing, and all status types, see references/WEBHOOKS.md.

Conversation Window

  • When a customer messages you, a 24-hour service window opens
  • Inside the window: send any message type freely (service messages are FREE)
  • Outside the window: only template messages can be sent (paid per message)
  • No API endpoint to "close" a conversation — windows expire automatically
  • Template messages open their own 24h window per category (marketing, utility, auth)

For full lifecycle, pricing, and category rules, see references/CONVERSATIONS.md.

Common Patterns

Send a text message

{
  "messaging_product": "whatsapp",
  "to": "+18091234567",
  "type": "text",
  "text": { "body": "Hello! How can we help you?" }
}

Send a template message

{
  "messaging_product": "whatsapp",
  "to": "+18091234567",
  "type": "template",
  "template": {
    "name": "hello_world",
    "language": { "code": "en_US" }
  }
}

Mark a message as read

{
  "messaging_product": "whatsapp",
  "status": "read",
  "message_id": "wamid.HBgL..."
}

Error Handling

CodeErrorAction
131030Recipient not on WhatsAppValidate number before sending
131047Re-engagement requiredSend a template message first
131050User stopped marketing messagesRespect opt-out, send only service/utility
131056Pair rate limit hitSlow down, implement backoff
130429Rate limit exceededQueue messages, max 80/sec

For full error reference and retry strategies, see references/ERROR-CODES.md.

Best Practices

  1. Always use E.164 phone format+{country}{number}, no spaces or dashes
  2. Verify webhooks — Respond to GET challenge with hub.challenge value
  3. Return 200 immediately on webhook POST — process asynchronously
  4. Store wamid IDs — Needed for replies, reactions, and read receipts
  5. Use template messages to re-engage after the 24h window expires
  6. Handle idempotency — Webhook may deliver the same event multiple times
  7. Check wa_id vs input — The API normalizes phone numbers; wa_id is canonical
  8. Rate limit awareness — 80 msg/sec for Cloud API; implement queue + backoff

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.67%
按下载量换算511

Claude

30.48%
按下载量换算449

Cursor

18.88%
按下载量换算278

Gemini CLI

9.44%
按下载量换算139

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills