用途:通过 Pushinator API 发送 Web 推送通知,适用于向某个频道的全部订阅者群发消息,例如部署完成、构建失败或告警提醒。
主要能力:提供发送推送通知的接口;请求需指定 channel_id(频道 UUID)与 content(通知文本);支持在文本中包含 emoji 以作视觉区分。响应返回 success 与提示信息。
使用方式:Base URL 为 https://api.pushinator.com;必需请求头为 Authorization: Bearer $PUSHINATOR_TOKEN 与 Content-Type: application/json。发送端点:POST https://api.pushinator.com/api/v2/notifications/send。可将请求体写入 /tmp/pushinator_request.json 后执行:curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" --header "Authorization: Bearer $PUSHINATOR_TOKEN" --header "Content-Type: application/json" -d @/tmp/pushinator_request.json。请求体中 channel_id 与 content 均为必填。
排障:若请求失败,可运行 zero doctor check-connector --env-name PUSHINATOR_TOKEN 或 zero doctor check-connector --url https://api.pushinator.com/api/v2/notifications/send --method POST。
限制与注意:HTTP 2xx 表示成功,4xx 表示请求无效或缺少参数,5xx 建议重试;消息应简洁,因推送展示空间有限;建议按主题拆分频道;需注意套餐的月度通知上限(速率限制)。其他细节暂未提供。