# 短信余额查询接口
# 接口地址
http://api.1cloudsp.com/query/account
用户通过HTTP(或HTTPS)的POST或GET方式提交短信发送请求。编码采用 UTF-8
编码。
# 请求参数
参数名 | 是否必填 | 类型 | 示例 | 描述 |
---|---|---|---|---|
accesskey | 是 | String | xxxxxxxxxx | 秘钥key |
secret | 是 | String | yyyyyyyyyy | 秘钥secret |
# 返回参数
参数名 | 类型 | 说明 | 描述 |
---|---|---|---|
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"
}
}
← 短信状态回执推送接口 添加签名接口 →