Skip to content

快速开始 ​

本指南发送一条短信。你需要 API-Key、X-TenantID,以及一个已审核通过的发送方名称。

1. 设置凭据 ​

bash
export ME_API_KEY="your-api-key"
export ME_TENANT="your-organization-id"
export ME_BASE="https://api.messageeagle.com/api/v1/app1/platform"

2. 发送消息 ​

bash
curl -X POST "$ME_BASE/sms/send_messages/message" \
  -H "API-Key: $ME_API_KEY" \
  -H "X-TenantID: $ME_TENANT" \
  -H "Content-Type: application/json" \
  -d '{
    "check_spam_msg_mode": "not_check",
    "data": [
      {
        "sender_name": "MyBrand",
        "operator": "ais",
        "message": "Hello",
        "phone_number": "+66886578553"
      }
    ]
  }'

3. 读取结果 ​

响应包裹在 data 中返回。operator、发送方名称与正文相同的行会合并为同一个 batch。

json
{
  "data": {
    "accepted": 1,
    "rejected": 0,
    "batches": [
      { "batch_id": "018f7b2a-7c3e-7a1b-9c2d-1a2b3c4d5e6f", "accepted": 1, "rejected": 0 }
    ]
  }
}

发送方名称必须已审核

若 sender_name 在目标运营商处尚未审核通过,这些收件人会计入 rejected,而不会导致整个请求失败。

后续步骤 ​