AGENT SKILL

whatsapp-business

Send messages via WhatsApp Business Cloud API. Send templates, media, and interactive messages to customers.

License 许可
MIT
最近更新
2026-04-05
Stars
★ 7
Forks
1

01 前言 Front Matter

name
whatsapp-business
metadata
{ "clawdbot": { "emoji": "?", "requires": { "env": [ "WHATSAPP_TOKEN", "WHATSAPP_PHONE_ID" ] } } }
description
Send messages via WhatsApp Business Cloud API. Send templates, media, and interactive messages to customers.

02 资源文件 1

03 SKILL.md 正文

WhatsApp Business Cloud API

Business messaging on WhatsApp.

Environment

export WHATSAPP_TOKEN="xxxxxxxxxx"
export WHATSAPP_PHONE_ID="xxxxxxxxxx"

Send Text Message

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

Send Template Message

curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "1234567890",
    "type": "template",
    "template": {
      "name": "hello_world",
      "language": {"code": "en_US"}
    }
  }'

Send Image

curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "1234567890",
    "type": "image",
    "image": {"link": "https://example.com/image.jpg"}
  }'

Send Interactive Buttons

curl -X POST "https://graph.facebook.com/v18.0/$WHATSAPP_PHONE_ID/messages" \
  -H "Authorization: Bearer $WHATSAPP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "1234567890",
    "type": "interactive",
    "interactive": {
      "type": "button",
      "body": {"text": "Choose an option:"},
      "action": {
        "buttons": [
          {"type": "reply", "reply": {"id": "yes", "title": "Yes"}},
          {"type": "reply", "reply": {"id": "no", "title": "No"}}
        ]
      }
    }
  }'

Get Message Templates

curl "https://graph.facebook.com/v18.0/{WABA_ID}/message_templates" \
  -H "Authorization: Bearer $WHATSAPP_TOKEN"

Links

04 同仓库更多 Skills