Send Regular SMS

本接口可通过指定短信运营商发送普通短信,部分短信运营商可在正文前增加短信签名,请求发送成功时,短信发送请求将被放入消息队列,用户可收到一个 eventId,后续可通过 eventId 查看实际发送结果。

请求格式

POST https://{apigw-address}/notification-center-service/v2.0/simple/sms

请求参数 (URI)

名称 位置(Path/Query) 必需/可选 数据类型 描述
orgId Query 必需 String 组织ID。如何获取orgId信息>>

请求参数 (Body)

名称 必需/可选 数据类型 描述
phones 必需 List<Phone> 收件人的手机区号及电话号码
tunnelCode 必需 String 指定短信发送的运营商,具体信息参考下文的运营商配置说明
tunnelIdentifier 可选 String 短信通道编号,用来区分相同运营商的不同通道
signatureCode 可选 String 发送短信时需要在短信前增加短信签名的显示时使用,需要到EnOS管理门户中选择 消息推送管理 > 短信 > 签名设置 页面查看,不同ou及供应商存在不同配置,只有在该ou能申请签名,并得到管理员审批后才能使用
priority 可选 Enum 消息发送优先度,默认P2,不需特殊配置
content 必需 String 短信内容

响应参数

名称 必需/可选 数据类型 描述
eventId 必需 String 发送邮件或短信请求时返回供用户查询结果的eventId

错误码

代码 错误信息 描述
32404 signature is not exist 短信签名不存在
32404 sms template is not exist 短信模板不存在
32400 variable not in template 模板内自定义变量错误
32400 tunnel code is not existed 短信渠道参数错误
32435 operation not allowed, the signature is not approved 短信签名未通过审批

示例

请求示例

url: https://{apigw-address}/notification-center-service/v2.0/simple/sms?orgId=yourOrgId
method: POST
requestBody:
{
  "signatureCode": "xx",
  "phones": [
    {
      "area": "87",
      "number": "23"
    }
  ],
  "priority": "P2",
  "tunnelCode": "",
  "content": "sms content"
}

返回示例

{"code":0, "msg":"OK", "submsg":"", "requestId": null, "data":{"eventId": "evt16062008765401}}

异常示例

{"code":32403, "msg":"the quota is run out, test quota is limited", "submsg":"Permission denied: tunnel.quota.run.out", "data": null, "requestId": null}