共用方式為


開始聊天

Customer Service 全通路提供一組展現 Dynamics 365 Customer Service Enterprise 強大威力的功能套件,讓組織可以立即與不同數位傳訊管道中的客戶進行聯繫和互動。 存取 Customer Service 全通路需要額外的授權。 如需詳細資訊,請參閱 Dynamics 365 Customer Service 定價概觀Dynamics 365 Customer Service 定價方案頁面。

開啟現有的聊天 (如果有的話)。 否則,它會啟動新的聊天。 可以使用 customContext 方法中的參數直接傳遞上下文來初始化聊天會話。

備註

  • 在呼叫即時聊天 SDK 方法之前,先接聽即時聊天引發的 lcw:ready 事件。 應該在引發 lcw:ready 事件之後叫用即時聊天方法。 您可以在視窗物件上新增自己的事件接聽程式,以監聽此事件。
  • 如果您使用 SDK API 來setContextProvider傳遞內容,則不需要使用該startChat方法。

語法

Microsoft.Omnichannel.LiveChatWidget.SDK.startChat({inNewWindow: inNewWindowValue,customContext: customContextObject});

參數

參數 類型 為必填項目 Description
inNewWindow 布林值 決定是否在新視窗中開啟聊天。
customContext 物體 同步設定自訂內容提供者。 如果您在 中 setContextProvider設定了值,則該值將被您為 設定的 customContext值覆寫。

返回值

None

Example

 Microsoft.Omnichannel.LiveChatWidget.SDK.startChat({
    inNewWindow: true,
   customContext: {
        'contextKey1': {'value': 'contextValue1', 'isDisplayable': true}
    }
});

setAuthToken提供者
setContextProvider
即時聊天 SDK 的 JavaScript API 參考