function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bob Smith.ax1275Bob Smith.ax1275 

Live Agent for Salesforce - Agent Status API Call



I need to write a script to check chat availability.  Is there any documentation to the API that can assist with this?  For our previous system, it was simple to just check the image displayed on the website.  Unfortunately with Live Agent, I can not do the same.




Hi Bob,


There is no API to check Live Agent availability. However, this is what chat "buttons" do. Since you can have any custom HTML for the chat "online" vs. the chat "offline" state, you don't need an API to display dynamic content for when chat is available vs. unavailable.


I hope this helps.




Thanks for the info, but is there specific, detailed documentation on how to use the Automatic online and offline status for live chat buttons/links?  We want to show the button when there are available agents, but hide the button when all active agents are at capacity to prevent users from entering the site and waiting a long time for an agent.  What settings need to be updated to do this?


I'll take a crack at this, just to get my feet wet.  I'm feeling around in the dark too.




When you create a chat button, the default code that generates for you to copy and paste into your website includes this feature.  It calls up text, either a clickable "Start Chat" or a non-clickable "Chat is offline" that displays depending on whether your user is logged into the console and "online" (not "away"). The code can be customized from there to change the images or text to something flashier, I believe. If you start with the generic code that you see at the bottom of your saved  chat button detail, you should be right in the neighborhood of where you want to be.


HINT: monitor (via JavaScript) what the button-swapping code is showing and hiding. That will give you what you need.


So Bob - that will do basically exactly what you were doing before, but just test the display:none vs. display:block status of the offline or online button, depending on your needs.