SMSHook

Last updated:2023-04-10

SMS status callback

URL

User-defined filling on the page
          User-defined filling on the page

        
This code block in the floating window

Content-Type:

application/json; charset=utf-8
          application/json; charset=utf-8

        
This code block in the floating window

HTTP Request Method

post
          post

        
This code block in the floating window

Request Headers

Header Type Description
X-SMSHook-Signature string sign
X-SMSHook-Timestamp long message generation timestamp
X-SMSHook-AppKey string apply
X-SMSHook-Version string edition

Request Body

Parameter Type Description
message_id string message id
from string sender (empty in template_approval message)
to string recipient(empty in target、sent and template_approval)
server string SMS
itime long message generation timestamp
custom_args json customer-defined fields
status json message status callback

SMS target status message

status

Parameter Type Description
message_status string target
status_data json object status data
message string successfully request
template_id int ID of SMS template
template_type int SMS content type
label_id int ID of SMS label
user_id int ID of user
sms_user string SMS_USER
sms_ids array recipient SMS ID array
to array recipient array
msg_type int SMS type
{ "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
        }
    }
}

        
This code block in the floating window

SMS sent status message

status

Parameter Type Description
message_status string sent
status_data json object status data
message string successfully sent
template_id int ID of SMS template
template_type int SMS content type
label_id int ID of SMS label
user_id int ID of user
sms_user string SMS_USER
sms_ids array recipient SMS ID array
to array recipient array
msg_type int SMS type
{ "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
        }
    }
}

        
This code block in the floating window

SMS delivered status message

status

Parameter Type Description
message_status string delivered
status_data json object status data
message string successfully delivered
template_id int ID of SMS template
template_type int SMS content type
label_id int ID of SMS label
user_id int ID of user
sms_user string SMS_USER
sms_id string SMS ID
msg_count int number of SMS messages
msg_type int SMS type
outbound_time string request channel time
receipt_time string receipt time
{ "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
        }
    }
}

        
This code block in the floating window

SMS delivered_failed status message

status

Parameter Type Description
message_status string delivered_failed
status_data json object status data
template_id int ID of SMS template
template_type int SMS content type
label_id int ID of SMS label
user_id int ID of user
sms_user string SMS_USER
sms_id string SMS ID
outbound_time string request channel time
receipt_time string receipt time
msg_count int number of SMS messages
msg_type int SMS type
error_code int error code
error_detail json error detail
message string error Log
sub_stat int error subcategory, 4xx indicates processing failure for category 5XX indicates sending failure for category
sub_stat_desc string error message
{ "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": "sending type not supported" }, "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": "sending type not supported"
    },
    "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
    }
  }
}

        
This code block in the floating window

SMS response callback

URL

User-defined filling on the page
          User-defined filling on the page

        
This code block in the floating window

Content-Type:

application/json; charset=utf-8
          application/json; charset=utf-8

        
This code block in the floating window

HTTP Request Method

post
          post

        
This code block in the floating window

Request Headers

Header Type Description
X-SMSHook-Signature string sign
X-SMSHook-Timestamp long message generation timestamp
X-SMSHook-AppKey string application
X-SMSHook-Version string edition

Request Body

Parameter Type Description
message_id string message id
to string recipient
server string SMS
itime long message generation timestamp
custom_args json customer-defined fields
response json message response callback

SMS reply response message

response

Parameter Type Description
event string reply
response_data json object response data
template_id int ID of SMS template
template_type int SMS content type
label_id int ID of SMS label
user_id int ID of user
sms_user string SMS_USER
sms_id string SMS ID
reply_content int reply content
reply_time string reply time
msg_type int SMS type
{ "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
        }
    }
}

        
This code block in the floating window

SMS status callback

SMS template_ approval notification message

notification

Parameter Type Description
event string template_approval
notification_data json object response data
template_id string ID of SMS template
template_type int SMS content type
user_id string ID of user
msg_type int SMS type
approval_status string template Review Results
approval_message string template review information
{ "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"
        }
    }
}

        
This code block in the floating window
在文档中心打开