Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vendors:cisco:uc:ece:webapi [2019/02/12 10:09]
gerardorourke [capacity - Agent Capacity Check]
vendors:cisco:uc:ece:webapi [2019/02/18 08:46] (current)
gerardorourke [Output]
Line 118: Line 118:
 Note: Not sure how useful this is that different from Agent Availability. 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? I do not see an ability to set Chat Queue length on ECE - but maybe could do in ICM?
 +
 +===== Sample PHP Code =====
 +==== Using Capacity API====
 +<code php>
 +<?php
 +header("​Content-Type:​ text/​plain"​);​
 +
 +$url = '​http://​ucce-ece-db-12.lab2.purplepi.ie/​system/​egain/​chat/​entrypoint/​capacity/​1001';​
 +$file = file_get_contents($url);​
 +
 +echo $file;
 +
 +$xml_data = str_replace("​ns2:","",​$file);​
 +
 +echo $xml_data;
 +
 +$xml=simplexml_load_string($xml_data);​
 +
 +//echo $xml;
 +print_r($xml);​
 +
 +$agentcount=(int) $xml->​count;​
 +//echo "​AgentCount:​ $agentcount";​
 +
 +if ($agentcount>​0) echo "​\n$agentcount Agents Available";​
 +if ($agentcount==0) echo "\nNo Agents Available";​
 +?>
 +</​code>​
 +
 +==== Output ====
 +<​code>​
 +<?xml version="​1.0"​ encoding="​UTF-8"​ standalone="​yes"?>​
 +<​availableSlots xmlns:​ns5="​http://​jabber.org/​protocol/​httpbind"​ xmlns:​ns2="​http://​bindings.egain.com/​chat"​ xmlns:​ns4="​jabber:​client"​ xmlns:​ns3="​urn:​ietf:​params:​xml:​ns:​xmpp-stanzas">​
 +    <​ns2:​count>​1</​ns2:​count>​
 +</​availableSlots>​
 +
 +<?xml version="​1.0"​ encoding="​UTF-8"​ standalone="​yes"?>​
 +<​availableSlots xmlns:​ns5="​http://​jabber.org/​protocol/​httpbind"​ xmlns:​ns2="​http://​bindings.egain.com/​chat"​ xmlns:​ns4="​jabber:​client"​ xmlns:​ns3="​urn:​ietf:​params:​xml:​ns:​xmpp-stanzas">​
 +    <​count>​1</​count>​
 +</​availableSlots>​
 +
 +SimpleXMLElement Object
 +(
 +    [count] => 1
 +)
 +
 +1 Agents Available
 +</​code>​