Jump to: navigation, search
(Update with the copy of version: 8.5.0)
(Update with the copy of version: draft)
Line 1: Line 1:
 
= API Commands =
 
= API Commands =
 
+
{{NoteFormat|Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/ChannelSelector-combined#API_Commands}}
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. 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.command('ChannelSelector.open');</source>
 
 
 
== close ==
 
Closes the ChannelSelector UI.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('ChannelSelector.close').done(function(e){
 
 
 
// ChannelSelector closed successfully
 
 
 
}).fail(function(e){
 
 
 
// ChannelSelector failed to close
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When ChannelSelector is successfully closed
 
| n/a
 
|-
 
| rejected
 
| When ChannelSelector is already closed
 
| Already closed
 
|-
 
|}
 
== open ==
 
Opens the ChannelSelector UI.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('ChannelSelector.open').done(function(e){
 
 
 
// ChannelSelector opened successfully
 
 
 
}).fail(function(e){
 
 
 
// ChannelSelector failed to open
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When ChannelSelector widget is successfully opened
 
| n/a
 
|-
 
| rejected
 
| When ChannelSelector widget is already open
 
| 'Already open'
 
|-
 
|}
 
== configure ==
 
Modify the configuration for ChannelSelector.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('ChannelSelector.conifugre', {
 
 
 
channels: [
 
{
 
enabled: true,
 
clickCommand: 'CallUs.open',
 
readyEvent: 'CallUs.ready',
 
displayName: 'Call Us',
 
i18n: 'CallusTitle',
 
icon: 'call-outgoing',
 
html:  '',
 
ewt:{
 
 
 
display: true,
 
queue:'chat_ewt_test_eservices',
 
availabilityThresholdMin:60,
 
availabilityThresholdMax:600
 
}
 
}
 
]
 
 
 
}).done(function(e){
 
 
 
// ChannelSelector configured successfully
 
 
 
}).fail(function(e){
 
 
 
// ChannelSelector failed to configure
 
});
 
</source>
 
 
 
<br />
 
=== Options ===
 
{|
 
|-
 
! Option
 
! Type
 
! Description
 
|-
 
| ewtRefreshInterval
 
| number
 
| EWT is updated for every time interval (seconds) defined.
 
|-
 
| channels
 
| array
 
| Array containing each channel configuration object. The order of channels are displayed based on the order defined here.
 
|-
 
| channels[].enable
 
| boolean
 
| Enable/Disable chat channel.
 
|-
 
| channels[].clickCommand
 
| string
 
| The CXBus command name for opening a particular widget when clicked on this channel.
 
|-
 
| channels[].readyEvent
 
| string
 
| Subscribes to this ready event published by a plugin and enables the channel when that plugin is ready.
 
|-
 
| channels[].displayName
 
| string
 
| A channel name to display in ChannelSelector widget.
 
|-
 
| channels[].i18n
 
| string
 
| To support localization of channel display name, this takes a key parameter of channelselector section in language pack file. Overides above displayName.
 
|-
 
| channels[].icon
 
| string
 
| Select from one of the Genesys Widgets icons by specifying icon css class name.
 
|-
 
| channels[].html
 
| string
 
| Overides and replaces the icon section of a channel with the html (image tag) defined here.
 
|-
 
| channels[].ewt.display
 
| boolean
 
| To display estimated waiting time details.
 
|-
 
| channels[].ewt.queue
 
| string
 
| EWT service channel virtual queue name.
 
|-
 
| channels[].ewt.availabilityThresholdMin
 
| number
 
| If EWT is greater than 0 and less this minimum threshold value (seconds), estimated waiting time is shown with yellow warning icon.
 
|-
 
| channels[].ewt.availabilityThresholdMax
 
| number
 
| If EWT is greater than minimum threshold value and less maximum threshold value (seconds), estimated waiting time is shown with red alert icon.
 
|-
 
| channels[].ewt.hideChannelWhenThresholdMax
 
| boolean
 
| Hides this channel when estimated waiting time is greater than maximum threshold value.
 
|-
 
|}
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When configuration options are provided and set
 
| n/a
 
|-
 
| rejected
 
| When no configuration options are provided
 
| 'Invalid configuration'
 
|-
 
|}
 
== displayStats ==
 
Estimated Waiting Time and availability details are displayed for each channel.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('ChannelSelector.displayStats').done(function(e){
 
 
 
// ChannelSelector displayed stats successfully
 
 
 
}).fail(function(e){
 
 
 
// ChannelSelector failed to display stats
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When Estimated Waiting Time is displayed successfully.
 
| n/a
 
|-
 
| rejected
 
| When StatsService fails to retrieve EWT data.
 
| 'Unable to display EWT Stats in ChannelSelector'
 
|-
 
| rejected
 
| When enableEwt config is disabled or when required channel plugins are not ready.
 
| 'Either EWT config is disabled or plugins not yet ready'
 
|-
 
|}
 
== disableStats ==
 
UI is cleared of any Estimated Waiting time. Fetching it for the defined time interval is also disabled.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('ChannelSelector.disableStats').done(function(e){
 
 
 
// ChannelSelector disabled stats successfully
 
 
 
}).fail(function(e){
 
 
 
// ChannelSelector failed to disable stats
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When ChannelSelector widget is successfully opened
 
| n/a
 
|-
 
| rejected
 
| When ChannelSelector widget is not opened
 
| 'ChannelSelector not opened to disable stats details'
 
|-
 
| rejected
 
| When EWT is disabled for all channels
 
| 'Stats already disabled'
 
|-
 
|}
 
== enableStats ==
 
UI is shown back with estimated Waiting time and availability details. Fetching it for the defined time interval is also enabled.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('ChannelSelector.enableStats').done(function(e){
 
 
 
// ChannelSelector enabled stats successfully
 
 
 
}).fail(function(e){
 
 
 
// ChannelSelector failed to enable stats
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When ChannelSelector widget is successfully opened.
 
| n/a
 
|-
 
| rejected
 
| When Estimated Waiting time details are already displayed.
 
| 'Stats already enabled'
 
|-
 
| rejected
 
| When ChannelSelector widget is not opened.
 
| 'ChannelSelector not opened to enable stats details'
 
|-
 
|}
 
  
 
[[Category:V:PSAAS:Public]]
 
[[Category:V:PSAAS:Public]]

Revision as of 21:52, October 17, 2019

API Commands

Important
Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/ChannelSelector-combined#API_Commands
Comments or questions about this documentation? Contact us for support!