短信状态回执推送接口
通过HTTP(或HTTPS)的POST方式提交。编码采用 UTF-8 编码。推送请求包头定义: Content-Type:application/x-www-form-urlencoded;charset=utf-8。
客户需向我司提交接收回执状态地址,由平台主动推送回执状态数据
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| accesskey | String | 是 | 秘钥key | xxxxxxxxxx |
| secret | String | 是 | 秘钥secret | yyyyyyyyyy |
返回参数
| 参数名 | 类型 | 说明 | 描述 |
|---|---|---|---|
| code | String | 请求状态数 | 0表示请求成功,非0表示请求失败;详细参考 错误码列表 |
| msg | String | 状态说明 | |
| data | Object | 返回结果 | 可以查询 接口短信、平台短信、国际短信、语音验证码、语音通知 的条数或余额 |
请求示例
/* ---示例代码 POST方式----*/
HttpClient httpClient = new HttpClient();
PostMethod postMethod = new PostMethod("http://api.1cloudsp.com/query/account");
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":
{
"营销短信":0,
"语音验证码":0,
"国际短信":".00",
"语音通知":"98.00",
"接口短信":0,
"私密通话":".00",
"国际语音验证码":"99.26"
}
}详细说明
安全提醒
请妥善保管您的 appSecret,切勿在客户端暴露。所有 API 请求应从服务端发起。
