Skip to main content

Salesforce Live Chat

Yellow.ai’s integration with Salesforce lets you connect with the live chat agents of Salesforce to resolve your queries.

note

Agents must remain available (online) on Salesforce (when queue management and offline support are not configured).

Connect Salesforce with Yellow.ai

To connect your yellow.ai account with Salesforce, follow these steps.

  1. Login to cloud.yellow.ai and click the Integrations module on the top left corner of your screen.
drawing
  1. Search for Salesforce Live Chat or choose the category named Live chat from the left navigation bar and then click on Salesforce Live Chat.

  1. Fill in the required fields.
  • Organization Id - The unique identifier of the salesforce account that represents a particular organization. To fetch this, refer to the following steps:
  1. Login to your Salesforce account.
  2. Click on the app launcher and choose Service Console.
  3. Click on the setup button at the top right corner and select Setup.
  4. In the Quick Find section, search for Deployments in the Chat section.
  5. Click on the deployment that is already created (if not, create a deployment).
  6. In the deployment script, locate an ID starting with 00D, which is the Organization ID.
  • Deployment Id - The ID of the deployment from where the chat has been initiated. To fetch this, refer to the following steps:
  1. Login to your Salesforce account.
  2. Click on the app launcher and choose Service Console.
  3. Click on the setup button at the top right corner and select Setup.
  4. In the Quick Find section, search for Deployments in the Chat section.
  5. Click on the deployment that is already created (if not, create a deployment).
  6. In the deployment script, locate an ID not starting with 00D, which is the Deployment ID.
  • Button Id - The Id of the button(group) from where the chat has been initiated. To fetch this, refer to the following steps:
  1. Login to your Salesforce account.
  2. Click on the app launcher and choose Service Console.
  3. Click on the setup button at the top right corner and select Setup.
  4. In the Quick Find section, search for Chat Buttons and Invitations in the Chat section.
  5. Click on the button that is already created (if not, create a button).
  6. In the Chat Button Code, locate an ID starting with 573, which is the Button ID.
  • Base URL - The chat API endpoint of a particular salesforce organization. To fetch this, refer to the following steps:
  1. Login to your Salesforce account.
  2. Click on the app launcher and choose Service Console.
  3. Click on the setup button at the top right corner and select Setup.
  4. In the Quick Find section, search for Chat Settings in the Chat section.
  5. Find the Chat API Endpoint present and copy the URL value till .com. This is your Organization Base URL.
  • Agent Device: The browser’s userAgent value.
  • Language: Language preferred by the user to chat with the live agent.
  • Agent Screen Resolution: The screen resolution of the device used by the agent.
  • Agent Timeout: The value of this field determines the time till which the chat will remain active in case of inactivity at the agent’s side.
  • Enable queue updates: Enable this for users to receive updates on their position in the queue during chat interactions.
  • Enable sticky agent: Enable this to connect users directly to their preferred agent by specifying the agent's ID in the Raise Ticket node.
  • Disconnect chat from: Enable this to immediately close tickets for users waiting in the queue but not yet assigned to an agent.
  • Send queue updates event to: Enable this to inform users about their queue position with real-time updates sent as events to the bot, allowing developers to customize bot flows based on the queue status.
  • Customise chat headers: Enable this to personalize the bot headers with agent names and descriptions. The bot headers will be restored ot orginal settings once the ticket is closed.
  1. Once you're done, click Connect.
  2. If you have multiple accounts, follow the above mentioned steps to add each of them.
note
  1. Enter a unique name for each account to easily identify them within the yellow.ai platform. It is recommended to use a name that aligns with its purpose for better usability.
  2. You can add a maximum of 15 accounts.
  3. In a two-tier environment, such as bots with only Development/Live environments, you can add account names only in the development mode. Once added and flows have been built, in the Live mode, you can only choose the account names and not edit them.
  4. In a three-tier environment, such as bots with Staging/Sandbox/Production modes, in Staging and Sandbox modes, you can add and edit new accounts. However, in Production, only the account details added in Staging will be available. You can only map in the production environment.

Connect bot users to live agents on Salesforce

This integration lets you connect with live agents on the Salesforce platform from your yellow.ai account.

note
  • When multiple accounts are added, select the appropriate account for each node, allowing you to leverage the unique functionalities of each account for their intended purposes.
  • During the testing process, agents should be online for the specific button ID or group mapped in the configuration.
info

Use Ticket-closed in the Raise Ticket node to perform specific actions when a live chat closes, instead of using the ticket-close event.

  1. In the Studio flow builder, select the Raise Ticket node.
drawing
  1. Select Salesforce Live Chat from the Live chat agent drop-down list.
drawingdrawing

The following table contains the details of each field in the Raise ticket node.

Field nameSample valueData typeDescription
Message after ticket assignmentRequesting live agent connection.StringThe message that will be displayed to the end user after a ticket is successfully assigned to an agent
NameRajeshStringName of the user
Mobile9876543210StringMobile number of the user
Email[email protected]StringEmail address of the user
QueryI have a concern regarding my flight ticketStringThe subject/topic/reason why the ticket was created
Salesforce Live Chat Custom Fields
 [
{
"label": "Mobile",
"value": "9999444443",
"transcriptFields": [
"Mobile_Number__c"
],
"displayToAgent": true
},
{
"label": "Chat",
"value": "sessionURL",
"transcriptFields": [
"chat_transcript__c"
],
"displayToAgent": true
}
]
ArrayThe list of details provided by the user before initiating the chat with the live agent
Salesforce Live Chat Custom Entities
[
{
"entityName":"Contact",
"saveToTranscript":"contact",
"linkToEntityName":"Case",
"linkToEntityField":"ContactId",
"entityFieldsMaps":
[
{
"fieldName":"LastName",
"label":"LastName",
"doFind":true,
"isExactMatch":true,
"doCreate":true
},
{
"fieldName":"FirstName",
"label":"FirstName",
"doFind":true,
"isExactMatch":true,
"doCreate":true
},
{
"fieldName":"Email",
"label":"Email",
"doFind":true,
"isExactMatch":true,
"doCreate":true
}
]
}
]
ArrayThe records created/ searched depending on what EntityFieldsMaps has enabled.

Advanced options

drawingdrawing

The following table contains the details of each field in the Advanced options section.

Field nameSample valueData typeDescription
Message after agent assignmentYou are now connected to {liveAgent}.StringThis message is displayed to the end user when an agent is assigned, us the dynamic parameter{liveAgent} to display the name of the agent.
Language preferenceEnglishStringLanguage preferred by the end user to chat with the live agent.
Message to display queue positionYour queue position is {position}StringThis message is displayed to the user when the ticket is in queue, use the dynamic parameter {position} to display the position.
Message to display updated queue positionYour current queue position is {position}StringThis message is displayed to the user when the queue position changes, use the dynamic parameter {position} to display the position.
Message after agent transferYour chat has been transferred to {liveAgent}StringThis message is displayed to the end user when the chat gets transferred from one agent to another, use the dynamic parameter {liveAgent} to display the name of the agent.
Message to display estimated wait time before agent assignmentThe estimated wait time for the chat to get assigned is {waitTime} secondsStringThis message notifies the the user on the approximate time the user needs to wait before an agent is assigned, use the dynamic parameter {waitTime} to display the wait time.
Display agent nametrueBooleanEnable this flag will to display the chat agent's name if there's an assignment or transfer of the chat.
Warning message to display after end user inactivityIdle warningStringThis message is displayed if the user is inactive.
Timeout message to display after end user inactivityIdle timeoutStringThis message will be displayed to the user when the live chat ends because of their inactivity for a specific duration of time.
Message after failure in establishing connectionConnection failureStringThis message will be displayed to the user when there is a failure in connecting with a live agent.
Message after agent has disconnected from the chatAgent has disconnectedStringThis message will be displayed to the user when their agent disconnects the chat. (This message will be displayed only if there are other active agents with the capacity to take new chats, otherwise, the message configured in the field Message after failure in establishing connection will be displayed)
Message to display after chat ends due to agent inactivityAgent timeout occurredStringThis message will be displayed to the user when the Agent Timeout value has been surpassed.
Send chat transcriptTrue or FalseBooleanThe Send chat transcript field allows you to send the conversation history between the end user and the bot as the initial message to the agent. Since this is a boolean field, pass the value True to send the chat transcript to the agent and if you don’t want to send the chat transcript to the agent, pass the value False.

Note: In cases where the entire transcript exceeds the character limit of a single message packet in Salesforce, the content will be divided and sent as multiple message packets. For example, if the chat transcript contains 8000 characters and the message packet limit is 4000 characters, the transcript will be divided into two packets of 4000 characters each and sent as separate messages to the agent.
                                                                                                    |

Sample success response

{
"assignedTo": true,
"success": true,
"status": "ASSIGNED",
"ticketInfo": "{{apiresponse}}"
}
note

apiresponse represents the raw response from the Salesforce create ticket API

Sample failure response

{
"success": false,
"assignedTo": false,
"agentNotAvailable": true,
"message": "TicketId is not created and transferring the control back to the bot",
"ticketInfo": "{{apiresponse}}"
}
note

apiresponse represents the raw response from the Salesforce create ticket API

Steps to set up bot in Salesforce Live Chat

  1. Login to your Salesforce account and click Setup

  2. On the left side bar search, search for Visualforce Pages and click on it.

    drawing
  3. Click New to create a new VF page.

  4. Perform the following actions:

  • Enter the Label,name and check the Available for Lightning. Experience, Experience Builder sites, and the mobile app option.

  • Paste the embedded bot code into the markups section between the <apex:page> </apex:page> tags.

  • Click Save.

  1. Go back to the left side bar search and search for App Manager and click it.

  2. Scroll down to Service Console and click Edit.

  3. Click Utility items(Desktop only) and click Add Utility Item.

  4. Select VisualForce from the drop-down.

  5. Perform the following actions in the following page.

  • Add Label , Icon, Panel Width, Panel Height.

  • Under Component Properties deselect Show Label.

  • In Visualforce Page Name, add the name of the VF page created in step 4.

  • Click Save.

  1. Go to App launcher and navigate to Service Console. You should see the bot at the bot footer.

Reference

https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_API_requests.htm