ECE Web Service API


Note: Returns true even if no agents - if “Agent Available = Not Required” on the Chat entry Config
When set to “required” this goes true as long as one agent is available.
This correctly checks that the agent is skilled in the specific chat queue.

Caveat: To allowing Chat Queuing this must be set to “Not Required - otherwise you get closed message when no agents available”



<agentAvailability available="false"/>


<agentAvailability available="true"/>

Example HTML Source RAW

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<agentAvailability available="true" xmlns:ns5="" xmlns:ns2="" xmlns:ns4="jabber:client" xmlns:ns3="urn:ietf:params:xml:ns:xmpp-stanzas"/>

This API does not work as I would expect today. It checks against all agents and not (as is necessary) just the revelant agents skilled for that chat.


Example of when 0 Agents Available Response:



<div xmlns="">
	<details open="" class="expandable-body">
		<summary class="expandable-opening">&lt;<span class="start-tag">availableSlots</span>&gt;</summary>
		<div class="expandable-children">
			<div>&lt;<span class="start-tag">ns2:count</span>&gt;<span class="text">0</span>&lt;/<span class="end-tag">ns2:count</span>&gt;</div>
	<span class="expandable-closing">&lt;/<span class="end-tag">availableSlots</span>&gt;</span>

Example when 1 agent available that is allowed to handle 3 chats




Example with 1 chat queuing




<checkEligibility responseType="0"/>

Note - we get a '0' when no agents logged in - if entry point set to Agent Availability Not required.

  • 0: The queue associated with this entry point can handle new chats.
  • 1: No agent is available to work on new chats.
  • 2: Maximum queue depth has reached for the queue associated with the given entry point and no new chats will be processed.

chatAllowed - Display chat option based on queue depth, agent availability and entry point status

<chatAllowed allowed="true"/>

Note: Not sure how useful this is that different from Agent Availability. I do not see an ability to set Chat Queue length on ECE - but maybe could do in ICM?

Using Capacity API

header("Content-Type: text/plain");
$url = 'http://'.$ecehostname.'/system/egain/chat/entrypoint/capacity/'.$chatentry_id;
$ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPGET, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); //connection timeout
    curl_setopt($ch, CURLOPT_TIMEOUT, 3); //timeout in seconds for transaction
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
echo $output;
$xml_data = str_replace("ns2:","",$output);
echo $xml_data;
//echo $xml;
$agentcount=(int) $xml->count;
//echo "AgentCount: $agentcount";
if ($agentcount>0) echo "\n$agentcount Agents Available";
if ($agentcount==0) echo "\nNo Agents Available";


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<availableSlots xmlns:ns5="" xmlns:ns2="" xmlns:ns4="jabber:client" xmlns:ns3="urn:ietf:params:xml:ns:xmpp-stanzas">

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<availableSlots xmlns:ns5="" xmlns:ns2="" xmlns:ns4="jabber:client" xmlns:ns3="urn:ietf:params:xml:ns:xmpp-stanzas">

SimpleXMLElement Object
    [count] => 1

1 Agents Available
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies