lightning:conversationChatEnded

Messaging event triggered when an active chat ends or an agent leaves a chat conference. This event is also triggered when using Enhanced Messaging channels. To work with Enhanced Messaging channels, the session must be active and the Enhanced Conversation Component must be visible on the page.

Response 

NameTypeDescription
recordIdStringThe ID of the work record that’s associated with the current chat.

Example 

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" description="Conversation toolkit api sample">
2  <lightning:conversationToolkitAPI aura:id="conversationKit" />
3  <aura:handler event="lightning:conversationChatEnded" action="{!c.onChatEnded}" />
4</aura:component>

Controller code:

1({
2    onChatEnded: function(cmp, evt, helper) {
3        var conversation = cmp.find("conversationKit");
4        var recordId = evt.getParam("recordId");
5
6        console.log("recordId:" + recordId);
7    }
8})