startChat
Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise to enable organizations to instantly connect and engage with their customers across digital messaging channels. An additional license is required to access Omnichannel for Customer Service. For more information, see the Dynamics 365 Customer Service pricing overview and Dynamics 365 Customer Service pricing plan pages.
Opens an existing chat, if any. Otherwise, it initiates a new chat. You can use the customContext
parameter in the method to directly pass the context to initialize the chat session.
Note
- Listen to the lcw:ready event raised by a live chat before calling the live chat SDK methods. The live chat methods should be invoked after the lcw:ready event is raised. You can listen for this event by adding your own event listener on the window object.
- You don't need to use the
setContextProvider
method if you are using thestartChat
SDK API to pass the context.
Syntax
Microsoft.Omnichannel.LiveChatWidget.SDK.startChat({inNewWindow: inNewWindowValue,customContext: customContextObject});
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
inNewWindow |
Boolean | No | Decides whether to open the chat in a new window. |
customContext |
Object | No | Set the custom context provider synchronously. If you've set a value in setContextProvider , it will be overridden by the value you've set for customContext . |
Return value
None
Example
Microsoft.Omnichannel.LiveChatWidget.SDK.startChat({
inNewWindow: true,
customContext: {
'contextKey1': {'value': 'contextValue1', 'isDisplayable': true}
}
});
See also
setAuthTokenProvider
setContextProvider
JavaScript API reference for live chat SDK
意見反映
https://aka.ms/ContentUserFeedback。
即將推出:我們會在 2024 年淘汰 GitHub 問題,並以全新的意見反應系統取代並作為內容意見反應的渠道。 如需更多資訊,請參閱:提交及檢視以下的意見反映: