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/18 08:46] gerardorourkevendors:cisco:uc:ece:webapi [2019/03/12 08:58] (current) gerardorourke
Line 63: Line 63:
 </code> </code>
  
-Example when 1 agent avilable that is allowed to handle 3 chats+Example when 1 agent available that is allowed to handle 3 chats
  
 Response: Response:
Line 125: Line 125:
 header("Content-Type: text/plain"); header("Content-Type: text/plain");
  
-$url = 'http://ucce-ece-db-12.lab2.purplepi.ie/system/egain/chat/entrypoint/capacity/1001'+$chatentry_id='1001'; 
-$file = file_get_contents($url);+$ecehostname='ucce-ece-db-12.lab2.purplepi.ie';
  
-echo $file;+$url = 'http://'.$ecehostname.'/system/egain/chat/entrypoint/capacity/'.$chatentry_id;
  
-$xml_data = str_replace("ns2:","",$file);+$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); 
 +    curl_close($ch); 
 + 
 +echo $output; 
 + 
 +$xml_data = str_replace("ns2:","",$output);
  
 echo $xml_data; echo $xml_data;
Line 153: Line 166:
     <ns2:count>1</ns2:count>     <ns2:count>1</ns2:count>
 </availableSlots> </availableSlots>
 +
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?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"> <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>     <count>1</count>
 </availableSlots> </availableSlots>
 +
 SimpleXMLElement Object SimpleXMLElement Object
 ( (
  • vendors/cisco/uc/ece/webapi.1550479573.txt.gz
  • Last modified: 2019/02/18 08:46
  • by gerardorourke