You can use the events methods to enable apps to react to events that occur in the user interface of a page. The events includes button clicks or changes and updates to field values. An app can register event listeners that are invoked when an event occurs. Some events can be intercepted and an app can decide to allow or prevent the event from completing.
Event Payload
When the callback method is invoked, an event payload is passed to it. The payload is a JavaScript object that contains a type field and data object.
1 2 3 4 | // event_type contains the name of the event var event_type = event.type; // event_data is a JSON whose value depends on the type of event var event_data = event.helper.getData(); |
Click Events
The events occur when a user clicks a button or link.
Event | Event Payload | Trigger | Available Locations |
---|---|---|---|
call.holdToggled | currentCall object | When an agent holds or releases a call | conversation_card widget_conversation_card |
call.muteToggled | currentCall object | When an agent mutes or unmutes a call | conversation_card widget_conversation_card |
call.recordingStarted | currentCall object | When an agent manually starts call recording | conversation_card widget_conversation_card |
call.recordingPaused | currentCall object | When an agent pauses call recording | conversation_card widget_conversation_card |
call.recordingResumed | currentCall object | When an agent resumes call recording | conversation_card widget_conversation_card |
Change Events
The events occur when there is a change to a value on the user interface.
Event | Event Payload | Trigger | Available Locations |
---|---|---|---|
agent.statusChanged | loggedInAgent object | When an agent’s status is changed | conversation_card widget_conversation_card |
call.ended | currentCall object | When a call is disconnected | conversation_card widget_conversation_card |
call.contactEdited | currentCall object | When an agent updates a contact’s details | conversation_card |
call.linkedToAnotherContact | currentCall object | When an agent links another contact to a current call | conversation_card widget_conversation_card |
Intercept Event
Event | Trigger | Available Locations |
---|---|---|
call.saveAndClose | When an agent clicks the Save and close button | conversation_card widget_conversation_card |