最近更新时间:2023.07.31 12:33:16
首次发布时间:2023.01.17 16:24:55
您可以在短信服务控制台的回执配置中设置回调 URL,接收短信服务异步返回的短信状态报告,以确认短信发送是否成功。
回调地址需要符合以下条件,才可以成功接收短信服务发送的短信状态报告。
使用 HTTP/HTTPS URL。
短信服务可以直接访问回调地址,即回调地址具备公网访问能力。
如果回调地址所在服务器设置了防火墙,请放行来自短信服务的请求。
在您接收短信服务的回调消息之前,需要登录短信服务控制台配置用于接收回调消息的 URL。
登录短信服务控制台。
在左侧导航栏,选择通用管理 > 回执配置。
在回执配置页面,编辑默认状态报告地址。
设置您用于接收回调消息的 URL。URL 格式为http(s)://<您的回调地址>
。
在短信服务控制台设置回调地址后,如果您调用 SendSms 接口发送短信,则短信服务会异步向回调地址返回短信状态报告。
当短信服务返回短信状态报告时,会向回调地址发送 POST 请求。本章节介绍请求 Header 和 Body 包含的参数说明。
参数 | 取值 | 描述 |
---|---|---|
Content-Type | application/json;charset=utf-8 | 定义网络文件的类型和网页的编码。 |
Accept-Encoding | gzip, deflate | 采用指定的压缩格式传输数据。 |
Accept | */* | 指定客户端希望接收的数据类型。 |
请求体整体是一个 JSON 数组。
参数 | 类型 | 描述 |
---|---|---|
account | string | 火山引擎账号 |
sub_account | string | 消息组ID |
status_code | string | 发送状态,"0"代表成功,其余表示失败 |
description | string | 状态描述 |
signature | string | 签名 |
template_id | string | 模板ID |
mobile | string | 手机号 |
channel_type | string | 短信类型,可能值:CN_OTP |
message_id | string | 发送时返回的meassage_id 字段 |
msg_count | int | 拆分条数 |
service_id | string | 发送通道,非必传,国际/港澳台短信没有该字段 |
ext | string | 发送时传递的Tag 字段 |
send_time | int64 | 短信发送时间,milliseconds时间戳 |
recv_time | int64 | 短信接收时间,milliseconds时间戳 |
mccmnc | string | 移动网络提供者唯一代码 |
iso_code | string | ISO 3166-1 国家代码 |
[ { "account": "200****", "sub_account": "1504****", "signature": "短信服务", "mobile": "188******", "channel_type": "CN_OTP", "service_id": "106966940****", "send_time": 1669171012444, "template_id": "SPT_0fa7****", "ext": "123456", "message_id": "bde1b10d-19cf-460f-abcd-26231a82****", "recv_time": 1669171015941, "status_code": "0", "description": "发送成功", "msg_count": 1, "mccmnc": "46002", "iso_code": "CN" } ]
Code | Message | 说明 |
---|---|---|
ZJ10300 | The Phone number over frequency control. | 传入电话号码超过频控 |
ZJ10301 | The content is illegal. please check the content of the message | 传入内容有问题,可能是触发关键字等情况 |
ZJ10302 | The phone number is on the blacklist. | 传入电话号码在block名单中,全局黑名单,需要后台解除 |
ZJ10303 | Out of Service. | 企业已停止短信服务/账号欠费等 |
ZJ10304 | Non-industry SMS, or high complaint content. | 非行业短信,或高投诉内容 |
ZJ10305 | Sign is on the block list | 签名黑名单 |
ZJ10306 | Unsubscribe words is wrong or none. please check the content of the marketing message. | 营销短信未带退订方式说明 |
ZJ10307 | repeat sending in a short time in terms of referenceId.Invalid operation to the record, please check the status and the permission | 短时间内发送了同样的内容给同样的手机号 |
ZJ10308 | Invalid operation to the record, please check the status and the permission | 短信群发专用错误。取消群发任务时,剩余未发送短信会发送失败 |
ZJ10309 | The url in the content is illegal. | 内容中有高风险 URL |
ZJ10311 | Long url to short url failed | 长链接转短链接失败 |
ZJ20000 | Other | 其他,与客户支持确认 |
ZJ20001 | illegal_number | 非法手机号 |
ZJ20002 | illegal_account_password | 用户名密码错误 |
ZJ20003 | content_length_limit | 内容超过长度限制 |
ZJ20004 | number_not_exist | 空号 |
ZJ20005 | intercept | 短信拦截,内容,流速,参数等原因 |
ZJ20006 | block_list | 号码在黑名单中 |
ZJ20007 | abnormal_state | 关停欠费携号转网等异常状态 |
ZJ20008 | vendor_problem | 供应商及其下游通道问题 |
ZJ20009 | signature_problem | 签名相关问题 |
要求用户侧接收成功后,返回 httpStatus为200,否则火山侧会认为回执失败
答:10次,时间间隔:[0,5,10,30,120,300,1200,3600,21600,86400],单位秒。
答:http协议里的statuscode返200即可,不是在请求体中返回。