Contents
WebChat
Commands
open
Opens the WebChat UI
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When Webchat is successfully opened | n/a |
| rejected | When WebChat is already open | {'type': 'error', 'text': 'already opened'} |
close
Closes the WebChat UI
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When Webchat is successfully closed | n/a |
| rejected | When WebChat is already closed | {'type': 'error', 'text': 'already closed'} |
configure
Modify configuration options for WebChat. See configuration page for WebChat
Options
| Option | Type | Description |
|---|---|---|
| chatButton.enabled | boolean | Enable/Disable chat button on screen |
| chatButton.openDelay | number | Number of milliseconds before displaying chat button on screen |
| chatButton.template | string | Custom HTML string template for chat button |
| chatButton.effect | string | Type of animation effect when revealing chat button. 'slide' or 'fade' |
| chatButton.effectDuration | number | Length of animation effect in milliseconds |
| chatButton.hideDuringInvite | boolean | When auto-invite feature is activated, hide the chat button. When invite is dismissed, reveal the chat button again. |
| autoInvite.enabled | boolean | Enable/Disable auto-invite feature. Automatically invites user to chat after user idles on page for preset time |
| autoInvite.timeToInviteSeconds | number | Number of seconds of idle time before inviting customer to chat |
| autoInvite.inviteTimeoutSeconds | number | Nunber of seconds to wait, after showing invite, before closing chat invite |
| emojis | boolean | Enable/Disable Emoji menu inside chat message input |
| actionsMenu | boolean | Enable/Disable actions menu next to chat message input |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When configuration options are provided and set | n/a |
| rejected | When no configuration options are provided | {'type': 'error', 'text': 'Invalid configuration'} |
minimize
Minimize or Unminimize WebChat UI
Options
| Option | Type | Description |
|---|---|---|
| minimized | boolean | Rather than toggling the current minimized state you can specify the minified state directly. true = minimized, false = uniminimized |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | Always | n/a |
| rejected | Never | {'type': 'error', 'text': 'Invalid configuration'} |
endChat
Starts the 'end chat' procedure. User may be prompted to confirm
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When there is an active chat session to end | n/a |
| rejected | When there is no active chat session to end | {'type':'error', 'text':'there is no active chat session to end'} |
invite
Show an invitation to chat using the Toaster popup element. Text shown in invitation can be edited in the localization file
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When WebChat is closed and the toast element is created successfully | n/a |
| rejected | When WebChat is already open. Prevents inviting a user that is already in a chat | {'type':'error', 'text':'Chat is already open. Ignoring invite command.'} |
reInvite
When an active chat session is unable to restore, this invitation will offer the user to start a new chat. Text shown in invitation can be edited in the localization file
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When WebChat is closed, the config item 'webchat.inviteOnRestoreTimeout' is set, and the toast element is created successfully | n/a |
| rejected | When WebChat is already open. Prevents inviting a user that is already in a chat | {'type':'error', 'text':'Chat is already open. Ignoring invite command.'} |
injectMessage
Inject a custom message into the chat transcript. Useful for extending WebChat functionality with other Genesys products
Options
| Option | Type | Description |
|---|---|---|
| type | string | Switch the rendering type of the injected message between text and html |
| name | string | Specify a name label for the message to identify what service or widget has injected the message |
| text | string | The content of the message. Either plain text or HTML |
| custom | boolean | If set to true, the default message template will not be used, allowing you to inject a highly customized HTML block unconstrained by the normal message template |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When WebChat is open and there is an active chat session | An HTML reference (jQuery wrapped set) to the new injected message. |
| rejected | When WebChat is not open and/or there is no active chat session | {'type':'error', 'text':'No active chat session.'} |
showChatButton
Makes the standalone chat button visible on the screen using either the default template and CSS or customer-defined ones
Options
| Option | Type | Description |
|---|---|---|
| openDelay | number | Duration in milliseconds to delay showing the chat buton on the page |
| duration | number | Duration in milliseconds for the show and hide animation |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When the chat button is enabled in the configuration, is currently not visible, and the CXSideBar plugin is not initialized | n/a |
| rejected | When the chat button is not enabled in the configuration, or it's already visible, or the CXSideBar plugin is initialized | {'type':'error', 'text':'Chat button is already visible. Ignoring command.'} |
| rejected | When the sidebar plugin is active the standalone chat button will be disabled automatically | {'type':'error', 'text':'CXSideBar is active and overrides the default chat button'} |
hideChatButton
Hides the standalone chat button
Options
| Option | Type | Description |
|---|---|---|
| duration | number | Duration in milliseconds for the show and hide animation |
Resolutions
| Status | When | Returns |
|---|---|---|
| resolved | When the chat button is currently visible | n/a |
| rejected | When the chat button is already hidden | {'type':'error', 'text':'Chat button is already hidden. Ignoring command.'} |
