pushinator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Pushinator API

Pushinator API

Use the Pushinator API via direct
curl
calls to send push notifications to mobile devices.
Official docs:
https://pushinator.com/api

通过直接调用
curl
来使用Pushinator API,向移动设备发送推送通知
官方文档:
https://pushinator.com/api

When to Use

适用场景

Use this skill when you need to:
  • Send push notifications to mobile devices
  • Alert users about events, deployments, or updates
  • Integrate notifications into CI/CD pipelines
  • Notify yourself when long-running tasks complete

在以下场景中可以使用该技能:
  • 向移动设备发送推送通知
  • 就事件、部署或更新向用户发出告警
  • 将通知集成到CI/CD流水线中
  • 当长时间运行的任务完成时通知自己

Prerequisites

前提条件

  1. Sign up at Pushinator
  2. Download the Pushinator app on your mobile device
  3. Create a channel in the Console
  4. Generate an API token at Tokens
  5. Store credentials in environment variables
bash
export PUSHINATOR_API_KEY="your-api-token"
  1. Pushinator注册账号
  2. 在移动设备上下载Pushinator应用
  3. 控制台中创建一个频道
  4. 令牌页面生成API令牌
  5. 将凭证存储在环境变量中
bash
export PUSHINATOR_API_KEY="your-api-token"

Pricing

定价

  • Free: 3 devices, 200 notifications/month
  • Pro ($9.99/mo): 20 devices, 2,000 notifications/month
  • Scale ($29.99/mo): 50 devices, 20,000 notifications/month

Important: When using
$VAR
in a command that pipes to another command, wrap the command containing
$VAR
in
bash -c '...'
. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.
bash
bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'
  • 免费版:支持3台设备,每月200条通知
  • 专业版(9.99美元/月):支持20台设备,每月2000条通知
  • 企业版(29.99美元/月):支持50台设备,每月20000条通知

重要提示:当在管道命令中使用
$VAR
时,请将包含
$VAR
的命令用
bash -c '...'
包裹。由于Claude Code的bug,直接使用管道时环境变量会被静默清除。
bash
bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"'

How to Use

使用方法

Base URL:
https://api.pushinator.com
Required headers:
  • Authorization: Bearer ${PUSHINATOR_API_KEY}
  • Content-Type: application/json

基础URL:
https://api.pushinator.com
必填请求头:
  • Authorization: Bearer ${PUSHINATOR_API_KEY}
  • Content-Type: application/json

1. Send a Push Notification

1. 发送推送通知

Send a notification to all subscribers of a channel.
Write to
/tmp/pushinator_request.json
:
json
{
  "channel_id": "<your-channel-uuid>",
  "content": "Hello from Pushinator!"
}
Replace
<your-channel-uuid>
with your actual channel UUID, then run:
bash
curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" \
  --header "Authorization: Bearer ${PUSHINATOR_API_KEY}" \
  --header "Content-Type: application/json" \
  -d @/tmp/pushinator_request.json
Response:
json
{
  "success": true,
  "message": "Notification created and being sent to subscribers"
}

向频道的所有订阅者发送通知。
写入
/tmp/pushinator_request.json
json
{
  "channel_id": "<your-channel-uuid>",
  "content": "Hello from Pushinator!"
}
<your-channel-uuid>
替换为实际的频道UUID,然后运行:
bash
curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" \
  --header "Authorization: Bearer ${PUSHINATOR_API_KEY}" \
  --header "Content-Type: application/json" \
  -d @/tmp/pushinator_request.json
响应:
json
{
  "success": true,
  "message": "Notification created and being sent to subscribers"
}

2. Send Deployment Notification

2. 发送部署完成通知

Notify when a deployment completes.
Write to
/tmp/pushinator_request.json
:
json
{
  "channel_id": "<your-channel-uuid>",
  "content": "Deployment complete! Project deployed to production."
}
Replace
<your-channel-uuid>
with your actual channel UUID, then run:
bash
curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" \
  --header "Authorization: Bearer ${PUSHINATOR_API_KEY}" \
  --header "Content-Type: application/json" \
  -d @/tmp/pushinator_request.json

当部署完成时发送通知。
写入
/tmp/pushinator_request.json
json
{
  "channel_id": "<your-channel-uuid>",
  "content": "Deployment complete! Project deployed to production."
}
<your-channel-uuid>
替换为实际的频道UUID,然后运行:
bash
curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" \
  --header "Authorization: Bearer ${PUSHINATOR_API_KEY}" \
  --header "Content-Type: application/json" \
  -d @/tmp/pushinator_request.json

3. Send Alert with Emoji

3. 发送带表情的告警通知

Include emojis for visual distinction.
Write to
/tmp/pushinator_request.json
:
json
{
  "channel_id": "<your-channel-uuid>",
  "content": "Build failed! Check the CI logs."
}
Replace
<your-channel-uuid>
with your actual channel UUID, then run:
bash
curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" \
  --header "Authorization: Bearer ${PUSHINATOR_API_KEY}" \
  --header "Content-Type: application/json" \
  -d @/tmp/pushinator_request.json

使用表情符号实现视觉区分。
写入
/tmp/pushinator_request.json
json
{
  "channel_id": "<your-channel-uuid>",
  "content": "Build failed! Check the CI logs."
}
<your-channel-uuid>
替换为实际的频道UUID,然后运行:
bash
curl -s -X POST "https://api.pushinator.com/api/v2/notifications/send" \
  --header "Authorization: Bearer ${PUSHINATOR_API_KEY}" \
  --header "Content-Type: application/json" \
  -d @/tmp/pushinator_request.json

Request Parameters

请求参数

ParameterTypeRequiredDescription
channel_id
stringYesUUID of the notification channel
content
stringYesNotification message text

参数类型是否必填描述
channel_id
string通知频道的UUID
content
string通知消息文本

HTTP Status Codes

HTTP状态码

CodeDescription
2xxSuccess - notification sent
4xxInvalid request or missing parameters
5xxServer error - retry recommended

状态码描述
2xx成功 - 通知已发送
4xx请求无效或参数缺失
5xx服务器错误 - 建议重试

Guidelines

使用指南

  1. Keep messages concise: Push notifications have limited display space
  2. Use channels for topics: Create separate channels for different notification types
  3. Rate limiting: Stay within your plan's monthly notification limit
  4. Include context: Make notifications actionable with relevant details
  1. 保持消息简洁:推送通知的显示空间有限
  2. 按主题使用频道:为不同类型的通知创建单独的频道
  3. 速率限制:不要超出你的套餐每月通知限额
  4. 包含上下文信息:在通知中添加相关细节,使其具有可操作性