请求地址:
https://api.1cloudsp.com/query/templatelist
请求参数:
参数 | 类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
accesskey | String | 是 | xxxxxxxxxx | 平台分配给用户的accessKey,登录系统首页可点击"我的秘钥"查看 |
secret | String | 是 | yyyyyyyyyy | 平台分配给用户的secret,登录系统首页可点击"我的秘钥"查看 |
返回参数:
参数 | 类型 | 说明 | 描述 |
---|---|---|---|
customerId | String | 特服号 | |
template | String | 模板内容 | |
categoryId | String | 短信类型 | 短信类别 1 验证码 2 通知&订单 3 营销 |
applyStatus | String | 审核状态 | 审核状态 1:未审核 2:审核通过 3:审核不通过 |
请求示例:
Java
/* ---示例代码 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 = "y0r3IzVYALe4tzlt"; //用户开发key
String accessSecret = "TKRLnRPpuuQgmeyBJu5tKcKhrqttB7sw"; //用户开发秘钥
NameValuePair[] data = {
new NameValuePair("accesskey", accesskey),
new NameValuePair("secret", accessSecret)
};
postMethod.setRequestBody(data);
int statusCode = httpClient.executeMethod(postMethod);
System.out.println("statusCode: " + statusCode + ", body: " + postMethod.getResponseBodyAsString());
/* ---示例代码 POST方式----*/
响应示例:
{
code: "0",
msg: "SUCCESS",
"data": [
{
"template": "{1}你好:您的订单已经出库,请注意查收",
"customerId": 10000,
"applyStatus": 2,
"categoryId": 2
},
{
"template": "你的验证码是:{1}",
"customerId": 10000,
"applyStatus": 2,
"categoryId": 1
}
]
}