IMPORTANT:
The legacy chat product is in maintenance-only mode, and we won't continue to build new features. You can continue to use it, but we no longer recommend that you implement new chat channels. Instead, you can modernize your customer communication with Messaging for In-App and Web. Messaging offers many of the Chat features that you love plus asynchronous conversations that can be picked back up at any time.
The Live Agent REST API allows you to programmatically create Live Agent sessions, send messages to available agents, create new records based on chat information, etc.,all through HTTP messages. A use case would be if you want to use the capabilities of Live Agent via a third party tool, perhaps an internal chat client in your organization.
This article will walk you through the basics steps on how to use the API to initiate a chat session.
{
"clientPollTimeout": 40,
"key": "49d50d5a-790f-40ec-98ca-8b813e6f0347!c007a252-0f76-473f-b411-588930e09be0",
"affinityToken": "2c931fa0",
"id": "49d50d5a-790f-40ec-98ca-8b813e6f0347"
}
{
"organizationId": "{!orgId}",
"deploymentId": "{!deploymentId}",
"buttonId": "{!chatButtonId}",
"sessionId": "id-from-response",
"userAgent": "Lynx/2.8.8",
"language": "en-US",
"screenResolution": "1900x1080",
"visitorName": "Frank Underwood",
"prechatDetails": [], "prechatEntities": [],
"receiveQueueUpdates": true,
"isPost": true
}
{"messages":[{"type":"ChatRequestSuccess", "message":{"geoLocation":
{"countryCode":"US","longitude":-122.39419555664062,"countryName":"United States",
"organization":"Salesforce.com",{"type":"ChatMessage", "message":{"text":"hello json",
"name":"pablo g"}},
{"type":"AgentNotTyping", "message":{}}], "sequence":4}
{"text" : "Hi, I need help with my TV settings."}
000386079

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.