返回顶部
w

wati瓦提

|

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
204
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

wati

WATI

通过托管认证访问 WATI(WhatsApp 团队收件箱)API。发送 WhatsApp 消息、管理联系人以及处理消息模板。

快速开始

bash

获取联系人列表


python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/wati/api/v1/getContacts?pageSize=10&pageNumber=1)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

基础 URL

https://gateway.maton.ai/wati/{native-api-path}

将 {native-api-path} 替换为实际的 WATI API 端点路径。网关将请求代理到您的 WATI 实例,并自动注入您的 API 令牌。

认证

所有请求都需要在 Authorization 标头中包含 Maton API 密钥:

Authorization: Bearer $MATONAPIKEY

环境变量: 将您的 API 密钥设置为 MATONAPIKEY:

bash
export MATONAPIKEY=YOURAPIKEY

获取您的 API 密钥

  1. 1. 登录或在 maton.ai 创建账户
  2. 前往 maton.ai/settings
  3. 复制您的 API 密钥

连接管理

在 https://ctrl.maton.ai 管理您的 WATI 连接。

列出连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections?app=wati&status=ACTIVE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

创建连接

bash
python < import urllib.request, os, json
data = json.dumps({app: wati}).encode()
req = urllib.request.Request(https://ctrl.maton.ai/connections, data=data, method=POST)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Content-Type, application/json)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

获取连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id})
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

响应:
json
{
connection: {
connection_id: 21fd90f9-5935-43cd-b6c8-bde9d915ca80,
status: ACTIVE,
creation_time: 2025-12-08T07:20:53.488460Z,
lastupdatedtime: 2026-01-31T20:03:32.593153Z,
url: https://connect.maton.ai/?session_token=...,
app: wati,
metadata: {}
}
}

在浏览器中打开返回的 url 以完成授权。

删除连接

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://ctrl.maton.ai/connections/{connection_id}, method=DELETE)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

指定连接

如果您有多个 WATI 连接,请使用 Maton-Connection 标头指定要使用的连接:

bash
python < import urllib.request, os, json
req = urllib.request.Request(https://gateway.maton.ai/wati/api/v1/getContacts?pageSize=10&pageNumber=1)
req.addheader(Authorization, fBearer {os.environ[MATONAPI_KEY]})
req.add_header(Maton-Connection, 21fd90f9-5935-43cd-b6c8-bde9d915ca80)
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

如果省略,网关将使用默认(最旧)的活动连接。

API 参考

联系人

获取联系人

bash
GET /wati/api/v1/getContacts?pageSize=10&pageNumber=1

查询参数:

  • - pageSize - 每页结果数
  • pageNumber - 页码(从1开始)
  • name(可选)- 按联系人名称筛选
  • attribute(可选)- 按属性筛选(格式:[{name: name, operator: contain, value: test}])
  • createdDate(可选)- 按创建日期筛选(YYYY-MM-DD)

属性运算符: contain、notContain、exist、notExist、==、!=、valid、invalid

添加联系人

bash
POST /wati/api/v1/addContact/{whatsappNumber}
Content-Type: application/json

{
name: John Doe,
customParams: [
{
name: member,
value: VIP
}
]
}

更新联系人属性

bash
POST /wati/api/v1/updateContactAttributes/{whatsappNumber}
Content-Type: application/json

{
customParams: [
{
name: member,
value: VIP
}
]
}

消息

获取消息

bash
GET /wati/api/v1/getMessages/{whatsappNumber}?pageSize=10&pageNumber=1

查询参数:

  • - pageSize - 每页结果数
  • pageNumber - 页码(从1开始)

发送会话消息

在活动会话中发送文本消息(24小时窗口):

bash
POST /wati/api/v1/sendSessionMessage/{whatsappNumber}
Content-Type: application/x-www-form-urlencoded

messageText=Hello%20from%20WATI!

发送会话文件

在活动会话中发送文件:

bash
POST /wati/api/v1/sendSessionFile/{whatsappNumber}?caption=Check%20this%20out
Content-Type: multipart/form-data

file=@document.pdf

消息模板

获取消息模板

bash
GET /wati/api/v1/getMessageTemplates?pageSize=10&pageNumber=1

发送模板消息

向单个联系人发送预批准的模板消息:

bash
POST /wati/api/v1/sendTemplateMessage?whatsappNumber={whatsappNumber}
Content-Type: application/json

{
templatename: orderupdate,
broadcastname: orderupdate,
parameters: [
{
name: name,
value: John
},
{
name: ordernumber,
value: 12345
}
]
}

发送模板消息(批量)

向多个联系人发送模板消息:

bash
POST /wati/api/v1/sendTemplateMessages
Content-Type: application/json

{
templatename: orderupdate,
broadcastname: orderupdate,
receivers: [
{
whatsappNumber: 14155551234,
customParams: [
{
name: name,
value: John
},
{
name: ordernumber,
value: 12345
}
]
},
{
whatsappNumber: 14155555678,
customParams: [
{
name: name,
value: Jane
},
{
name: ordernumber,
value: 67890
}
]
}
]
}

通过 CSV 发送模板消息

bash
POST /wati/api/v1/sendTemplateMessageCSV?templatename=orderupdate&broadcastname=orderupdate
Content-Type: multipart/form-data

whatsappnumberscsv=@contacts.csv

消息模板(v2 API)

v2 API 提供了增强的响应格式,包含消息跟踪 ID。

发送模板消息(v2)

bash
POST /wati/api/v2/sendTemplateMessage?whatsappNumber={whatsappNumber}
Content-Type: application/json

{
templatename: orderupdate,
broadcast_name:

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 wati-1776102549 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 wati-1776102549 技能

通过命令行安装

skillhub install wati-1776102549

下载

⬇ 下载 wati v1.0.0(免费)

文件大小: 4.81 KB | 发布时间: 2026-4-15 14:54

v1.0.0 最新 2026-4-15 14:54
WATI API integration skill initial release

- Integrates WATI (WhatsApp Team Inbox) API with managed authentication via Maton.
- Supports sending WhatsApp messages, managing contacts, and handling message templates.
- Includes connection management features for multiple WATI accounts (list, create, get, delete).
- Provides detailed usage examples and API references for contacts, messaging, templates, and connection headers.
- Requires a Maton API key for all operations; instructions for setup and authentication included.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部