# 短信模板查询接口


# 接口地址

http://api.1cloudsp.com/query/templatelist

用户通过HTTP(或HTTPS)的POST或GET方式提交短信发送请求。编码采用 UTF-8 编码。


# 请求参数

参数名 是否必填 类型 示例 描述
accesskey String xxxxxxxxxx 秘钥key
secret String yyyyyyyyyy 秘钥secret

# 返回参数

参数名 类型 说明 描述
customerId String 特服号
id Int 模板ID
template String 模板内容
categoryId String 短信类型 短信类别 1 验证码 2 通知&订单 3 营销
applyStatus String 审核状态 审核状态 1:未审核 2:审核通过 3:审核不通过
applyReply String 审核批注 审核批注

# 请求示例

/* ---示例代码 POST方式----*/
                
HttpClient httpClient = new HttpClient();
PostMethod postMethod = new PostMethod("http://api.1cloudsp.com/query/templatelist");
postMethod.getParams().setContentCharset("UTF-8");
postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
        new DefaultHttpMethodRetryHandler());

String accesskey = "xxxxxxxxxx"; //用户开发key
String accessSecret = "yyyyyyyyyy"; //用户开发秘钥

NameValuePair[] data = {
        new NameValuePair("accesskey", accesskey),
        new NameValuePair("secret", accessSecret)
};
postMethod.setRequestBody(data);
postMethod.setRequestHeader("Connection", "close");

int statusCode = httpClient.executeMethod(postMethod);
System.out.println("statusCode: " + statusCode + ", body: " + postMethod.getResponseBodyAsString());
                    
/* ---示例代码 POST方式----*/

# 返回示例

{
    "code": "0",
    "msg": "SUCCESS",
    "data": [
        {
            "templateId": 1,
            "template": "{1}你好:您的订单已经出库,请注意查收",
            "customerId": 10000,
            "applyStatus": 2,
            "categoryId": 2
        },
        {
            "templateId": 2,
            "template": "你的验证码是:{1}",
            "customerId": 10000,
            "applyStatus": 2,
            "categoryId": 1,
            "applyReply": "审核批注"
        }
    ]
}