请求地址:
https://api.1cloudsp.com/voice/send
请求参数:
参数 | 类型 | 必填 | 示例值 | 描述 |
---|---|---|---|---|
accesskey | String | 是 | xxxxxxxxxx | 平台分配给用户的accessKey,登录系统首页可点击"我的秘钥"查看 |
secret | String | 是 | yyyyyyyyyy | 平台分配给用户的secret,登录系统首页可点击"我的秘钥"查看 |
mobile | String | 是 | 13900000001 | 接收语音短信的手机号码,多个号码以半角逗号,隔开 |
voiceCode | String | 是 | 123456 | 语音数字,4~8位数字 |
请求示例:
Java
/* ---示例代码 POST方式----*/
HttpClient httpClient = new HttpClient();
PostMethod postMethod = new PostMethod("http://api.1cloudsp.com/voice/send");
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),
new NameValuePair("mobile", "13900000001"),
new NameValuePair("voiceCode", "123456"),
};
postMethod.setRequestBody(data);
int statusCode = httpClient.executeMethod(postMethod);
System.out.println("statusCode: " + statusCode + ", body: " + postMethod.getResponseBodyAsString());
/* ---示例代码 POST方式----*/
响应示例:
{
code: "0",
msg: "SUCCESS"
}