Integrazione di CommuniGate Pro Contact Center con Zoho CRM

Il modulo CG/PL implementa la ricerca nel sistema Zoho di un contatto per recuperarne il numero di telefono e registra le informazioni sulla chiamata nella scheda del contatto.
// ================================================== // // Contact Center integration with Zoho CRM // // Version 2.0.2d // // ================================================== // function ccZohoCRM() { var qParam = EmailUserPart(SIPURItoEmail(RemoteURI())) || ""; var authToken = ""; var module = "Contacts"; var selectColumns = module + "(First Name,Last Name,Email,Description)"; var scope = "crmapi"; var url = "https://crm.zoho.com/crm/private/json/" + module + "/searchRecords"; var params = NewDictionary(); params.method = "POST"; params.timeout = 2; params.body = NewDictionary(); params.body.authtoken = authToken; params.body.scope = scope; params.body.criteria = "(phone:" + qParam + ")"; params.body.selectColumns = selectColumns; var result = HTTPCall(url,params); if(IsDictionary(result) && result.responseCode < 400="" &&="" isdata(result.body))="" {="" var="" resultjson;="" if(isstring(result.charset))="" {="" resultjson="Convert(result.body,result.charset);" }="" else="" {="" resultjson="result.body;" }="" var="" data="JSONToObject(resultJSON);" if(isdictionary(data))="" {="" if(isdictionary(data.response))="" {="" if(isdictionary(data.response.result))="" {="" if(isdictionary(data.response.result.(module)))="" {="" var="" crm="NewArray();" if(data.response.result.(module).row)="" {="" var="" row="NewArray();" if(isdictionary(data.response.result.(module).row))="" {="" addelement(row,="" data.response.result.(module).row);="" }="" elif(isarray(data.response.result.(module).row))="" {="" row="data.response.result.(module).row;" }="" for(var="" i="0;" i="">< length(row);="" i="" +="1)" {="" if(isarray(row[i].fl))="" {="" var="" obj="NewDictionary();" var="" fn;="" var="" ln;="" for(var="" j="0;" j="">< length(row[i].fl);="" j="" +="1)" {="" if(isdictionary(row[i].fl[j]))="" {="" if(row[i].fl[j].val="=" "contactid")="" {="" obj.id="row[i].FL[j].content;" obj.url="https://crm.zoho.com/crm/EntityInfo.do?module=" +="" module="" +="" "&id=" + obj.id; } elif(row[i].FL[j].val == " email")="" {="" obj.email="row[i].FL[j].content;" }="" elif(row[i].fl[j].val="=" "description")="" {="" obj.desc="row[i].FL[j].content;" }="" elif(row[i].fl[j].val="=" "first="" name")="" {="" fn="row[i].FL[j].content;" }="" elif(row[i].fl[j].val="=" "last="" name")="" {="" ln="row[i].FL[j].content;" }="" }="" }="" obj.name="" ;="" if(fn)="" {="" obj.name="" +="fN;" }="" if(ln)="" {="" if(obj.name="" !="" )="" {="" obj.name="" +=" " +="" ln;="" }="" else="" {="" obj.name="lN;" }="" }="" addelement(crm,obj);="" }="" }="" return="" crm;="" }="" }="" }="" }="" }="" }="" return="" null;="" }="" procedure="" updatecontact(id,="" params)="" {="" var="" authtoken="" ;="" var="" module="Contacts" ;="" var="" url="https://crm.zoho.com/crm/private/xml/" +="" module="" +="" "/updaterecords";="" var="" scope="crmapi" ;="" var="" p="NewDictionary();" p.method="POST" ;="" p.timeout="2;" p.body="NewDictionary();" p.body.authtoken="authToken;" p.body.scope="scope;" p.body.id="id;" p.body.xmldata="<" +="" module="" +="" "=""><row no=\"1\"><FL val=\"Description\">" + ObjectToJSON(params) + "</FL></row></" + module + ">"; var result = HTTPCall(url,p); }
Per ulteriori informazioni scrivere a support@communigate.ru