短信模板列表查询接口
用户通过 HTTP(或 HTTPS)的 POST 或 GET 方式提交短信模板查询请求。编码采用 UTF-8 编码。
接口地址
POST
http://api.1cloudsp.com/query/templatelist
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| accesskey | String | 是 | 秘钥key | xxxxxxxxxx |
| secret | String | 是 | 秘钥secret | yyyyyyyyyy |
返回参数
| 参数名 | 类型 | 说明 | 描述 |
|---|---|---|---|
| customerId | String | 特服号 | |
| id | Int | 模板ID | |
| template | String | 短信模板内容 | |
| applyStatus | String | 审核状态 | 1:未审核 2:审核通过 3:审核不通过 |
| categoryId | 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": "审核批注"
}
]
}详细说明
安全提醒
请妥善保管您的 appSecret,切勿在客户端暴露。所有 API 请求应从服务端发起。
