SocialHook
الوثائق/مرجع الـ Payload

مرجع الـ Payload

كل تسليم webhook يستخدم هذا الهيكل. الحقول المشتركة متسقة عبر المنصات. الحقول الخاصة بكل منصة موثقة أدناه.

الحقول المشتركة (جميع المنصات)

الحقلالنوعالوصف
platformstring"facebook" | "instagram" | "whatsapp"
eventstring"message.received" | "conversation.started" | "status.update"
timestampnumberطابع زمني Unix (بالثواني) لوقت وقوع الحدث
webhook_idstringمعرف إعداد webhook الخاص بك في SocialHook
conversation_idstringمعرف ثابت لخيط المحادثة
messageobjectكائن محتوى الرسالة (يتفاوت حسب المنصة والنوع)

WhatsAppحقول خاصة بـ

الحقلالنوعالوصف
fromstringرقم هاتف المرسل بتنسيق E.164 (+15550001234)
profile.namestringالاسم المعروض في WhatsApp للمرسل
message.typestring"text" | "image" | "audio" | "video" | "document" | "location" | "sticker"
message.bodystringنص الرسالة (لـ type="text")
message.media_urlstringرابط لتنزيل الوسائط (للصور/الصوت/الفيديو/المستندات)

Facebookحقول خاصة بـ

الحقلالنوعالوصف
from.idstringمعرف مستخدم Facebook للمرسل (PSID)
from.namestringالاسم المعروض في Facebook للمرسل
page_idstringمعرف صفحة Facebook التي استقبلت الرسالة
message.textstringمحتوى نص الرسالة
message.attachmentsarrayمصفوفة كائنات المرفقات للصور والفيديوهات وغيرها

Instagramحقول خاصة بـ

الحقلالنوعالوصف
from.idstringمعرف مستخدم Instagram للمرسل
from.usernamestring@username المرسل
account_idstringمعرف حساب Instagram Business
message.textstringمحتوى نص الرسالة المباشرة
story_idstringمعرف القصة عندما تكون الرسالة ردًا على قصة (اختياري)