Newer Version Available

This content describes an older version of this product. View Latest

Methods for Live Agent

Live Agent lets you connect with customers or website visitors in real time through a Web-based, text-only live chat. See “Adding Live Agent to the Salesforce Console” in the Salesforce Help for more information. You can use the following methods to customize Live Agent in the Salesforce Console for Service:
Method Description
acceptChat()

Accepts a chat request. Available in API version 29.0 or later.

declineChat()

Declines a chat request. Available in API version 29.0 or later.

endChat()

Ends a chat in which an agent is currently engaged. Available in API version 29.0 or later.

getAgentInput()

Returns the string of text which is currently in the agent’s text input area in the chat log of a chat with a specific chat key. Available in API version 29.0 or later.

getAgentState()

Returns the agent's current Live Agent status, such as Online, Away, or Offline. Available in API version 29.0 or later.

getChatLog()

Returns the chat log of a chat associated with a specific chat key. Available in API version 29.0 or later.

getChatRequests()

Returns the chat keys of the chat requests that have been assigned to an agent. Available in API version 29.0 or later.

getDetailsByChatKey()

Returns the details of the chat associated with a specific chat key. Available in API version 29.0 or later.

getDetailsByPrimaryTabId()

Returns the details of the chat associated with a specific primary tab ID. Available in API version 29.0 or later.

getEngagedChats()

Returns the chat keys of the chats in which the agent is currently engaged. Available in API version 29.0 or later.

getMaxCapacity()

Returns the maximum chat capacity for the current agent, as specified in the agent's assigned agent configuration. Available in API version 29.0 or later.

onAgentSend()

Registers a function to call when an agent sends a chat message through the Salesforce console. This method intercepts the message and occurs before it is sent to the chat visitor. Available in API version 29.0 or later.

onAgentStateChanged()

Registers a function to call when agents change their Live Agent status, such as from Online to Away. Available in API version 29.0 or later.

onChatCanceled()

Registers a function to call when a chat visitor cancels a chat request. Available in API version 29.0 or later.

onChatCriticalWaitState()

Registers a function to call when a chat becomes critical to answer or a waiting chat is answered. Available in API version 29.0 or later.

onChatDeclined()

Registers a function to call when an agent declines a chat request. Available in API version 29.0 or later.

onChatEnded()

Registers a function to call when an engaged chat ends. Available in API version 29.0 or later.

onChatRequested()

Registers a function to call when an agent receives a chat request. Available in API version 29.0 or later.

onChatStarted()

Registers a function to call when an agent starts a new chat with a customer. Available in API version 29.0 or later.

onChatTransferredOut()

Registers a function to call when an engaged chat is transferred out to another agent. Available in API version 29.0 or later.

onCurrentCapacityChanged()

Registers a function to call when an agent's capacity for accepting chats changes—for example, if an agent accepts a new chat, ends a currently engaged chat, or otherwise changes the number of chats to which they are assigned, or if a chat request is pushed to their chat queue. Available in API version 29.0 or later.

onCustomEvent()

Registers a function to call when a custom event takes place during a chat. Available in API version 29.0 or later.

onNewMessage()

Registers a function to call when a new message is sent from a customer, agent, or supervisor. Available in API version 29.0 or later.

onTypingUpdate()

Registers a function to call when the customer’s text in the chat window changes. If Sneak Peek is enabled, this function is called whenever the customer edits the text in the chat window. If Sneak Peek is not enabled, this function is called whenever a customer starts or stops typing in the chat window. Available in API version 29.0 or later.

sendCustomEvent()

Sends a custom event to the client-side chat window for a chat with a specific chat key. Available in API version 29.0 or later.

sendMessage()

Sends a new chat message from the agent to a chat with a specific chat key. Available in API version 29.0 or later.

setAgentInput()

Sets the string of text in the agent’s text input area in the chat log of a chat with a specific chat key.Available in API version 29.0 or later.

setAgentState()

Sets an agent's Live Agent status, such as Online, Away, or Offline. Available in API version 29.0 or later.