สร้าง จุดเชื่อมต่อ Webhook
สร้าง Webhook ที่ URL HTTP(S) แบบ absolute และแนะนำ HTTPS สำหรับ production status เป็น active หรือ inactive subscribed_events รับ public event หรือ ["*"] และ max_attempts 0..5
https://api.unifyport.ai/v1/webhook-endpointsส่วนหัว
X-Api-KeyAPI key ของพื้นที่ทำงาน ระบบจะระบุพื้นที่ทำงานจากส่วนหัวนี้
Content-Typeใช้ application/json เมื่อต้องส่งเนื้อหาของคำขอเป็น JSON
พารามิเตอร์ใน path
จุดเชื่อมต่อนี้ไม่มีพารามิเตอร์ใน path
เนื้อหาของคำขอ
urlURL HTTP(S) แบบ absolute ที่รับ Webhook และแนะนำ HTTPS สำหรับ production
format: uri
statusสถานะ endpoint: active หรือ inactive
enum: active, inactive
subscribed_events[]public standard event ที่ส่งไปยัง จุดเชื่อมต่อ โดย ["*"] หมายถึง public event ทั้งหมด แต่ไม่รวม provider.raw_event
signing_secretsecret สำหรับลงนาม Webhook แบบเลือก ในตัวอย่างให้ใช้ค่าตัวแทน
retry_policyobjectmax_attempts คือจำนวน retry หลังการส่งครั้งแรก ค่าเริ่มต้น 3 ช่วง 0–5 และ 0 หมายถึงส่งครั้งแรกเท่านั้น
retry_policymax_attempts คือจำนวน retry หลังการส่งครั้งแรก ค่าเริ่มต้น 3 ช่วง 0–5 และ 0 หมายถึงส่งครั้งแรกเท่านั้น
max_attemptsจำนวน retry หลังการส่งครั้งแรก ตั้งแต่ 0 ถึง 5
เนื้อหาการตอบกลับ
idตัวระบุ จุดเชื่อมต่อ Webhook (we_...)
urlURL HTTP(S) แบบ absolute ที่รับ Webhook และแนะนำ HTTPS สำหรับ production
format: uri
statusสถานะ จุดเชื่อมต่อ: active หรือ inactive
enum: active, inactive
subscribed_events[]public standard event ของ จุดเชื่อมต่อ; ["*"] หมายถึง public event ทั้งหมดโดยไม่รวม provider.raw_event
signing_enabledเป็น true เมื่อมีการตั้ง signing secret และการนำส่งถูกลงนาม
retry_policyobjectmax_attempts นับ retry หลังการส่งครั้งแรก ค่าเริ่มต้น 3 ช่วง 0–5
retry_policymax_attempts นับ retry หลังการส่งครั้งแรก ค่าเริ่มต้น 3 ช่วง 0–5
max_attemptsจำนวน retry หลังการส่งครั้งแรกที่ตั้งไว้ ตั้งแต่ 0 ถึง 5
การตอบกลับ
201คำขอสำเร็จ ดูตัวอย่างเนื้อหาตอบกลับด้านบน
400เนื้อหาของคำขอ path หรือพารามิเตอร์ไม่ถูกต้อง
401ส่วนหัว X-Api-Key หายไปหรือไม่ถูกต้อง
คำขอ
curl -X POST https://api.unifyport.ai/v1/webhook-endpoints \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhook",
"status": "active",
"subscribed_events": ["*"],
"signing_secret": "<WEBHOOK_SIGNING_SECRET>"
}'การตอบกลับ
{
"data": {
"id": "we_example",
"url": "https://example.com/webhook",
"status": "active",
"subscribed_events": ["*"],
"signing_enabled": true,
"retry_policy": {
"max_attempts": 3
}
}
}