Comments or questions about this documentation? Contact us for support!
(Created target blank page For Version: PSAAS:Julie) |
(Update with the copy of version: Public) |
||
Line 1: | Line 1: | ||
− | <!-- | + | = API Events = |
+ | Once you've registered your own plugin on the bus, you can subscribe and listen for published events. Below we'll quickly register a new plugin on the bus using the global bus object. | ||
+ | |||
+ | {{NoteFormat|The global bus object is a debug tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see [[GWCBusExtensions|Widgets Extensions]] for more information about extending Genesys Widgets.|1}} | ||
+ | |||
+ | <source lang='javascript'>var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin'); | ||
+ | |||
+ | oMyPlugin.subscribe('WebChat.ready', function(e){});</source> | ||
+ | |||
+ | |||
+ | {| | ||
+ | |- | ||
+ | ! Name | ||
+ | ! Description | ||
+ | ! Data | ||
+ | |- | ||
+ | | ready | ||
+ | | WebChat is initialized and ready to accept commands | ||
+ | | n/a | ||
+ | |- | ||
+ | | opened | ||
+ | | The WebChat widget has appeared on screen | ||
+ | | n/a | ||
+ | |- | ||
+ | | started | ||
+ | | The WebChat has successfully started. | ||
+ | | [[WebChatMetadata|Metadata]] | ||
+ | |- | ||
+ | | submitted | ||
+ | | The user has submitted the form. | ||
+ | | [[WebChatMetadata|Metadata]] | ||
+ | |- | ||
+ | | completed | ||
+ | | The Chat session ended after agent is successfully connected to WebChat. | ||
+ | | [[WebChatMetadata|Metadata]] | ||
+ | |- | ||
+ | | cancelled | ||
+ | | The Chat session ended before agent is connected to WebChat. | ||
+ | | [[WebChatMetadata|Metadata]] | ||
+ | |- | ||
+ | | closed | ||
+ | | The WebChat widget has been removed from the screen | ||
+ | | [[WebChatMetadata|Metadata]] | ||
+ | |- | ||
+ | | minimized | ||
+ | | The WebChat widget has been changed to a minimized state | ||
+ | | n/a | ||
+ | |- | ||
+ | | unminimized | ||
+ | | The WebChat widget has been restored from a minimized state to the standard view | ||
+ | | n/a | ||
+ | |- | ||
+ | | messageAdded | ||
+ | | When a message is added to the transcript, this event will fire | ||
+ | | Returns an object containing two properties: 'data' and 'html'. 'data' contains the JSON data for the message, while 'html' contains a reference to the visible message inside the chat transcript. | ||
+ | |- | ||
+ | |} | ||
+ | <br/><br/> | ||
+ | |||
+ | [[Category:V:PSAAS:Julie]] |
Once you've registered your own plugin on the bus, you can subscribe and listen for published events. Below we'll quickly register a new plugin on the bus using the global bus object.
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.subscribe('WebChat.ready', function(e){});
Name | Description | Data |
---|---|---|
ready | WebChat is initialized and ready to accept commands | n/a |
opened | The WebChat widget has appeared on screen | n/a |
started | The WebChat has successfully started. | Metadata |
submitted | The user has submitted the form. | Metadata |
completed | The Chat session ended after agent is successfully connected to WebChat. | Metadata |
cancelled | The Chat session ended before agent is connected to WebChat. | Metadata |
closed | The WebChat widget has been removed from the screen | Metadata |
minimized | The WebChat widget has been changed to a minimized state | n/a |
unminimized | The WebChat widget has been restored from a minimized state to the standard view | n/a |
messageAdded | When a message is added to the transcript, this event will fire | Returns an object containing two properties: 'data' and 'html'. 'data' contains the JSON data for the message, while 'html' contains a reference to the visible message inside the chat transcript. |