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 =
  
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|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/CallUs-combined#API_Commands.}}
 
 
{{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('CallUs.open');</source>
 
 
 
== open ==
 
Opens the CallUs UI.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('CallUs.open').done(function(e){
 
 
 
// CallUs opened successfully
 
 
 
}).fail(function(e){
 
 
 
// CallUs failed to open
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When CallUs is successfully opened
 
| n/a
 
|-
 
| rejected
 
| When CallUs is already open
 
| 'Already opened'
 
|-
 
|}
 
== close ==
 
Closes the CallUs UI.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('CallUs.close').done(function(e){
 
 
 
// CallUs closed successfully
 
 
 
}).fail(function(e){
 
 
 
// CallUs failed to close
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When CallUs successfully closed
 
| n/a
 
|-
 
| rejected
 
| When CallUs is already closed
 
| 'Already closed'
 
|-
 
|}
 
== configure ==
 
Internal use only. The main App plugin shares configuration settings to widgets using each widget’s configure command. The configure command can only be called once at startup. Calling configure again after startup may result in unpredictable behavior.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('CallUs.configure', {
 
 
 
contacts: [
 
{
 
displayName: 'Payments',
 
i18n: 'Number001',
 
number: '1 888 436 3797'
 
}
 
],
 
hours: ['8am - 8pm Mon - Fri']
 
 
 
}).done(function(e){
 
 
 
// CallUs configred successfully
 
 
 
}).fail(function(e){
 
 
 
// CallUs failed to configure
 
});
 
</source>
 
 
 
<br />
 
=== Options ===
 
{|
 
|-
 
! Option
 
! Type
 
! Description
 
|-
 
| contacts
 
| Array
 
| An array of objects that represent phone numbers and their labels. The first number in this list will display as the larger, main number.
 
|-
 
| hours
 
| Array
 
| Array of strings to show stacked in the business hours section. Strings here are freeform.
 
|-
 
|}
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When CallUs configuration is provided
 
| n/a
 
|-
 
| rejected
 
| When no configuration provided
 
| 'Invalid Configuration'
 
|-
 
|}
 
  
 
[[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/CallUs-combined#API_Commands.
Comments or questions about this documentation? Contact us for support!