http://ip:port/inter/sendPersonalityIMS
| 参数 | 类型 | 描述 |
|---|---|---|
| appId | String | 用户Appid(必填) |
| timestamp | String | 时间戳(必填) 格式:yyyyMMddHHmmss 14位 |
| sign | String | 签名(必填) 格式:md5(appId+ secretKey + timestamp) 32位 |
| mobile | String | 手机号(必填) 多个,最多300个 |
| content | String | 短信内容(必填) 多条,与手机号一一对应 |
| customImsId | String | 自定义消息ID(选填) 最长32位 多条,与手机号一一对应 |
1、将参数拼装成json串
{
"appId":"EUCP-EMY-SMS0-4SYGK",
" timestamp":" 20180330161138",
" sign":" PIEUDJI987EUID62PKEDSESQEDSEDFSE",
"imses":[
{
"mobile":"0061422118000",
"customImsId":"2018010709302911",
"content":"This is a text message to Australia"
},{
"mobile":"0061422118001",
"content":"This is a personality message to Australia"
}
]
}
2、将json串转化为UTF-8编码的byte数组
Byte[] data = json.toBytes[“UTF-8”];
3、通过http post方法传输
Byte[] response = http.post(url,data);
响应数据格式为Json
| 参数 | 类型 | 描述 |
|---|---|---|
| code | String | 请求状态码,详见本文档《3.接口状态码表》 当code不是SUCCESS时,不会响应下面参数数据。 |
| mobile | String | 手机号 多个 |
| imsId | String | 消息ID 多个,与mobile一对一 |
| customImsId | String | 客户自定义IMSID 多个,与mobile一对一 |
{
"code":"SUCCESS",
"data":[{
"mobile":" 0061422118000",
"imsId":"2018010709302911",
"customImsId":"2018010709302911"
},{
"mobile":" 0061422118001",
"imsId":"2018010709302912",
"customImsId":"2018010709302912"
}]
}