获取短信状态报告
1.接口描述
请求方式可以是GET或者POST,两者选择其一,POST参数格式已JSON格式传递
接口请求地址:GET /client-sms/v2/sms/send-single
接口请求地址:POST /client-sms/v2/sms/send-single
2.输入参数
| 参数名称 | 描述 | 是否必选 | 类型 | Location |
|---|---|---|---|---|
| Finovy-Access-Token | 令牌-口令 | yes | string | header |
| retsize | 本次请求想要获取的状态报告最大条数。最大 500,超过 500 按 500 返回。小于等于 0 或不填时,系统返回默认条数,默认 500 条 | yes | string | body |
3.输出参数
| 参数名称 | 描述 | 类型 |
|---|---|---|
| result | 获取状态报告请求处理结果:0:成功,非0:失败,详见错误码 | string |
| desc | 应答结果描述,当 result 非 0 时,为错误描述,编码方式:urlencode(GB2312) | string |
| rpts | result 非 0 时 rpts 为空 | string |
rpt包含结构参数说明
| 参数名称 | 描述 | 类型 |
|---|---|---|
| msgid | 平台流水号:对应下行请求返回结果中的 msgid | string |
| custid | 用户自定义流水号:对应下行请求时填写的 custid | string |
| pknum | 预留字段,客户端无需处理。 | string |
| pktotal | 长短信拆分的总条数 | string |
| mobile | 收信手机号 | string |
| countrycode | 手机号的国际区号:-1 表示无效号码 | string |
| spno | 空值,预留字段,客户端无需处理 | string |
| exno | 发送短信时填写的SenderID | string |
| stime | 状态报告对应的下行发送时间:YYYY-MM-DD HH:MM:SS | string |
| rtime | 状态报告返回时间::YYYY-MM-DD HH:MM:SS | string |
| status | 接收状态,0:成功,非0:失败 | string |
| errcode | 状态报告错误代码 | string |
| errdesc | 状态报告错误代码的描述 | string |
| exdata | 下行时填写的exdata | string |
4.示例
示例1:请求成功示例
输入示例
POST client-sms/v2/sms/get-rpt / HTTP/1.1
Host: smsapi-sandbox.finovy.cn
Finovy-Access-Token: 4vL4rcNGNcgx5v0RLCcFew
Content-Type: application/json
<公共请求参数>
{
"retsize":"500"
}
输出示例
{ "result":0,
"desc":"%e6%88%90%e5%8a%9f",
"rpts": [
{ "msgid":9223372045854775808,
"custid":"b3d0a2783d31b21b8573",
"pknum":1,
"pktotal":2,
"mobile":"138xxxxxxxx",
"countrycode":86,
"spno":"1000457890006",
"exno":"0006",
"stime":"2016-08-04 17:38:55",
"rtime":"2016-08-04 17:38:59",
"status":0,
"errcode":"DELIVRD",
"errdesc":"success",
"exdata":"exdata0002"
}
]
}
5.错误码
| 状态码 | 描述 |
|---|---|
| 0 | 接口调用成功 |
| 401 | 身份认证失败 |