文 档 中 心 / Document Center
搜索 管理中心
壹川接口文档V3
模板短信发送
更新时间:2018-07-04 10:44:21   更新人员:叶洋   文档状态: #368    测试接口
摘要
  1. 接口基本信息
    接口名称:模板短信发送
    请求方法:POST
    接口地址:sms/sendtpl
    登录验证:是
  2. 请求参数
    参数名 参数 数据类型 是否必须 示例值 说明
    tplname 模板别名 string
    mobile 接收短信的手机号 string 接收短信的手机号
    tpldata{} 模板参数数据 object 本参数对象的键为模板中被替换名,值为替换数据,数据不固定,依照实际所需传递即可
  3. 请求示例
    请求例子:
     
    apirq('sms/sendtpl', {
        method: "post",
        data: {
            "tplname": "waybill_arrive",
            "mobile": "18512825951",
            "tpldata": {
                "num": 2,
                "cargo_name": "箱子",
                "net_name": "天津",
                "waybill_no": "A012463",
                "tel": "02888888888"
            }
        }
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "调用成功",
        "time": "1530673396",
        "data": {
            "code": 0,
            "msg": "发送成功",
            "count": 1,
            "fee": 0.05,
            "unit": "RMB",
            "mobile": "18512825951",
            "sid": 25714735348
        }
    } 
    
    请求例子(模拟):
     
    apirq('sms/sendtpl', {
        method: "post",
        data: {
            "tplname": "waybill_arrive",
            "mobile": "18200509877",
            "tpldata": {
                "num": 2,
                "cargo_name": "箱子",
                "net_name": "天津",
                "waybill_no": "A012463",
                "tel": "02888888888"
            }
        }
    }) 
    
    返回数据结果:
     
    {
        "code": 0,
        "msg": "发送成功",
        "time": "1530673306",
        "data": {
            "code": 0,
            "sid": -1,
            "fee": 0.05,
            "count": 1,
            "mobile": "18200509877",
            "msg": "『调试模拟』发送成功(实际未发送短信)"
        }
    } 
    
本书创建于 2018-03-30 12:03:13 ?如有疑问,请联系技术人员