FS
Fooshun Message
丰顺消息云 · 开放 API 文档

开放 API 接口文档

全球企业消息通信平台 · Global Enterprise Messaging Platform

API Base URL
https://api.fooshun.foo

鉴权方式

所有开放 API 请求需在 Header 中携带 API Key 与 Secret,可在控制台「API & Webhook」中创建、重新生成、禁用。

X-API-Key: sk_xxxxxxxxxxxxxxxx
X-API-Secret: xxxxxxxxxxxxxxxxxxxxxxxx

接口列表

POST/openapi/send发送短信(单条 / 批量)
POST https://api.fooshun.foo/openapi/send
Headers: X-API-Key, X-API-Secret
Body: {
  "to": "+8613800138000",        // 或数组 ["+86...", "+1..."]
  "content": "【丰顺消息云】您的验证码 1234",
  "channel_id": 1                  // 可选,留空自动路由
}
响应: { "code": 0, "task_id": 1, "data": { "total": 1, "success": 1, "failed": 0, "cost": 0.04 } }
GET/openapi/balance查询账户余额
GET https://api.fooshun.foo/openapi/balance
Headers: X-API-Key, X-API-Secret
响应: { "code": 0, "balance": 888.50 }
GET/openapi/records查询发送记录
GET https://api.fooshun.foo/openapi/records?task_id=1
Headers: X-API-Key, X-API-Secret
响应: { "code": 0, "records": [ { "phone_e164": "+86...", "status": "delivered", "cost": 0.04, ... } ] }

Webhook 回调

在控制台配置 Webhook 地址后,发送结果将以 POST 推送到你的服务器,Header 携带 X-Webhook-Secret 用于校验。

POST https://your-server.com/callback
Headers: X-Webhook-Secret: xxxxxxxx
Body: {
  "event": "message.status",
  "data": { "task_id": 1, "total": 1, "success": 1, "failed": 0, "cost": 0.04 },
  "timestamp": "2026-01-01T00:00:00.000Z"
}

cURL 示例

curl -X POST https://api.fooshun.foo/openapi/send \
  -H "X-API-Key: sk_xxxx" \
  -H "X-API-Secret: xxxx" \
  -H "Content-Type: application/json" \
  -d '{"to":"+8613800138000","content":"【丰顺消息云】您的验证码 1234"}'