SMSHook
最新更新:2023-04-10
SMSHook
短信状态回调
URL
用户web页面自定义填写
用户web页面自定义填写
此代码块在浮窗中显示
Content-Type:
application/json; charset=utf-8
application/json; charset=utf-8
此代码块在浮窗中显示
HTTP请求方式
post
post
此代码块在浮窗中显示
请求Headers
Header | Type | Description |
---|---|---|
X-SMSHook-Signature | string | 签名 |
X-SMSHook-Timestamp | long | 消息时间戳 |
X-SMSHook-AppKey | string | 应用 |
X-SMSHook-Version | string | 版本 |
请求Body
参数 | 类型 | 说明 |
---|---|---|
message_id | string | 消息id |
from | string | 发信人(template_approval消息为空) |
to | string | 收信手机号(target、sent和template_approval消息为空) |
server | string | sms |
itime | long | 消息产生时间戳 |
custom_args | json | 客户自定义字段 |
status | json | 消息状态回调 |
短信 target 状态消息
status
参数 | 类型 | 说明 |
---|---|---|
message_status | string | target |
status_data | json object | 状态数据 |
message | string | successfully request |
template_id | int | 模板id |
template_type | int | 短信内容类型 |
label_id | int | 标签id |
user_id | int | 用户id |
sms_user | string | sms user |
sms_ids | array | 收信人sms id数组 |
to | array | 收信人数组 |
msg_type | int | 消息类型 |
{
"server": "sms",
"message_id": "1679392394031_15_17153_881599_c1fjwa",
"itime": 1679392394061,
"status": {
"message_status": "target",
"status_data": {
"user_id": 15,
"to": [
"+8618871186627",
"008615727024341"
],
"msg_type": 2,
"template_id": 881599,
"message": "successfully request",
"sms_user": "xiaojinmintest",
"sms_ids": [
"1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"1679392394031_15_17153_881599_c1fjwa$008615727024341"
],
"template_type": 2,
"label_id": 0
}
}
}
{
"server": "sms",
"message_id": "1679392394031_15_17153_881599_c1fjwa",
"itime": 1679392394061,
"status": {
"message_status": "target",
"status_data": {
"user_id": 15,
"to": [
"+8618871186627",
"008615727024341"
],
"msg_type": 2,
"template_id": 881599,
"message": "successfully request",
"sms_user": "xiaojinmintest",
"sms_ids": [
"1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"1679392394031_15_17153_881599_c1fjwa$008615727024341"
],
"template_type": 2,
"label_id": 0
}
}
}
此代码块在浮窗中显示
短信 sent 状态消息
status
参数 | 类型 | 说明 |
---|---|---|
message_status | string | sent |
status_data | json object | 状态数据 |
message | string | successfully sent |
template_id | int | 模板id |
template_type | int | 短信内容类型 |
label_id | int | 标签id |
user_id | int | 用户id |
sms_user | string | sms user |
sms_ids | array | 收信人sms id数组 |
to | array | 收信人数组 |
msg_type | int | 消息类型 |
{
"server": "sms",
"message_id": "1679392394031_15_17153_881599_c1fjwa",
"itime": 1679392394061,
"status": {
"message_status": "sent",
"status_data": {
"user_id": 15,
"to": [
"+8618871186627",
"008615727024341"
],
"msg_type": 2,
"template_id": 881599,
"message": "successfully sent",
"sms_user": "xiaojinmintest",
"sms_ids": [
"1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"1679392394031_15_17153_881599_c1fjwa$008615727024341"
],
"template_type": 2,
"label_id": 0
}
}
}
{
"server": "sms",
"message_id": "1679392394031_15_17153_881599_c1fjwa",
"itime": 1679392394061,
"status": {
"message_status": "sent",
"status_data": {
"user_id": 15,
"to": [
"+8618871186627",
"008615727024341"
],
"msg_type": 2,
"template_id": 881599,
"message": "successfully sent",
"sms_user": "xiaojinmintest",
"sms_ids": [
"1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"1679392394031_15_17153_881599_c1fjwa$008615727024341"
],
"template_type": 2,
"label_id": 0
}
}
}
此代码块在浮窗中显示
短信 delivered 状态消息
status
参数 | 类型 | 说明 |
---|---|---|
message_status | string | delivered |
status_data | json object | 状态数据 |
message | string | successfully delivered |
template_id | int | 模板id |
template_type | int | 短信内容类型 |
label_id | int | 标签id |
user_id | int | 用户id |
sms_user | string | sms user |
sms_id | string | 短信id |
msg_count | int | 短信条数 |
msg_type | int | 消息类型 |
outbound_time | string | 请求通道时间 |
receipt_time | string | 回执时间 |
{
"server": "sms",
"message_id": "1679387065399_15_17155_881597_0poco8$+115927992951",
"to": "+115927992951",
"itime": 1679388949000,
"status": {
"message_status": "delivered",
"status_data": {
"outbound_time": "2023-03-21 16:55:25",
"receipt_time": "2023-03-21 16:55:49",
"sms_id": "1679387065399_15_17155_881597_0poco8$+115927992951",
"user_id": 15,
"msg_type": 2,
"template_id": 881597,
"message": "successfully delivered",
"sms_user": "huangli_SMS",
"template_type": 1,
"msg_count": 1,
"label_id": 0
}
}
}
{
"server": "sms",
"message_id": "1679387065399_15_17155_881597_0poco8$+115927992951",
"to": "+115927992951",
"itime": 1679388949000,
"status": {
"message_status": "delivered",
"status_data": {
"outbound_time": "2023-03-21 16:55:25",
"receipt_time": "2023-03-21 16:55:49",
"sms_id": "1679387065399_15_17155_881597_0poco8$+115927992951",
"user_id": 15,
"msg_type": 2,
"template_id": 881597,
"message": "successfully delivered",
"sms_user": "huangli_SMS",
"template_type": 1,
"msg_count": 1,
"label_id": 0
}
}
}
此代码块在浮窗中显示
短信 delivered_failed 状态消息
status
参数 | 类型 | 说明 |
---|---|---|
message_status | string | delivered_failed |
status_data | json object | 状态数据 |
template_id | int | 模板id |
template_type | int | 短信内容类型 |
label_id | int | 标签id |
user_id | int | 用户id |
sms_user | string | sms user |
sms_id | string | 收信人sms id |
outbound_time | string | 请求通道时间 |
receipt_time | string | 回执时间 |
msg_count | int | 短信条数 |
msg_type | int | 消息类型 |
error_code | int | 错误代码 |
error_detail | json | 错误明细 |
message | string | 错误日志 |
sub_stat | int | 错误子类,4xx 表示 大类为处理失败 5XX 表示大类为发送失败 |
sub_stat_desc | string | 错误消息 |
{
"server": "sms",
"message_id": "1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"to": "+8618871186627",
"itime": 1679392394120,
"status": {
"message_status": "delivered_failed",
"error_code": 480,
"error_detail": {
"message": "smsworker:local policy restrictions",
"sub_stat": 480,
"sub_stat_desc": "发送类型不支持"
},
"status_data": {
"sms_id": "1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"user_id": 15,
"msg_type": 2,
"template_id": 881599,
"outbound_time": "2023-03-21 17:53:14",
"receipt_time":"2023-03-21 17:53:37",
"sms_user": "xiaojinmintest",
"template_type": 2,
"msg_count": 1,
"label_id": 0
}
}
}
{
"server": "sms",
"message_id": "1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"to": "+8618871186627",
"itime": 1679392394120,
"status": {
"message_status": "delivered_failed",
"error_code": 480,
"error_detail": {
"message": "smsworker:local policy restrictions",
"sub_stat": 480,
"sub_stat_desc": "发送类型不支持"
},
"status_data": {
"sms_id": "1679392394031_15_17153_881599_c1fjwa$+8618871186627",
"user_id": 15,
"msg_type": 2,
"template_id": 881599,
"outbound_time": "2023-03-21 17:53:14",
"receipt_time":"2023-03-21 17:53:37",
"sms_user": "xiaojinmintest",
"template_type": 2,
"msg_count": 1,
"label_id": 0
}
}
}
此代码块在浮窗中显示
短信响应回调
URL
用户web页面自定义填写
用户web页面自定义填写
此代码块在浮窗中显示
Content-Type:
application/json; charset=utf-8
application/json; charset=utf-8
此代码块在浮窗中显示
HTTP请求方式
post
post
此代码块在浮窗中显示
请求Headers
Header | Type | Description |
---|---|---|
X-SMSHook-Signature | string | 签名 |
X-SMSHook-Timestamp | long | 消息时间戳 |
X-SMSHook-AppKey | string | 应用 |
X-SMSHook-Version | string | 版本 |
请求Body
参数 | 类型 | 说明 |
---|---|---|
message_id | string | 消息id |
to | string | 收信手机号 |
server | string | sms |
itime | long | 消息产生时间戳 |
custom_args | json | 客户自定义字段 |
response | json | 消息状态回调 |
短信 reply 响应消息
response
参数 | 类型 | 说明 |
---|---|---|
event | string | reply |
response_data | json object | 响应数据 |
template_id | int | 模板id |
template_type | int | 短信内容类型 |
label_id | int | 标签id |
user_id | int | 用户id |
sms_user | string | sms user |
sms_id | string | 收信人sms id |
reply_content | int | 回复内容 |
reply_time | string | 回复时间 |
msg_type | int | 消息类型 |
{
"server": "sms",
"message_id": "1679364048767_15_15814_905354_3y5z9a$17858502021",
"to": "17858502021",
"itime": 1679392394128,
"response": {
"event": "reply",
"response_data": {
"sms_id": "1679364048767_15_15814_905354_3y5z9a$17858502021",
"user_id": 15,
"reply_time": "2023-03-21 10:07:17",
"msg_type": 2,
"template_id": 905354,
"sms_user": "cpx_sms",
"template_type": 2,
"reply_content": "T",
"label_id": 0
}
}
}
{
"server": "sms",
"message_id": "1679364048767_15_15814_905354_3y5z9a$17858502021",
"to": "17858502021",
"itime": 1679392394128,
"response": {
"event": "reply",
"response_data": {
"sms_id": "1679364048767_15_15814_905354_3y5z9a$17858502021",
"user_id": 15,
"reply_time": "2023-03-21 10:07:17",
"msg_type": 2,
"template_id": 905354,
"sms_user": "cpx_sms",
"template_type": 2,
"reply_content": "T",
"label_id": 0
}
}
}
此代码块在浮窗中显示
短信通知回调
短信 template_approval 通知消息
notification
参数 | 类型 | 说明 |
---|---|---|
event | string | template_approval |
notification_data | json object | 响应数据 |
template_id | string | 模板id |
template_type | int | 短信内容类型 |
user_id | string | 用户id |
msg_type | int | 消息类型 |
approval_status | string | 模板审核结果 |
approval_message | string | 模板审核信息 |
{
"server": "sms",
"message_id": "1679364048767_15_15864",
"to": "17858502021",
"itime": 1679392394179,
"notification": {
"event": "template_approval",
"notification_data": {
"user_id": 15,
"msg_type": 2,
"template_id": 905354,
"template_type": 2,
"approval_status": "1",
"approval_message": "pass"
}
}
}
{
"server": "sms",
"message_id": "1679364048767_15_15864",
"to": "17858502021",
"itime": 1679392394179,
"notification": {
"event": "template_approval",
"notification_data": {
"user_id": 15,
"msg_type": 2,
"template_id": 905354,
"template_type": 2,
"approval_status": "1",
"approval_message": "pass"
}
}
}
此代码块在浮窗中显示