Revision as of 18:36, June 6, 2016 by Bfriend (talk | contribs)
Jump to: navigation, search

Commands

startChat

Initiates a new chat session with the chat server via GMS

Options

Option Type Description
userData object arbitrary data to attach to the chat session (AKA attachedData). Properties defined here will be merged with default userData set in the configuration object
nickname string Override Chat Entry Form Data: 'nickname'
firstname string Override Chat Entry Form Data: 'firstname'
lastname string Override Chat Entry Form Data: 'lastname'
email string Override Chat Entry Form Data: 'email'
subject string Override Chat Entry Form Data: 'subject'


Resolutions

Status When Returns
resolved When server confirms session started (AJAX Response Object)
rejected When an chat session is already active {'type':'error', 'text':'There is already an active chat session'}
rejected When AJAX exception occurs (AJAX Response Object)
rejected When server exception occurs (AJAX Response Object)
rejected When userData is invalid {'type': 'error', 'text': 'malformed JSON provided in userData property'}



endChat

Ends the chat session with the chat server via GMS

Resolutions

Status When Returns
resolved When active session is ended successfully (AJAX Response Object)
rejected If no chat session is currently active {'type':'error', 'text':'There is no active chat session'}



sendMessage

Send a message from the client to the chat session

Resolutions

Status When Returns
resolved When message is successfully sent (AJAX Response Object)
rejected If no message text provided {'type':'error', 'text':'No message text provided'}
rejected If no chat session is currently active {'type':'error', 'text':'There is no active chat session'}
rejected When AJAX exception occurs (AJAX Response Object)



sendTyping

Send 'customer typing' notification to chat session. A visual indication will be shown to agent

Resolutions

Status When Returns
resolved When AJAX request is successful (AJAX Response Object)
rejected When AJAX exception occurs (AJAX Response Object)
rejected If no chat session is currently active {'type':'error', 'text':'There is no active chat session'}



configure

Configure the widget. See configuration page for WebChatService

Options

Option Type Description
apikey string Apigee Proxy secure token
endpoint string Manually select the endpoint to initiate the chat on
dataURL URL String URL of GMS server
userData object Arbitrary JSON attached data to include when initiating a chat
ajaxTimeout number Number of milliseconds to wait before AJAX timeout


Resolutions

Status When Returns
resolved When configuration options are provided and set n/a
rejected When no configuration options are provided {'type': 'error', 'text': 'Invalid configuration'}



getTranscript

Fetch an array of all messages in the chat session

Resolutions

Status When Returns
resolved Always (Array)



getAgents

Return a list of agents that have participated in the chat. Includes agent metadata

Resolutions

Status When Returns
resolved Always (Object List) {name: (String), connected: (Boolean), supervisor: (Boolean), connectedTime: (int time),disconnectedTime: (int time)}



getStats

Return stats on chat session including start time, end time, duration, and list of agents

Resolutions

Status When Returns
resolved Always {agents: (Object), startTime: (int time), endTime: (int time), duration: (int time)}



registerTypingPreviewInput

Select an HTML input to watch for key events. Used to trigger startTyping and stopTyping automatically.

Options

Option Type Description
input HTML Reference An HTML reference to a text or textarea input


Resolutions

Status When Returns
resolved When valif HTML input reference is provided n/a
rejected When invalid or missing HTML input reference {type: 'error', text: 'Invalid value provided for the 'input' property. An HTML element reference to a textarea or text input is required.'}



Comments or questions about this documentation? Contact us for support!