Server 酱 SendKey 推送
Server 酱通过 SendKey 接收 HTTP 请求,并转发到账号中启用的通知通道。本文依据 Server 酱官方文档整理,核验日期为 2026-09-08;未使用真实 SendKey 执行推送。
- 已登录 Server 酱并完成目标通知通道配置。
- 已从 SendKey 页面取得当前账号的 SendKey。
- 发送端可以提交 HTTPS 表单请求。
- 登录 Server 酱,进入 SendKey 页面。
- 复制 SendKey 并放入服务器端密钥存储。
- 确认至少一个通知通道已经启用。
- 使用标题发送最小请求;需要详细内容时增加
desp。
| 字段 | 必需 | 说明 |
|---|---|---|
SEND_KEY | 是 | Server 酱发送密钥,不是普通账号 ID |
title | 是 | 消息标题 |
desp | 否 | 消息正文,可按服务支持使用 Markdown |
JavaScript 示例需要 Node.js 20 或更新版本;Python 示例需要安装 requests。
curl -X POST 'https://sctapi.ftqq.com/SEND_KEY.send' \ --data-urlencode 'title=通知渠道连通性测试' \ --data-urlencode 'desp=来自 Server 酱的最小测试消息'const body = new URLSearchParams({ title: '通知渠道连通性测试', desp: '来自 Server 酱的最小测试消息',});const response = await fetch( `https://sctapi.ftqq.com/${encodeURIComponent(process.env.SEND_KEY)}.send`, { method: 'POST', body },);
if (!response.ok) throw new Error(`HTTP ${response.status}`);console.log(await response.json());import osimport requests
response = requests.post( f"https://sctapi.ftqq.com/{os.environ['SEND_KEY']}.send", data={"title": "通知渠道连通性测试", "desp": "来自 Server 酱的最小测试消息"}, timeout=15,)response.raise_for_status()print(response.json())检查响应中的业务状态和推送标识,并确认已启用的目标通道实际收到消息。接口受理成功不代表每个下游通道都完成投递。
- SendKey 只能放在服务端,不要出现在前端 URL、截图或日志中。
- 为不同环境分开管理凭据,避免测试消息进入生产通道。
- 泄露后立即在 Server 酱后台更换 SendKey,并更新所有调用方。
接口成功但微信未收到:检查账号中的通道是否仍有效,以及微信侧是否完成绑定。
标题或正文乱码:使用 UTF-8 并通过表单 URL 编码提交。
请求被限流:按响应提示降低频率,不要并发重试。