Skip to content

API 文档

TimelyNotify API 采用 RESTful 风格,所有请求使用 JSON 编码。

基础信息

  • Base URLhttps://api.timelynotify.com/v1
  • 认证方式:请求头携带 Authorization: Bearer <API_KEY>

发送通知

POST /messages

请求参数

参数类型必填说明
channelstring通知渠道:email / sms / webhook
tostring接收人地址
templatestring模板 ID 或模板名
paramsobject模板变量

请求示例

bash
curl -X POST https://api.timelynotify.com/v1/messages \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "email",
    "to": "user@example.com",
    "template": "welcome",
    "params": { "name": "张三" }
  }'

返回示例

json
{
  "code": 0,
  "data": {
    "messageId": "msg_8f3k2x9q",
    "status": "queued"
  }
}

查询送达状态

GET /messages/{messageId}

返回该消息的当前状态(queued / sent / delivered / failed)及各渠道明细。

错误码

code说明
401API Key 无效或已过期
429触发限流,请稍后重试
400参数错误,参见返回的 message 字段