Jump to: navigation, search

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.

Important
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 Widgets Extensions for more information about extending Genesys Widgets.


var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');

oMyPlugin.command('ClickToCallService.requestNumber', {

	userData: {
		firstname: 'Bob',
		lastname: 'Jones'
	},
	phonenumber: '415XXXXXXX'

});

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.

restore

Tries to return saved session data to the UI plugin to restore the widget to its previous state.

Example

oMyPlugin.command('ClickToCallService.restore');


Resolutions

Status When Returns
resolved When ClickToCallService attempts to restore data. Restored data or empty object.
rejected Never n/a

requestNumber

Requests a phone number, access code and expiration time through the GMS Callback Service API (Voice - User Originated).

Example

oMyPlugin.command('ClickToCallService.requestNumber', {

	userData: {
		firstname: 'Bob',
		lastname: 'Jones'
	},
	phonenumber: '415XXXXXXX'

});


Options

Option Type Description
phonenumber string ClickToCall Entry Form Data: 'phonenumber'.
userData object Arbitrary data that is attached with ClickToCall phone number request. Properties defined here are be merged with default userData set in the configuration object. If Genesys Web Engagement (GWE) is enabled, this userData also includes visitID, globalVisitID and pageID.


Resolutions

Status When Returns
resolved Always (AJAX response data)
rejected When AJAX exception occurs (AJAX Response Object)
This page was last edited on May 11, 2018, at 12:35.
Comments or questions about this documentation? Contact us for support!