开发者

短信群发 API 用于营销和提醒短信

从你自己的系统发送营销短信、定时提醒和通知。价格、退订和限制都与网页发送后台相同。

20,000每次请求最多号码数
120每个密钥每分钟请求数
JSON请求和响应

快速开始

发送第一个请求

  1. 01进入账户的 API 页面生成密钥。密钥以 ss_ 开头。
  2. 02在每个请求中加上请求头 Authorization: Bearer <密钥>。
  3. 03用 POST /api/v1/quote 获取价格,再通过 POST /api/v1/messages 发送。

基础 URL

https://smssaver.ink/api/v1

接口

API 接口

方法和路径用途
GET /api/v1/balance当前余额,以美元计
GET /api/v1/countries覆盖国家及每条价格(无需密钥)
POST /api/v1/quote价格、条数和被过滤的号码,不发送
POST /api/v1/messages立即发送,设置 schedule_at 时定时发送
GET /api/v1/messages最近的发送列表(limit, offset)
GET /api/v1/messages/{id}单次发送及其按国家的结果
POST /api/v1/messages/{id}/cancel取消尚未发出的定时发送并全额退款

发送

发送短信

to 字段可传号码数组,或每行一个号码的文本。对于不带 + 的号码,请把 country 字段设为两位字母的国家代码,例如 us 或 cn。

字段说明
to接收人。数组或每行一个号码,最多 20,000 个
text短信内容,不超过 10 条
country可选。不带 + 的号码使用的两位国家代码
schedule_at可选。带时区的 ISO 时间(如 2026-12-01T09:00:00Z)或 Unix 秒数,须在 5 分钟后至 30 天内
client_ref可选。你自己的参考编号,最多 64 个字符
响应 · 201201 Created
{
  "ok": true,
  "campaign": {
    "id": "K7Q2M9XD4TPA",
    "status": "sending",
    "recipients": 2,
    "parts": 1,
    "encoding": "GSM-7",
    "cost": "0.0099",
    "countries": [
      { "country": "US", "recipients": 1, "cost": "0.0038" },
      { "country": "GB", "recipients": 1, "cost": "0.0061" }
    ]
  },
  "rejected": [],
  "duplicates": 0,
  "opted_out": 0,
  "balance": "48.9901"
}
POST /api/v1/messages
curl -X POST https://smssaver.ink/api/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["+14155550142", "+447400123456"],
    "text": "[Lumi Cafe] Tuesday deal: free dessert after 6pm. Stop: lumi.cafe/stop"
  }'
POST /api/v1/quote
curl -X POST https://smssaver.ink/api/v1/quote \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to": ["+14155550142", "+819012345678"], "text": "Hello" }'
响应 · 200200 OK
{
  "ok": true,
  "recipients": 2,
  "parts": 1,
  "encoding": "GSM-7",
  "cost": "0.0122",
  "balance": "49.00",
  "countries": [
    { "country": "JP", "recipients": 1, "price": "0.0084", "cost": "0.0084" },
    { "country": "US", "recipients": 1, "price": "0.0038", "cost": "0.0038" }
  ],
  "rejected": [],
  "duplicates": 0,
  "opted_out": 0
}

错误

错误码

代码HTTP原因
unauthorized401没有密钥或密钥无效
rate_limited429本分钟请求过多
bad_request400无法解析请求体
empty_text400没有短信内容
too_long400内容超过 10 条
no_numbers400没有可发送的号码
too_many400一次请求超过 20,000 个号码
bad_time400schedule_at 不在允许的时间范围内
low_balance402余额不足,无法完成本次发送
unavailable503发送暂时停止,未扣余额
not_found404该发送 ID 不存在
not_scheduled409该发送已发出或已取消

限制

  • 每个密钥每分钟最多 120 次请求。
  • 金额以美元字符串返回,例如 "0.0047"。
  • 发送 ID 是随机的 12 位代码,不是流水号。
  • 号码过滤和退订名单的规则与网页发送后台相同。
获取 API 密钥