跳到主要内容

发送模板短信接口

注意

请求说明

  • 接口请求域名 : api.ffrcs.cn
  • RequestURI : /rest/sms/v3/send/templateSms
  • Method : POST
  • Content-Type : application/json; charset=utf-8;

默认接口请求频率限制:300次/秒。

输入参数

参数类型描述示例必填
signNameString短信签名。需要带【】符号。【飞鱼短信】
templateIdInteger短信模板ID。10830
mobilesTemplateVariable[]发送短信的手机号码列表。
单次请求最多支持200个手机号。
subCodeString短信扩展码。注意:格式为纯数字。00001
smsIdString任务ID。最大支持32位字符。
如不填写则由本平台自动生成
sendTimeString定时发送时间。格式为:yyyy-MM-dd HH:mm:ss。2018-07-03 17:47:43

TemplateVariable

参数类型描述示例必填
mobileString手机号码。180****
variablesString[]模板参数。若无模板参数,则设置为空。["1232"]

响应内容

参数类型描述
codeInteger响应状态
messageString响应状态描述
dataObject响应结果
data.smsIdString本次请求返回的唯一消息ID。
data.failListInvalidMobile[]响应结果

InvalidMobile

参数类型描述
mobileString手机号码。
codeInteger当前手机号发送失败的状态码。
messageString当前手机号发送失败的状态描述。

示例

请求示例

curl  'https://api.ffrcs.cn/rest/sms/v3/send/templateSms' \
--header 'Content-Type: application/json' \
--header 'X-FZ-Timstamp: 1713152159772 ' \
--header 'Authorization: HmacSHA256 credential=1kl***,signature=1264b693*******be05bef' \
--data '{
"signName": "【飞鱼短信】",
"templateId": 10830,
"mobiles": [
{
mobile: "180********",
variables: null,
}
]
}'

响应示例

{
"code": 200,
"message": "处理成功",
"data": {
"smsId": "b1f41b725bb543a8b0066d483f9cae30",
"failList": null
}
}

错误码参考- 错误码