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.

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');


Opens the Callback UI.


oMyPlugin.command('Callback.open', {
	form: {
		autoSubmit: false,
		firstname: 'John',
		lastname: 'Smith',
		email: 'John@mail.com',
		subject: 'Customer Satisfaction',
		desiredTime: 'now',
		phonenumber: '8881110000'
	// Callback opened successfully
	// Callback failed to open


Option Type Description
form object Object containing form data to prefill in the callback form and optionally auto-submit the form.
form.autoSubmit boolean Automatically submit the callback form.
form.firstname string Value for the first name entry field.
form.lastname string Value for the last name entry field.
form.email string Value for the email entry field.
form.subject string Value for the notes entry field.
form.desiredTime string This Value is shared by the Date & Time section in the callback form. A string value 'now' pre-selects 'As soon As Possible' section and sets current local time as the desired time. When a string Date Time value/date object is passed, the desired time is set to this value in the Custom Date & Time input field. During form submission to the server desired time time is converted into UTC string format.
form.phonenumber string Value for the phone entry field. Should be a valid telephone number, when used with a prefix '+' auto selects the country flag near the phone input field.
form.userData object Arbitrary data that is to be attached with callback schedule. Properties defined here will be merged with default userData set in the configuration object.


Status When Returns
resolved When callback form is successfully opened n/a
rejected When callback form is already open 'already opened'


Closes the Callback UI.


	// Callback closed successfully
	// Callback failed to close


Status When Returns
resolved When Callback form is successfully closed n/a
rejected When Callback form is already closed 'already closed'


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.


oMyPlugin.command('Callback.configure', {
	formValidation: true,
	countryCodes: true
	// Callback configured successfully
	// Callback wasn't configured properly


Option Type Description
formValidation boolean Enable/disable browser form validations.
countryCodes boolean Enable/disable country flags display for phone numbers.


Status When Returns
resolved When configuration options are provided and set n/a
rejected When no configuration options are provided 'No configuration provided'
This page was last modified on December 11, 2017, at 09:59.


Comment on this article:

blog comments powered by Disqus