用于发送通知类短信,调用时需要计算 数字签名 。该接口限制每秒最多可调用 40 次。
URL
https://sms.wilddog.com/api/v1/{:SMSAppID}/notify/send |
返回数据格式
JSON |
HTTP请求方式
POST |
参数说明
参数 | 类型 | 必选 | 说明 |
---|---|---|---|
templateId | long | 是 | 模板 ID |
mobiles | string | 是 | 收信人手机号,JSONArray格式,如[“186xxxxxxxx”,”186xxxxxxxx”],每次提交号码个数最多为100个 |
params | string | 是 | 短信参数列表,用于依次填充模板,JSONArray格式,如[“xxx”,”yyy”];对于不包含变量的模板,表示模板即短信全文内容,此参数传[] |
signature | string | 是 | 数字签名,合法性验证,其中参与数字签名计算的参数包括 templateId , mobiles ,timestamp , params |
timestamp | string | 是 | UNIX时间戳,精度为毫秒 |
注意:
参数 params 可能含有特殊字符, 记得 urlencode
params 所传递的变量的值, 长度不能超过 30 个字符, 变量中不能含有 HTTP 链接。
生成数字签名时, 参数不要使用 urlencode
. 在调用 api 时, 才需要对参数做urlencode
返回说明
正常返回如下:
"Content-Type": "application/json; charset=utf-8" |
异常返回如下:
{ |
其中 errcode
对应信息在此处查询 短信错误码。
示例代码
curl -X POST https://sms.wilddog.com/api/v1/{SMSAppID}/notify/send -d "signature=$signature&templateId=$templateId&mobiles=$mobiles×tamp=$timestamp¶ms=$params" |