SMSHook
การเรียกกลับสถานะ SMS
URL
ป้อนข้อมูลเองโดยผู้ใช้บนหน้าเว็บ
ป้อนข้อมูลเองโดยผู้ใช้บนหน้าเว็บ
โค้ดนี้โชว์เป็นหน้าต่างลอย
Content-Type:
application/json; charset=utf-8
application/json; charset=utf-8
โค้ดนี้โชว์เป็นหน้าต่างลอย
HTTP Request Method
post
post
โค้ดนี้โชว์เป็นหน้าต่างลอย
Request Headers
| Header | Type | Description |
|---|---|---|
| X-SMSHook-Signature | string | ลายเซ็น |
| X-SMSHook-Timestamp | long | เวลาประทับข้อความ |
| X-SMSHook-AppKey | string | แอปพลิเคชัน |
| X-SMSHook-Version | string | เวอร์ชัน |
Request Body
| Parameter | Type | Description |
|---|---|---|
| message_id | string | รหัสข้อความ |
| from | string | ผู้ส่ง (ว่างเปล่าสำหรับข้อความ template_approval) |
| to | string | หมายเลขโทรศัพท์ผู้รับ (ว่างเปล่าสำหรับ target, sent และ template_approval) |
| server | string | sms |
| itime | long | เวลาประทับการสร้างข้อความ |
| custom_args | json | ฟิลด์ที่กำหนดเองโดยลูกค้า |
| status | json | การเรียกกลับสถานะข้อความ |
ข้อความสถานะเป้าหมาย SMS
status
| Parameter | Type | Description |
|---|---|---|
| message_status | string | target |
| status_data | json object | ข้อมูลสถานะ |
| message | string | การร้องขอสำเร็จ |
| template_id | int | รหัสเทมเพลต |
| template_type | int | ประเภทเนื้อหา SMS |
| label_id | int | รหัสป้ายกำกับ |
| user_id | int | รหัสผู้ใช้ |
| sms_user | string | ผู้ใช้ SMS |
| sms_ids | array | อาร์เรย์ของรหัส SMS ผู้รับ |
| 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
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
ข้อความสถานะส่ง SMS
status
| Parameter | Type | Description |
|---|---|---|
| message_status | string | sent |
| status_data | json object | ข้อมูลสถานะ |
| message | string | ส่งสำเร็จ |
| template_id | int | รหัสเทมเพลต |
| template_type | int | ประเภทเนื้อหา SMS |
| label_id | int | รหัสป้ายกำกับ |
| user_id | int | รหัสผู้ใช้ |
| sms_user | string | ผู้ใช้ SMS |
| sms_ids | array | อาร์เรย์ของรหัส SMS ผู้รับ |
| 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
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
ข้อความสถานะส่งถึง SMS
status
| Parameter | Type | Description |
|---|---|---|
| message_status | string | delivered |
| status_data | json object | ข้อมูลสถานะ |
| message | string | ส่งถึงสำเร็จ |
| template_id | int | รหัสเทมเพลต |
| template_type | int | ประเภทเนื้อหา SMS |
| label_id | int | รหัสป้ายกำกับ |
| user_id | int | รหัสผู้ใช้ |
| sms_user | string | ผู้ใช้ SMS |
| sms_id | string | รหัส SMS |
| msg_count | int | จำนวน SMS |
| 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
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
ข้อความสถานะส่งล้มเหลว SMS
status
| Parameter | Type | Description |
|---|---|---|
| message_status | string | delivered_failed |
| status_data | json object | ข้อมูลสถานะ |
| template_id | int | รหัสเทมเพลต |
| template_type | int | ประเภทเนื้อหา SMS |
| label_id | int | รหัสป้ายกำกับ |
| user_id | int | รหัสผู้ใช้ |
| sms_user | string | ผู้ใช้ SMS |
| sms_id | string | รหัส SMS ผู้รับ |
| outbound_time | string | เวลาช่องทางการร้องขอ |
| receipt_time | string | เวลารับ |
| msg_count | int | จำนวน SMS |
| 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": "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
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
การเรียกกลับการตอบกลับ SMS
URL
ป้อนข้อมูลเองโดยผู้ใช้บนหน้าเว็บ
ป้อนข้อมูลเองโดยผู้ใช้บนหน้าเว็บ
โค้ดนี้โชว์เป็นหน้าต่างลอย
Content-Type:
application/json; charset=utf-8
application/json; charset=utf-8
โค้ดนี้โชว์เป็นหน้าต่างลอย
HTTP Request Method
post
post
โค้ดนี้โชว์เป็นหน้าต่างลอย
Request Headers
| Header | Type | Description |
|---|---|---|
| X-SMSHook-Signature | string | ลายเซ็น |
| X-SMSHook-Timestamp | long | เวลาประทับข้อความ |
| X-SMSHook-AppKey | string | แอปพลิเคชัน |
| X-SMSHook-Version | string | เวอร์ชัน |
Request Body
| Parameter | Type | Description |
|---|---|---|
| message_id | string | รหัสข้อความ |
| to | string | หมายเลขโทรศัพท์ผู้รับ |
| server | string | sms |
| itime | long | เวลาประทับการสร้างข้อความ |
| custom_args | json | ฟิลด์ที่กำหนดเองโดยลูกค้า |
| response | json | การเรียกกลับสถานะข้อความ |
ข้อความตอบกลับ SMS
response
| Parameter | Type | Description |
|---|---|---|
| event | string | reply |
| response_data | json object | ข้อมูลการตอบกลับ |
| template_id | int | รหัสเทมเพลต |
| template_type | int | ประเภทเนื้อหา SMS |
| label_id | int | รหัสป้ายกำกับ |
| user_id | int | รหัสผู้ใช้ |
| sms_user | string | ผู้ใช้ SMS |
| sms_id | string | รหัส SMS ผู้รับ |
| 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
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย
การแจ้งเตือนการเรียกกลับ SMS
ข้อความการแจ้งเตือน template_approval SMS
notification
| Parameter | Type | Description |
|---|---|---|
| event | string | template_approval |
| notification_data | json object | ข้อมูลการตอบกลับ |
| template_id | string | รหัสเทมเพลต |
| template_type | int | ประเภทเนื้อหา SMS |
| user_id | string | รหัสผู้ใช้ |
| 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"
}
}
}
โค้ดนี้โชว์เป็นหน้าต่างลอย









