Revision as of 23:50, March 9, 2016 by Bfriend (talk | contribs) (Widget Bus Command Reference)
Jump to: navigation, search

Widget Bus Command Reference

All Widget Bus commands are prefixed with cx.plugin.WebChat. For example: cx.plugin.WebChat.open

open

Summary: Opens the Chat Widget. Optionally, you can pass-in values to prefill the chat entry form and autosubmit it.
Returns: none
Options:

{
		form: {
	
			autoSubmit: true/false, 	// prefill and submit automatically and start a chat
			firstname: "",
			lastname: "",
			email: "",
			subject: ""
		}
}

close

Summary: Closes the Chat Widget.
Returns: none
Options: none

configure

Summary: Modifies the Chat Widget configuration. Changes take effect when Chat Widget is closed and then reopened.
Returns: none
Options:

{
	dataURL: "",
	userData: {},
	proactive: {
		
		enabled: true/false,
		idleTimer: 5,
		cancelTimer: 30
	}
}

minimize

Summary: Toggles the Chat Widget into a minimized state. If already minimized, Chat Widget is unminimized.
Returns: none
Options:

{
	minimized: true/false,		// Boolean: force minimized state rather than alternating toggle
}

endChat

Summary: Triggers the end-chat-session sequence of events.
Returns: none
Options: none

invite

Summary: Launches the built-in Chat invitation toast popup UI.
Returns: none
Options: none

reInvite

Summary: Launches a built-in Chat invitation toast popup specific to the scenario when a chat restore fails. It offers to start a new chat since the last one ended prematurely.
Returns: none
Options: none

showChatButton

Summary: Shows a chat button along the right side of the screen. Launches chat widget
Returns: none
Options: none

hideChatButton

Summary: Removes the chat button from the right side of the screen.
Returns: none
Options: none

injectMessage

Summary: Injects a custom message into the Chat transcript. This command is useful for showing offers or special notices.
Returns: none
Options:

{
	type: "",		// "text" or "html". Default: "text"
	name: "",		// Display name
	text: ""		// Message content
}

addPrefilter

Summary: Regular Expressions or string matching that prevents a message from being seen if it matches.
Returns: none
Options:

{
	filters: []	// regular expressions or strings to match
}

sendFilteredMessage

Summary: Send a message to an agent that does not appear in the customer's transcript. This command is useful for sending special codes and information.
Returns: injected message object
Options:

{
	text: "",		// Message content
	regex: ""		// regex to filter message. If omitted, will match "text" value exactly.
}
Comments or questions about this documentation? Contact us for support!