الأزرار
يمكنك استخدام أزرار بكل نوع: call, url, node. يمكنك توفير إجراء مخصص يتم تنفيذه باستخدام الزر. يمكن ربط الإجراءات فقط بأنواع الأزرار url، و node . يجب أن تتوافق إجراءات الأزرار مع نفس التنسيق والقيود الموضحة في تنسيق الإجراءات.
{ "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text", "buttons": [ { "type": "url", "caption": "External link", "url": "https://NewAge Ai.com.au", }, { ...Another buttons } ] }, { ...Another messages } ], "actions": [ //optional { "action": "add_tag", "tag_name": "example tag" }, { ...Another actions } ], "quick_replies": [ //optional { "type": "node", "caption": "Quick reply text", "target": "My Content" }, { ...Another quick replies } ] }}
زر النداء
{ "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "call", "caption": "Call me", "phone": "+1 (555) 555-55-55" } ] } ], "actions": [], "quick_replies": [] }}
زر URL
هناك 3 خيارات من:webview_size
full - (100%),
medium - (75%),
compact - (50%)
الخاصية webview_size و actions اختيارية.
{ "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "url", "caption": "External link", "url": "https://NewAge Ai.com.au", "webview_size": "full", "actions": [] //optional } ] } ], "actions": [], "quick_replies": [] }}
زر الانتقال إلى العقدة
الخاصية actions اختيارية.
{ "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "node", "caption": "Show", "target": "My Content", "actions": [] //optional } ] } ], "actions": [], "quick_replies": [] }}
target يجب أن يكون المفتاح مرتبطا بعقدة موجودة ضمن تدفق المنفذ. يمكن العثور على اسم العقدة في رأسها، وتحتاج إلى استخدام اسم فريد للعقدة المتصلة بالرابط. إذا كان هناك عدة عقد بأسماء متشابهة داخل نفس التدفق، فإن سلوك الانتقال لن يفي بالتوقعات. أزرار الانتقال إلى العقدة غير مدعومة في واجهة برمجة التطبيقات العامة.
زر استدعاء الكتلة الديناميكية
الخصائص "headers"، "payload" اختيارية.
{ "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "dynamic_block_callback", "caption": "Dynamic content", "url": "https://your-service.com/dynamic", "method": "post", "headers": { "x-header": "value" }, "payload": { "key": "value" } } ] } ], "actions": [], "quick_replies": [] }}
dynamic_block_callback يعمل بنفس طريقة الحظر الديناميكي في عقدة المحتوى، حيث يرسل الطلب إلى الخادم عند النقر، وسيتم إرسال رد الخادم إلى المستخدم. يجب ذكر رابط الخادم الخارجي مع بروتوكول HTTPS.