Salesforce Console Developer Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Summer '18 (API version 43.0)
Spring '18 (API version 42.0)
Winter '18 (API version 41.0)
Summer '17 (API version 40.0)
Spring '17 (API version 39.0)
Winter '17 (API version 38.0)
Summer '16 (API version 37.0)
Spring '16 (API version 36.0)
Winter '16 (API version 35.0)
Summer '15 (API version 34.0)
Spring '15 (API version 33.0)
Winter '15 (API version 32.0)
Summer '14 (API version 31.0)
Spring '14 (API version 30.0)
When to Use the Salesforce Console Integration Toolkit
Sample Visualforce Page Using the Salesforce Console Integration Toolkit
acceptChat()
cancelFileTransferByAgent()
declineChat()
endChat()
getAgentInput()
getAgentState()
getChatLog()
getChatRequests()
getDetailsByChatKey()
getDetailsByPrimaryTabId()
getEngagedChats()
getMaxCapacity()
initFileTransfer()
onAgentSend()
onAgentStateChanged()
onChatCanceled()
onChatCriticalWaitState()
onChatDeclined()
onChatEnded()
onChatRequested()
onChatStarted()
onChatTransferredOut()
onCurrentCapacityChanged()
onCustomEvent()
onFileTransferCompleted()
onNewMessage()
onTypingUpdate()
sendCustomEvent()
sendMessage()
setAgentInput()
setAgentState()
Newer Version Available
Methods for Chat
Connect with customers or website visitors in real time through Web-based chat. For more information, see “Add Chat to the Salesforce Console” in the Salesforce Help.
These methods don’t work for chats routed with Omni-Channel. Chats with Omni-Channel routing use the Methods for Omni-Channel. If you’re using Lightning Experience, use the Methods for Omni-Channel in Lightning Experience.
Note
-
acceptChat()
Accepts a chat request. Available in API version 29.0 or later. This method isn't supported with Omni-Channel in API version 37.0 or later. -
cancelFileTransferByAgent()
Indicates that a file transfer request has been canceled by an agent. Available in API version 31.0 or later. -
declineChat()
Declines a chat request. Available in API version 29.0 or later. This method isn't supported with Omni-Channel in API version 37.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 Chat 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. -
initFileTransfer()
Initiates the process of transferring a file from a customer to an agent. Available in API version 31.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 Chat 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. -
onFileTransferCompleted()
Registers a function to call when a file is transferred from a customer to an agent. Available in API version 31.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 Chat status, such as Online, Away, or Offline. Available in API version 29.0 or later. -
Methods for Chat Visitors
There are a few methods available that you can use to customize the visitor experience for Chat in a custom Visualforce chat window. These methods apply to Salesforce Classic only.