ส่งการแจ้งเตือนภายนอก (Send Notify External)
ใช้ endpoint นี้เพื่อส่งข้อความแจ้งเตือนออกไปยังสมาชิกในระบบ
📘 URL สำหรับเรียกใช้งาน
POST https://openapi.zwiz.app/th/zignal/api/external/notify📥 Request Headers
| ชื่อ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
X-System-Id | String | ✅ | รหัสระบบที่ได้รับจาก เมนู Home |
X-Api-Key | String | ✅ | รหัสผ่านแบบ HMAC-SHA256 จาก สร้าง Access Token |
Content-Type | String | ✅ | application/json |
📥 Request Body
| ชื่อ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
receive_member_ids | Array of String | ✅ | Get Business Members ใช้เลือกสมาชิกที่จะได้รับการแจ้งเตือน |
sender_id | String | ✅ | รหัสผู้ส่ง (จะแสดงในหัวข้อของการแจ้งเตือน) |
sender_name | String | ❌ | ชื่อผู้ส่ง (แสดงในหัวข้อการแจ้งเตือน) |
sender_picture_url | String | ❌ | รูปภาพผู้ส่ง (แสดงในหัวข้อการแจ้งเตือน) |
notify_content | Array of Object | ✅ | รายการเนื้อหาที่จะส่ง (text หรือ image) |
created_by | String | ✅ | ผู้สร้างการแจ้งเตือน |
📘 โครงสร้าง notify_content
| ชื่อ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
type | String | ✅ | Content type: text or image |
text | String | When type is text | Text to display |
url | String | When type is image | Image URL |
💡 ตัวอย่างคำขอ
bash
curl --location 'https://openapi.zwiz.app/th/zignal/api/external/notify' \
--header 'X-System-Id: {example-system-id}' \
--header 'X-Api-Key: {generated-x-api-key}' \
--header 'Content-Type: application/json' \
--data '{
"receive_member_ids": ["example-member-id"],
"sender_id": "xxx",
"sender_name": "xxx",
"sender_picture_url": "xxx",
"notify_content": [
{
"type": "text",
"text": "test"
},
{
"type": "image",
"url": "https://Example.png"
}
],
"created_by": "xxx"
}'📤 ตัวอย่างผลลัพธ์
json
{
"status": "success",
"message": "Notification sent successfully"
}