发布虚拟任务助理的事件

代理适配器可以使用浏览器的 postMessage() API 将事件发送到父 iFrame。父 iFrame 中的 JavaScript 可以使用这些事件,并用于在自定义 CRM 实现中执行各种操作。为此,您的应用需要在父窗口中监听 MessageEvent。根据这些事件,您的应用可以触发相应操作,例如针对特定会话 ID 打开支持请求标签页。通话适配器和聊天适配器都有可用于增强 CRM 功能的特定事件。

Contact Center AI 平台支持以下虚拟任务助理事件:

  • 虚拟任务助理已加入

  • 虚拟任务助理

  • 虚拟任务助理收到了自定义会话变量

如需查看与代理适配器相关的完整 post 事件列表,请参阅代理适配器

虚拟任务助理已加入

当虚拟任务助理加入会话时,系统会传递此事件。

数据字段

  • call_id. 语音 (IVR) 会话的标识符。

  • chat_id. Web 或移动聊天会话的标识符。

  • campaign_id:宣传广告调用的标识符。

  • campaign_name:宣传广告系列的名称。

  • virtual_agent_id:虚拟任务助理的标识符。

  • virtual_agent_name:虚拟任务助理的名称。

  • participant_id:虚拟任务助理的参与者标识符。

  • queue_id:会话的来源队列的标识符。 仅当会话源自队列时,才会包含此标识符。

  • queue_path:会话的来源队列的路径。仅当会话源自队列时,才会包含此标识符。

  • queue_language_id:会话所源自的队列的语言。仅当会话源自队列时,才会包含此标识符。

  • session_type:会话类型,例如通过网络聊天进行的即时通讯入站会话。

  • conversation_id:使用对话配置文件的虚拟客服会话的标识符。

  • session_id:不使用对话配置文件的虚拟客服会话的标识符。

  • timestamp:活动发生的日期和时间。

  • data_parameters:在 CCAI 平台门户中配置并发送给虚拟任务助理的变量。

载荷示例

{
 "type": "Task_VA_Joined",
 "data": {
   "chat_id": 103646,
   "campaign_id": 1432,// omitted if not available
   "campaign_name": "Survey Movie", // omitted if not available
   "virtual_agent_id": 1,
   "virtual_agent_name": "name",
   "participant_id": 1,
   "queue_id": 8469, // omitted if not available
   "queue_path": "Developers / James", // omitted if not available
   "queue_language_id": "en", // omitted if not available
   "session_type": "Messaging Inbound (SMS)",
   "conversation_id": "12345",
   "session_id": "78534G4RT4284", // omitted if not available
   "timestamp": "1727853575",
   "data_parameters": {
     "param1": "one",
     "param2": "two"
   }
 }
}

虚拟任务助理

当虚拟任务助理离开会话时,系统会传递此事件。

数据字段

  • call_id. 语音 (IVR) 会话的标识符。

  • chat_id. Web 或移动聊天会话的标识符。

  • campaign_id:宣传广告调用的标识符。

  • campaign_name:宣传广告系列的名称。

  • virtual_agent_id:虚拟任务助理的标识符。

  • virtual_agent_name:虚拟任务助理的名称。

  • participant_id:虚拟任务助理的参与者标识符。

  • queue_id:会话的来源队列的标识符。 仅当会话源自队列时,才会包含此标识符。

  • queue_path:会话的来源队列的路径。仅当会话源自队列时,才会包含此标识符。

  • queue_language_id:会话所源自的队列的语言。仅当会话源自队列时,才会包含此标识符。

  • session_type:会话类型,例如通过网络聊天进行的即时通讯入站会话。

  • conversation_id:使用对话配置文件的虚拟客服会话的标识符。

  • session_id:不使用对话配置文件的虚拟客服会话的标识符。

  • timestamp:活动发生的日期和时间。

  • finish_reason:虚拟客服会话结束时的结束原因。

  • data_parameters:在 CCAI 平台门户中配置并发送给虚拟任务助理的变量。

  • captured_variables:虚拟任务助理捕获的会话变量。

载荷示例

{
 "type": "Task_VA_Left",
 "data": {
   "chat_id": 103646,
   "campaign_id": 1432, // omitted if not available
   "campaign_name": "Survey Movie", // omitted if not available
   "virtual_agent_id": 1,
   "virtual_agent_name": "name",
   "participant_id": 1,
   "queue_id": 8469, // omitted if not available
   "queue_path": "Developers / James", // omitted if not available
   "queue_language_id": "en", // omitted if not available
   "session_type": "Messaging Inbound (SMS)",
   "conversation_id": "12345",
   "session_id": "78534G4RT4284", // omitted if not available
   "timestamp": "1727853575",
   "finish_reason": "Task VA failed", // Finish reason passed when the VTA session ends 
   "data_parameters": {
     "param1": "one",
     "param2": "two"
   },
   "captured_variables": [
     {
       "intent_name": null,
       "variables": {
           "testkey": "testvalue"
       },
       "captured_at": "2024-11-15 16:46:31 UTC",
       "timestamp": "1727853575"
     },
     {
       "intent_name": null,
       "variables": {
           "testkey2": "testvalue2"
       },
       "captured_at": "2024-11-15 16:46:31 UTC",
       "timestamp": "1727853575"
     }
   ]
 }
}

收到了虚拟任务助理会话变量

当虚拟任务助理发送自定义会话变量载荷时,系统会传递此参数。

数据字段

  • call_id. 语音 (IVR) 会话的标识符。

  • chat_id. Web 或移动聊天会话的标识符。

  • campaign_id:宣传广告调用的标识符。

  • campaign_name:宣传广告系列的名称。

  • virtual_agent_id:虚拟任务助理的标识符。

  • virtual_agent_name:虚拟任务助理的名称。

  • queue_id:会话的来源队列的标识符。 仅当会话源自队列时,才会包含此标识符。

  • queue_path:会话的来源队列的路径。仅当会话源自队列时,才会包含此标识符。

  • queue_language_id:会话所源自的队列的语言。仅当会话源自队列时,才会包含此标识符。

  • session_type:会话类型,例如通过网络聊天进行的即时通讯入站会话。

  • conversation_id:使用对话配置文件的虚拟客服会话的标识符。

  • session_id:不使用对话配置文件的虚拟客服会话的标识符。

  • timestamp:活动发生的日期和时间。

  • data_parameters:在 CCAI 平台门户中配置并发送给虚拟任务助理的变量。

  • captured_variables:虚拟任务助理捕获的会话变量。

载荷示例

{
 "type": "Task_VA_Variables_Received",
 "data": {
   "chat_id": 103646,
   "campaign_id": 1432, // omitted if not available
   "campaign_name": "Survey Movie", // omitted if not available
   "virtual_agent_id": 1,
   "virtual_agent_name": "name",
   "participant_id": 1,
   "queue_id": 8469, // omitted if not available
   "queue_path": "Developers / James", // omitted if not available
   "queue_language_id": "en", // omitted if not available
   "session_type": "Messaging Inbound (SMS)",
   "conversation_id": "12345",
   "session_id": "78534G4RT4284", // omitted if not available
   "timestamp": "1727853575",
   "data_parameters": {
     "param1": "one",
     "param2": "two"
   },
   "captured_variables": [
     {
       "intent_name": null,
       "variables": {
           "testkey_1": "testvalue"
       },
       "captured_at": "2024-11-15 16:46:31 UTC",
       "timestamp": "1727853575"
     },
     {
       "intent_name": null,
       "variables": {
           "testkey_2": "testvalue2"
       },
       "captured_at": "2024-11-15 16:46:31 UTC",
       "timestamp" : "1727853575"
     }
   ]
 }
}

用于自定义会话变量的 Dialogflow 载荷

Dialogflow 自定义会话变量载荷支持虚拟任务助理发布事件。

客户会话变量载荷中可用的属性包括:

  • capture_type:event:表示客户会话变量载荷中返回的值必须在虚拟任务助理帖子事件中传递。

  • capture_type:agent:表示客户会话变量载荷中返回的值必须传递到代理适配器中。

  • capture_type:comment:表示客户会话变量载荷中返回的值必须作为注释传递到 CRM 记录中。

  • invisible_to_adapter_events。此属性中指定的键的值必须从虚拟任务助理帖子事件中排除。

载荷示例

{
 "ujet": {
   "session_variable": {
     "payload": {
       "key_two": "$session.params.favfood",
       "key_three": "$session.params.budget",
       "key_one": "$session.params.location",
       "key_four": "$session.params.startdate",
       "key_five": "$session.params.enddate"
     },
     "capture_type": [
       "comment",
       "agent",
       "event"
     ],
     "capture_target": "payload",
     "invisible_to_agent": [
       "key_one",
       "key_two"
     ],
     "invisible_to_adapter_events": [
       "key_three",
       "key_two"
     ]
    }
  }
}