Revision as of 22:35, March 1, 2017 by Byee (talk | contribs) (API Commands)
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('CallUs.open');

open

Opens the CallUs UI.

Example

oMyPlugin.command('CallUs.open').done(function(e){

	// CallUs opened successfully

}).fail(function(e){

	// CallUs failed to open
});


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.

Example

oMyPlugin.command('CallUs.close').done(function(e){

	// CallUs opened successfully

}).fail(function(e){

	// CallUs failed to open
});


Resolutions

Status When Returns
resolved When CallUs successfully closed n/a
rejected When CallUs is already closed 'Already closed'

configure

Modify configuration options for CallUs. See configuration page for CallUs

Example

oMyPlugin.command('CallUs.conifugre', {

	contacts: [
		{
			displayName: 'Payments',
			i18n: 'Number001',
			number: '1 888 436 3797'
		}
	],
	hours: ['"8am - 8pm Mon - Fri"']

}).done(function(e){

	// CallUs opened successfully

}).fail(function(e){

	// CallUs failed to open
});


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.


Resolutions

Status When Returns
resolved When CallUs configuration is provided n/a
rejected When no configuration provided 'Invalid Configuration'
Comments or questions about this documentation? Contact us for support!