Revision as of 00:12, March 28, 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('GWE.getIDs');

getIDs

Return Ids of Web Engagement items

Example

oMyPlugin.command('GWE.getIDs').done(function(e){

	// GWE got IDs successfully

}).fail(function(e){

	// GWE did not get IDs
});


Resolutions

Status When Returns
resolved When IDs are valid or if they are available. Array of IDs or nothing

invite

Show an invitation using the Toaster popup element.

Example

oMyPlugin.command('GWE.invite', {

	container: {},
	content: 'content of view'

}).done(function(e){

	// GWE showed invite successfully

}).fail(function(e){

	// GWE failed to show invite properly
});


Options

Option Type Description
container object Contaienr object
content string Content within the web engagement view


Resolutions

Status When Returns
resolved When web engagement information properly provided n/a
Comments or questions about this documentation? Contact us for support!