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"
}
}
}
此代碼塊在浮窗中顯示










