跳转到内容
返回官网

短信模板查询

淘宝短信模板查询

一、请求参数

请求URL:

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

参数名类型必须示例值说明
appidStringtrueuwkahf@jfs92合作伙伴AppId
timestampStringtrue1633618722当前时间戳
tb_seller_nickStringtruekingdo淘宝卖家店铺登录账号,非店铺名称
signStringtrue999de41d862efaa6f1084ead3b3ba480如何计算生成见示例代码
query_sms_template_requesttrue见示例
- - template_codestringtrueSMS_257051849模板代码

query_sms_template_request请求的json示例

{
"template_code": "SMS_257051849"
}

二、请求示例代码

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);
}

三、返回结果

返回情况

{
"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": ""
}

四、返回参数说明

参数名类型示例值说明
appidStringuwkahf@jfs92合作伙伴AppId
timestampString1633618722当前时间戳
tb_seller_nickStringkingdo淘宝卖家店铺登录账号,非店铺名称
signString999de41d862efaa6f1084ead3b3ba480如何计算生成见示例代码
moduleAccessBaseDTO见示例创建签名入参
- - template_typeNumber10–验证码 1–短信通知 2– 推广短信 3–国际/港澳台消息
- - template_statusNumber00–待审核 1–通过 2–拒绝
– reasonString审核意见审核意见
– template_nameString模板名称
– template_codeString模板CODE
– create_dateString2021-12-02 21:34:19创建时间
messageString请求失败,模板未找到错误消息

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