تطبيقات لوحة التحكم

"Dashboard Apps in Bevatel enable organizations to embed external applications within the dashboard, providing valuable context for customer support agents during interactions."

تطبيقات لوحة التحكم

تتيح تطبيقات لوحة التحكم للمؤسسات تضمين تطبيق داخل لوحة التحكم في بيفاتيل لتوفير السياق لوكلاء دعم العملاء. تتيح هذه الميزة لك إنشاء تطبيق بشكل مستقل وتضمينه داخل اللوحة لتوفير معلومات المستخدم، وطلباتهم، أو تاريخ دفعهم السابق.

عند تضمين تطبيقك باستخدام لوحة التحكم في بيفاتيل، سيحصل تطبيقك على سياق المحادثة وجهة الاتصال كحدث للنافذة. قم بتنفيذ مستمع لحدث الرسالة على صفحتك لاستلام السياق.

كيفية إنشاء تطبيق لوحة التحكم:

  1. انتقل إلى الإعدادات > عمليات التكامل > تطبيقات لوحة المعلومات

  2. انقر على "إضافة تطبيق لوحة معلومات جديد".

  3. أضف اسم تطبيقك وعنوان URL لتطبيقك.

استقبال البيانات من بيفاتيل إلى تطبيقك:

ستقوم Bevatel بإرسال سياق المحادثة والاتصال كحدث للنافذة (window event). يمكنك الاستماع إليه في تطبيقك كما هو موضح أدناه.

window.addEventListener("message", function (event) {
  if (!isJSONValid(event.data)) {
    return;
  }

  const eventData = JSON.parse(event.data);
});

طلب البيانات بشكل صريح من بيفاتيل.

إذا كانت حالة الاستخدام الخاصة بك تتطلب منك طلب بيانات المحادثة عند الطلب من Bevatel، يمكنك فعل ذلك بسهولة عن طريق إرسال رسالة بسيطة إلى النافذة الرئيسية باستخدام واجهة javascript postMessage.

سوف تستمع بيفاتيل إلى هذا المفتاح bevatel-dashboard-app:fetch-info.

مثال

يمكنك الاستعلام عن لوحة التحكم في التطبيق باستخدام الشيفرة التالية. ستكون بيفاتيل تستمع إلى هذا المفتاح وترسل فوراً حمولة المحادثة المحدثة إلى الشخص الذي قام بالطلب.

window.parent.postMessage('bevatel-dashboard-app:fetch-info', '*')

// You would get a message in the on message listener with the appContext payload.

حمولة الحدث

كائن المحادثة

{
  "meta": {
    "sender": {
      "additional_attributes": {
        "description": "string",
        "company_name": "string",
        "social_profiles": {
          "github": "string",
          "twitter": "string",
          "facebook": "string",
          "linkedin": "string"
        }
      },
      "availability_status": "string",
      "email": "string",
      "id": "integer",
      "name": "string",
      "phone_number": "string",
      "identifier": "string",
      "thumbnail": "string",
      "custom_attributes": "object",
      "last_activity_at": "integer"
    },
    "channel": "string",
    "assignee": {
      "id": "integer",
      "account_id": "integer",
      "availability_status": "string",
      "auto_offline": "boolean",
      "confirmed": "boolean",
      "email": "string",
      "available_name": "string",
      "name": "string",
      "role": "string",
      "thumbnail": "string"
    },
    "hmac_verified": "boolean"
  },
  "id": "integer",
  "messages": [
    {
      "id": "integer",
      "content": "Hello",
      "inbox_id": "integer",
      "conversation_id": "integer",
      "message_type": "integer",
      "content_type": "string",
      "content_attributes": {},
      "created_at": "integer",
      "private": "boolean",
      "source_id": "string",
      "sender": {
        "additional_attributes": {
          "description": "string",
          "company_name": "string",
          "social_profiles": {
            "github": "string",
            "twitter": "string",
            "facebook": "string",
            "linkedin": "string"
          }
        },
        "custom_attributes": "object",
        "email": "string",
        "id": "integer",
        "identifier": "string",
        "name": "string",
        "phone_number": "string",
        "thumbnail": "string",
        "type": "string"
      }
    }
  ],
  "account_id": "integer",
  "additional_attributes": {
    "browser": {
      "device_name": "string",
      "browser_name": "string",
      "platform_name": "string",
      "browser_version": "string",
      "platform_version": "string"
    },
    "referer": "string",
    "initiated_at": {
      "timestamp": "string"
    }
  },
  "agent_last_seen_at": "integer",
  "assignee_last_seen_at": "integer",
  "can_reply": "boolean",
  "contact_last_seen_at": "integer",
  "custom_attributes": "object",
  "inbox_id": "integer",
  "labels": "array",
  "muted": "boolean",
  "snoozed_until": null,
  "status": "string",
  "timestamp": "integer",
  "unread_count": "integer",
  "allMessagesLoaded": "boolean",
  "dataFetched": "boolean"
}

كائن الاتصال

{
  "additional_attributes": {
    "description": "string",
    "company_name": "string",
    "social_profiles": {
      "github": "string",
      "twitter": "string",
      "facebook": "string",
      "linkedin": "string"
    }
  },
  "availability_status": "string",
  "email": "string",
  "id": "integer",
  "name": "string",
  "phone_number": "+91 9000000001",
  "identifier": "string || null",
  "thumbnail": "+91 9000000001",
  "custom_attributes": {},
  "last_activity_at": "integer"
}

كائن الوكيل الحالي

{
  "email": "string",
  "id": "integer",
  "name": "string"
}

الحمولة النهائية

{
  "event": "appContext",
  "data": {
    "conversation": {
      // <...Conversation Attributes>
    },
    "contact": {
      // <...Contact Attributes>
    },
    "currentAgent": {
      // <...Current agent Attributes>
    }
  }
}

Last updated