Skip to content

ส่งการแจ้งเตือนภายนอก (Send Notify External)

ใช้ endpoint นี้เพื่อส่งข้อความแจ้งเตือนออกไปยังสมาชิกในระบบ

📘 URL สำหรับเรียกใช้งาน

POST https://openapi.zwiz.app/th/zignal/api/external/notify

📥 Request Headers

ชื่อประเภทจำเป็นคำอธิบาย
X-System-IdStringรหัสระบบที่ได้รับจาก เมนู Home
X-Api-KeyStringรหัสผ่านแบบ HMAC-SHA256 จาก สร้าง Access Token
Content-TypeStringapplication/json

📥 Request Body

ชื่อประเภทจำเป็นคำอธิบาย
receive_member_idsArray of StringGet Business Members ใช้เลือกสมาชิกที่จะได้รับการแจ้งเตือน
sender_idStringรหัสผู้ส่ง (จะแสดงในหัวข้อของการแจ้งเตือน)
sender_nameStringชื่อผู้ส่ง (แสดงในหัวข้อการแจ้งเตือน)
sender_picture_urlStringรูปภาพผู้ส่ง (แสดงในหัวข้อการแจ้งเตือน)
notify_contentArray of Objectรายการเนื้อหาที่จะส่ง (text หรือ image)
created_byStringผู้สร้างการแจ้งเตือน

📘 โครงสร้าง notify_content

ชื่อประเภทจำเป็นคำอธิบาย
typeStringContent type: text or image
textStringWhen type is textText to display
urlStringWhen type is imageImage 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"
}