查询短信模板

淘宝短信模板查询

1.请求参数:

请求URL:

POST https://open.fw199.com/gateway/taobao/jst/sms/template/query

参数名 类型 必须 示例值 说明
appid String true uwkahf@jfs92 合作伙伴AppId
timestamp String true 1633618722 当前时间戳
tb_seller_nick String true kingdo 淘宝卖家店铺登录账号,非店铺名称
sign String true 999de41d862efaa6f1084ead3b3ba480 如何计算生成见示例代码
query_sms_template_request true 见示例
- - template_code string true SMS_257051849 模板代码

query_sms_template_request请求的json示例

{
    "template_code": "SMS_257051849"  
}

2. 请求示例代码(Java)

      @Test
    public void  JstSmsTemplateQueryRequest() throws Exception {
        Map<String, String> data = new HashMap<String, String>();
        data.put("appid",  Config.AppId);
        Long timestamp = System.currentTimeMillis() / 1000;
        data.put("timestamp", timestamp.toString());
        data.put("tb_seller_nick", Config.TBSellerNick);

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("template_code", "SMS_257051849");
        data.put("query_sms_template_request", jsonObject.toJSONString());
        // 签名
        data.put("sign", Utils.Sign(data,Config.AppSecret));
        // 调用服务API
        doHttpRequest(Config.JstSmsTemplateQueryRequestUrl ,data);

    }

3. 返回结果

返回情况

{
    "code": 0,
    "message": "ok",
    "data": {
        "module": {
            "create_date": "2022-11-02 19:04:01",
            "reason": "无审批备注",
            "template_code": "SMS_257051849",
            "template_content": "您好,您的订单已经发货,收货时出示收货码:${code}给师傅",
            "template_name": "BXG-订单验证码",
            "template_status": 0,
            "template_type": 1
        },
        "r_success": true,
        "request_id": "15ru0did1vw91"
    },
    "trace_id": ""
}

4. 返回参数说明

参数名 类型 示例值 说明
appid String uwkahf@jfs92 合作伙伴AppId
timestamp String 1633618722 当前时间戳
tb_seller_nick String kingdo 淘宝卖家店铺登录账号,非店铺名称
sign String 999de41d862efaa6f1084ead3b3ba480 如何计算生成见示例代码
module AccessBaseDTO 见示例 创建签名入参
- - template_type Number 1 0–验证码 1–短信通知 2– 推广短信 3–国际/港澳台消息
- - template_status Number 0 0–待审核 1–通过 2–拒绝
– reason String 审核意见 审核意见
– template_name String 模板名称
– template_code String 模板CODE
– create_date String 2021-12-02 21:34:19 创建时间
message String 请求失败,模板未找到 错误消息

说明: code为0表示成功,非0为失败,message会包含失败原因。业务成功根据r_success字段来判断

文档更新时间: 2022-11-09 17:53   作者:admin