发送消息
发送记录
统计信息
API文档
发送消息
没有可用的账号或分组
点击选择要发送的账号或分组,消息将发送到账号绑定的默认接收者
发送记录
| 时间 | 账号 | 接收者 | 类型 | 内容 | 状态 |
|---|---|---|---|---|---|
| 暂无记录 | |||||
统计信息
0
总发送数
0
成功数
0
失败数
0%
成功率
API 文档
通过 HTTP API 接口发送消息和管理账号,适合集成到其他系统。
接口列表
POST
/send
发送消息(核心接口)
▼
请求参数 (Body)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
targets | string[] | 是 | 目标账号ID或分组ID列表 |
type | string | 否 | 消息类型: text(默认), image, file, video |
message | string | 条件 | 文本消息内容 (type=text时必填) |
file_path | string | 条件 | 文件路径 (type非text时必填) |
file_name | string | 否 | 文件名 (可选) |
请求示例 (JSON)
{
"targets": ["账号ID或组ID"],
"type": "text",
"message": "要发送的消息内容"
}
cURL 命令
响应示例
{
"success": true,
"total": 2,
"success_count": 2,
"failed_count": 0,
"results": {
"00001": {
"success": true,
"receiver": "wxid_xxx",
"response_time_ms": 150
}
}
}
GET
/api/accounts
获取账号列表
▼
请求参数
无
响应示例
{
"accounts": [
{
"id": "00001",
"name": "账号1",
"remark": "我的微信",
"status": "logged_in",
"ready": true,
"stats": {
"today_sent": 10,
"total_sent": 100
}
}
]
}
GET
/api/groups
获取分组列表
▼
请求参数
无
响应示例
{
"groups": [
{
"id": "g001",
"name": "测试组",
"account_ids": ["00001", "00002"]
}
]
}
GET
/api/logs
获取发送记录
▼
请求参数 (Query)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
account_id | string | 否 | 账号ID,筛选指定账号 |
limit | int | 否 | 返回数量,默认50,最大500 |
offset | int | 否 | 偏移量,默认0 |
success_only | bool | 否 | 仅返回成功记录 |
响应示例
{
"logs": [
{
"id": 1,
"account_id": "00001",
"receiver": "wxid_xxx",
"message_type": "text",
"content": "测试消息",
"success": true,
"created_at": 1711804800,
"created_at_str": "2024-03-30 19:00:00"
}
],
"count": 1
}
GET
/api/stats
获取统计信息
▼
请求参数 (Query)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
account_id | string | 否 | 账号ID,筛选指定账号 |
days | int | 否 | 统计天数,默认7,最大30 |
响应示例
{
"period": "最近 7 天",
"account_id": null,
"statistics": {
"total": 100,
"success_count": 95,
"failed_count": 5,
"success_rate": 95.0
}
}
GET
/health
健康检查
▼
请求参数
无
响应示例
{
"status": "ok",
"accounts": 3,
"ready_accounts": 2
}
POST
/api/accounts
创建新账号
▼
请求参数 (Body)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | string | 否 | 账号名称 |
响应示例
{
"success": true,
"account": {
"id": "00003",
"name": "账号3"
}
}
POST
/api/groups
创建分组
▼
请求参数 (Body)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | string | 是 | 分组名称,最大50字符 |
account_ids | string[] | 否 | 账号ID列表 |
响应示例
{
"success": true,
"group": {
"id": "g002",
"name": "新分组",
"account_ids": ["00001"]
}
}
DELETE
/api/accounts/{id}
删除账号
▼
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 账号ID |
响应示例
{
"success": true
}
DELETE
/api/groups/{id}
删除分组
▼
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 分组ID |
响应示例
{
"success": true
}