Jump to: navigation, search
(Update with the copy of version: draft)
(Update with the copy of version: draft)
Line 26: Line 26:
 
=== Example ===
 
=== Example ===
 
<source lang='javascript'>
 
<source lang='javascript'>
 +
// If using Callback API v1
 +
 
oMyPlugin.command('CallbackService.schedule', {
 
oMyPlugin.command('CallbackService.schedule', {
  
userData: {},
+
userData: {}
 
firstname: 'Bob',
 
firstname: 'Bob',
 
lastname: 'Jones',
 
lastname: 'Jones',
Line 34: Line 36:
 
subject: 'product questions',
 
subject: 'product questions',
 
desiredTime: '2017-03-03T00:24:17.804Z',
 
desiredTime: '2017-03-03T00:24:17.804Z',
email: 'b.jones@mail.com',
 
 
phonenumber: '4151110000'
 
phonenumber: '4151110000'
  
}).done(function(e){
+
});
 +
 
 +
// If using Callback API v3
  
// CallbackService scheduled successfully
+
oMyPlugin.command('CallbackService.schedule', {
  
}).fail(function(e){
+
userData: {},
 +
serviceName: 'service' // service name from callback API v3 version,
 +
firstname: 'Bob',
 +
lastname: 'Jones',
 +
email: 'b.jones@mail.com',
 +
subject: 'product questions',
 +
desiredTime: '2017-03-03T00:24:17.804Z',
 +
phonenumber: '4151110000'
  
// CallbackService failed to schedule
 
 
});
 
});
 
</source>
 
</source>
Line 81: Line 90:
 
| userData
 
| userData
 
| object
 
| 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.
+
| Arbitrary data that is to be attached with callback schedule. Properties defined here will 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.
 +
|-
 +
| serviceName
 +
| string
 +
| Service Name of Callback API to be passed if the apiVersion is v3.
 
|-
 
|-
 
|}
 
|}
Line 93: Line 106:
 
|-
 
|-
 
| resolved
 
| resolved
| When server confirms callback is scheduled.
+
| When server confirms callback is scheduled
| (AJAX Response Object)
+
| 200 OK AJAX Response - Schedule Callback
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Callbacks/index.html#bookCallbackExternal Schedule Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When selected timeslot is not available.
+
| When selected timeslot is not available
| (AJAX Response Object)
+
| 400 Bad Request AJAX Error Response  
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Callbacks/index.html#bookCallbackExternal Schedule Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When AJAX exception occurs.
+
| When AJAX exception occurs
| (AJAX Response Object)
+
| 429 Too Many Requests AJAX Error Response
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Callbacks/index.html#bookCallbackExternal Schedule Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When server exception occurs.
+
| When server exception occurs
| (AJAX Response Object)
+
| 500 Internal Server Error Response
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Callbacks/index.html#bookCallbackExternal Schedule Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When no form data is found to schedule callback.
+
| When no form data is found to schedule callback
 
| 'No data found to schedule callback'
 
| 'No data found to schedule callback'
 
|-
 
|-
 
|}
 
|}
 +
 
== availability ==
 
== availability ==
 
Get the list of available callback timeslots via GMS callback service.
 
Get the list of available callback timeslots via GMS callback service.
Line 118: Line 140:
 
=== Example ===
 
=== Example ===
 
<source lang='javascript'>
 
<source lang='javascript'>
 +
// If using Callback API v1
 +
 
oMyPlugin.command('CallbackService.availability', {
 
oMyPlugin.command('CallbackService.availability', {
  
 +
startDate: '2017-04-03T00:24:17.804Z',
 +
numberOfDays: '5',
 +
maxTimeSlots: 20
 +
 +
}).done(function(e){
 +
 +
// CallbackService successfully showing availability
 +
 +
}).fail(function(e){
 +
 +
// CallbackService failed to show availability
 +
});
 +
 +
// If using Callback API v3
 +
 +
oMyPlugin.command('CallbackService.availability', {
 +
 +
serviceName: 'service' // service name from callback API v3 version,
 
startDate: '2017-04-03T00:24:17.804Z',
 
startDate: '2017-04-03T00:24:17.804Z',
 
numberOfDays: '5',
 
numberOfDays: '5',
Line 157: Line 199:
 
| number
 
| number
 
| The maximum number of time slots to be included in the response.
 
| The maximum number of time slots to be included in the response.
 +
|-
 +
| serviceName
 +
| string
 +
| Service Name of Callback API to be passed if the apiVersion is v3.
 
|-
 
|-
 
|}
 
|}
Line 168: Line 214:
 
|-
 
|-
 
| resolved
 
| resolved
| When server confirms the list of available callback timeslots.
+
| When server confirms the list of available callback timeslots
| (AJAX Response Object)
+
| 200 OK AJAX Response - Query Callback Availability
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Availability/index.html#queryAvailabilityV2 Availability Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When timeslots are available for selected period.
+
| When timeslots are not available for selected period
| (AJAX Response Object)
+
| 400 Bad Request AJAX Response
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Availability/index.html#queryAvailabilityV2 Availability Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When AJAX exception occurs.
+
| When AJAX exception occurs
| (AJAX Response Object)
+
| 400 Bad Request AJAX Response
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Availability/index.html#queryAvailabilityV2 Availability Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When server exception occurs.
+
| When server exception occurs
| (AJAX Response Object)
+
| 500 Internal Server Error Response
 +
 
 +
For Callback API v3, refer to 'Responses' in [https://developer.genhtcc.com/reference/callback/Availability/index.html#queryAvailabilityV2 Availability Callback V3]
 
|-
 
|-
 
| rejected
 
| rejected
| When no query data is found.
+
| When no query data is found
 
| 'No query parameters passed for callback availability service'
 
| 'No query parameters passed for callback availability service'
 
|-
 
|-

Revision as of 19:43, September 26, 2018

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('CallbackService.schedule', {

	userData: {},
	firstname: 'Bob',
	lastname: 'Jones',
	email: 'b.jones@mail.com',
	subject: 'product questions',
	desiredTime: '2017-04-04T00:24:17.804Z',
	phonenumber: '4151110000'
});

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.

schedule

Schedule a callback service with the GMS callback schedule API.

Example

// If using Callback API v1

oMyPlugin.command('CallbackService.schedule', {

	userData: {}
	firstname: 'Bob',
	lastname: 'Jones',
	email: 'b.jones@mail.com',
	subject: 'product questions',
	desiredTime: '2017-03-03T00:24:17.804Z',
	phonenumber: '4151110000'

});

// If using Callback API v3

oMyPlugin.command('CallbackService.schedule', {

	userData: {},
	serviceName: 'service' // service name from callback API v3 version,
	firstname: 'Bob',
	lastname: 'Jones',
	email: 'b.jones@mail.com',
	subject: 'product questions',
	desiredTime: '2017-03-03T00:24:17.804Z',
	phonenumber: '4151110000'

});


Options

Option Type Description
firstname string Receive a Call entry Form Data: 'firstname'.
lastname string Receive a Call entry Form Data: 'lastname'.
phonenumber string Receive a Call entry Form Data: 'phonenumber'.
subject string Receive a Call entry Form Data: 'notes'.
email string Receive a Call entry Form Data: 'email'.
desiredtime string The preferred desired time user would like to get the callback scheduled. Time should be in UTC format.
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. If Genesys Web Engagement (GWE) is enabled, this userData also includes visitID, globalVisitID and pageID.
serviceName string Service Name of Callback API to be passed if the apiVersion is v3.


Resolutions

Status When Returns
resolved When server confirms callback is scheduled 200 OK AJAX Response - Schedule Callback
For Callback API v3, refer to 'Responses' in Schedule Callback V3
rejected When selected timeslot is not available 400 Bad Request AJAX Error Response
For Callback API v3, refer to 'Responses' in Schedule Callback V3
rejected When AJAX exception occurs 429 Too Many Requests AJAX Error Response
For Callback API v3, refer to 'Responses' in Schedule Callback V3
rejected When server exception occurs 500 Internal Server Error Response
For Callback API v3, refer to 'Responses' in Schedule Callback V3
rejected When no form data is found to schedule callback 'No data found to schedule callback'

availability

Get the list of available callback timeslots via GMS callback service.

Example

// If using Callback API v1

oMyPlugin.command('CallbackService.availability', {

	startDate: '2017-04-03T00:24:17.804Z',
	numberOfDays: '5',
	maxTimeSlots: 20

}).done(function(e){

	// CallbackService successfully showing availability

}).fail(function(e){

	// CallbackService failed to show availability
});

// If using Callback API v3

oMyPlugin.command('CallbackService.availability', {

	serviceName: 'service' // service name from callback API v3 version,
	startDate: '2017-04-03T00:24:17.804Z',
	numberOfDays: '5',
	maxTimeSlots: 20

}).done(function(e){

	// CallbackService successfully showing availability

}).fail(function(e){

	// CallbackService failed to show availability
});


Options

Option Type Description
startDate string The start date is specified in ISO 8601 format, using UTC as the timezone (yyyy-MM-ddTHH:mm:ss.SSSZ).
endDate string The end date is specified in ISO 8601 format, using UTC as timezone (yyyy-MM-ddTHH:mm:ss.SSSZ). If neither endDate nor numberOfDays is specified, the end date is assumed to be the same as the start date.
numberOfDays string Used as an alternative to the end date. If neither endDate nor numberOfDays is specified, the end date is assumed to be the same as the start date.
maxTimeSlots number The maximum number of time slots to be included in the response.
serviceName string Service Name of Callback API to be passed if the apiVersion is v3.


Resolutions

Status When Returns
resolved When server confirms the list of available callback timeslots 200 OK AJAX Response - Query Callback Availability
For Callback API v3, refer to 'Responses' in Availability Callback V3
rejected When timeslots are not available for selected period 400 Bad Request AJAX Response
For Callback API v3, refer to 'Responses' in Availability Callback V3
rejected When AJAX exception occurs 400 Bad Request AJAX Response
For Callback API v3, refer to 'Responses' in Availability Callback V3
rejected When server exception occurs 500 Internal Server Error Response
For Callback API v3, refer to 'Responses' in Availability Callback V3
rejected When no query data is found 'No query parameters passed for callback availability service'
Comments or questions about this documentation? Contact us for support!