Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


FunctionDescriptionExample

UC_exec

(sqlquery,dsn,callback)

Executes SQL query on the database (INSERT, UPDATE, DELETE), can or cannot have a callback.

sqlquery: INSERT UPDATE or DELETE.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.

value: If this value is true, the callback will give you the result from the database, otherwise it will give you OK or ERROR


Code Block
languagejs
themeEmacs
titleUC_exec
collapsetrue
UC_exec("INSERT INTO ccrepo.DC_Telefono VALUES ('" + nombreAgente+ "','" + $("#telefono").val() + "','" + fecha + "') ON DUPLICATE KEY UPDATE proximo_contacto = '" + fecha + "'","",respsaveproxcontacto, true);


UC_exec_async

Structure: (sqlquery, dsn)

Executes SQL query on the database (INSERT, UPDATE, DELETE)

sqlquery: INSERT UPDATE or DELETE.

dsn: Name of the data source, empty uses CCREPO Database.

value: If this value is true, the callback will give you the result from the database, otherwise it will give you OK or ERROR


Code Block
languagejs
themeEmacs
titleUC_exec
collapsetrue
let response = await UC_exec_async("INSERT INTO ccrepo.DC_Telefono VALUES ('" + nombreAgente+ "','" + $("#telefono").val() + "','" + fecha + "') ON DUPLICATE KEY UPDATE proximo_contacto = '" + fecha + "'","",respsaveproxcontacto, true);
return response;




UC_Save

(object,table,dsn,callback)

Saves an object of a table in the database.

object: Javascript object to save (identical to destination table).

table: Name of the destination table.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.




Code Block
languagejs
themeEmacs
titleUC_Save
collapsetrue
UC_Save(ArrayOfVentas[i], 'DC_Venta', '', callbackGuardarVenta);


UC_Save_async

Structure: (object, table, dsn)

Saves an object of a table in the database.

object: Javascript object to save (identical to destination table).

table: Name of the destination table.

dsn: Name of the data source, empty uses CCREPO Database.




Code Block
languagejs
themeEmacs
titleUC_Save
collapsetrue
let response = await UC_Save(ArrayOfVentas[i], 'DC_Venta', '');
return response;


UC_fullSelect

(solochosen,idSelect,objetoSelect, chosen,atributo,parse)

Fills a comboBox or listBox with data from a query.

solochosen: If this parameter is 0 initialize the chosen with the objects passed in objetoSelect. If 1 use the html values and initlize with .chosen().

idSelect: Id of the html (out comboBox).

objetoSelect: List of values or objects:

Example values: ["ACOMP-BLESS->","campanaParaTestBeto<-"]

Example objects: [{"departamento":"ARTIGAS"},{"departamento":"CANELONES"}]

chosen: If 1 the function .chosen() is applied initialize the comboBox,if 0 loads the html of the select with options of objetoSelect but doesnt apply .chosen(), does not initialize.

attribute: If specified an attibute means that the objetoSelect has the form of a list of objects so the values displayed on our control is the content of the name of that attribute. Example 'departamento' to fill with ARTIGAS, CANELONES.

parse: If 1 JSON.parse is applied to objetoSelect asumes is passed as a String, if 0 assumes that in an array of values or array of objects.


solochosenchosenresult
00ListBox using objetoSelect values
10ListBox using html values
11ComboBox using html values
01ComboBox using objetoSelect values




Code Block
languagejs
themeEmacs
titleUC_fullSelect
collapsetrue
UC_fullSelect(0,"campanasCodigos",campañas,1,null,1);


solochosenchosenresult
00ListBox using objetoSelect values
10ListBox using html values
11ComboBox using html values
01ComboBox using objetoSelect values
UC_fullSelect(0,"campanasCodigos",campañas,1,null,1);


UC_fullTable

(idTabla,datosParaLlenar, stringDatos,onSelected,scroll,dataFormat,bColum,bOrder,bfilter,pagination,multipleSelect,onDeSelected)

Puts all the data into the table.

idTabla: Id of the tag <table> in our html.

datosParaLlenar: List in String format used to load the table.

Example: [{"id":1,"documento":"","nombres":"Casanova Barreiro Rossana Haydee","departamento":""...

 stringDatos: Names of the filed that we want to show int our column table. Separated by coma (,).

onSelected: Function executed when you select a row of the table,has a parameter that returns the objet of the selected row.

Example: function metodoOnSelectedSample(resp){

//Resp has the object in string format as we pass in the datosParaLlenar

}

scroll: Height in pixels of the table. Ej: '100px'.

dataFormat: Format of the Dates so the table can order the datatype correct, example : 'MM/DD/YYYY'.

bColum, bOrder: This parameters are to order via a particular column asc or desc, passing as an integer the number of the column to order and if desc or asc.

Example:

Second column descendent: 1,"desc"

pagination: Boolean. True to make the pagination of a table. 

multipleSelect: null or 1 as integer for multiple row select.

onDeSelected: null or function(a) to return the object of the selected row.



Code Block
languagejs
themeEmacs
titleUC_fullTable
collapsetrue
UC_fullTable("tablaCodigo",JSON.stringify(codigosHistorico),'Codigo,Detalle,Callerid,Documento,Resultado',selectCodigo,"300px","DD/MM/YYYY",0,"asc");


UC_addPagination

(idTabla)

Add pagination to a table.

This method adds two buttons, Previous and Next for pagination porpoises.

The user has to define the methods for the behavior of the buttons: the ids are idTabla_anterior, idTabla_siguiente.

Via javascript and jQuery:

$('#idTabla_anterior').click(function(){...});

and

$('#idTabla_siguiente').click(function(){...});

idTabla: Id of the html table.


Code Block
languagejs
themeMidnight
titleUC_addPagination
collapsetrue
UC_addPagination('tablaBusquedaBaseVentas');


UC_update

(json, tablename, column, dsn, callback)

Update Data.

obj: Object with the new data.

tablename: Name of the table to update.

column: Name of the column to update from usually the table PK.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.



Code Block
languagejs
themeEmacs
titleUC_update
collapsetrue
UC_update(objetoRefActual, "DC_Referido", "idref", "", respUpdateReferido);


UC_update_async

Structure: (json, tablename, column, dsn)

Update Data.

obj: Object with the new data.

tablename: Name of the table to update.

column: Name of the column to update from usually the table PK.

dsn: Name of the data source, empty uses CCREPO Database.



Code Block
languagejs
themeEmacs
titleUC_update
collapsetrue
let responde = UC_update(objetoRefActual, "DC_Referido", "idref", "");
return response;


UC_delete

(tablename, column, value, valuetype, dsn, callback)

Deletes an object.

tablename: Name of the table to delete from.

column: Name of the column that we are going to make the delete usually the PK.

value: Value of the selected column to delete.

valuetype: Datatype of the value of the column to delete: int, string.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.



Code Block
languagejs
themeMidnight
titleUC_delete
collapsetrue
UC_delete('DC_Producto', 'id', productoseleccionado.id, 'int', '', callbackEliminar);


UC_delete_async

Structure: (tablename, column, value, valuetype, dsn)

Deletes an object.

tablename: Name of the table to delete from.

column: Name of the column that we are going to make the delete usually the PK.

value: Value of the selected column to delete.

valuetype: Datatype of the value of the column to delete: int, string.

dsn: Name of the data source, empty uses CCREPO Database.



Code Block
languagejs
themeMidnight
titleUC_delete
collapsetrue
let response = await UC_delete('DC_Producto', 'id', productoseleccionado.id, 'int', '');
return response;


UC_get

(sqlquery,dsn,callback)

Get data from a SQL SELECT query.

sqlquery: SELECT sql.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.



Code Block
languagejs
themeEmacs
titleUC_get
collapsetrue
UC_get("SELECT * FROM DC_Param order by id asc","",callbackInitDocumento);


UC_get_async

Structure: (sqlquery,dsn)

Get data from a SQL SELECT query.

sqlquery: SELECT sql.

dsn: Name of the data source, empty uses CCREPO Database.


Code Block
languagejs
themeMidnight
titleUC_addPagination
collapsetrue
let response = await UC_get("SELECT * FROM DC_Param order by id asc","");
return response;


UC_makeCall

(campaign,source, destination,callback)

Makes a call.

campaign: Outbound campaign to compute this call to.

source: Oublound DID for this call (number seen by the client).

destination: Number to call.

callback: Null or name of the function to execute on completion.


Code Block
languagejs
themeEmacs
titleUC_makeCall
collapsetrue
UC_makeCall(campaign,source, destination,callback);


UC_makeCall_async

Structure: (campaign,source, destination)

Makes a call.

campaign: Outbound campaign to compute this call to.

source: Oublound DID for this call (number seen by the client).

destination: Number to call.


Code Block
languagejs
themeEmacs
titleUC_makeCall
collapsetrue
let response = await UC_makeCall(campaign,source, destination);
return response;


UC_hangUp

(callback)

Hangup the actual call.

callback: Null or name of the function to execute on completion.


Code Block
languagejs
themeEmacs
titleUC_hangUp
collapsetrue
UC_hangUp();


UC_hangUp_async

Structure: ()

Hangup the actual call.


UC_hangUpMyCall

Hang up the call, if the caller id passed by argument is the same that the actual call, otherwise nothing will happen

callerid

callback


Code Block
languagejs
themeEmacs
titleUC_hangUp
collapsetrue
let response = await UC_hangUp();
return response;


UC_hangUpMyCall_async

- callerid


UC_pause

(boolean)

Pause or UnPause an agent.

It will not UnPause the agent if it is on a break.

boolean: true or false.

function: callback function


Code Block
languagejs
themeMidnight
titleUC_Pause
collapsetrue
UC_Pause(true, function(resp){});


UC_sendSms

(phone,message)

Sends SMS.

phone: Destination.

message: Text.


Code Block
languagejs
themeMidnight
titleUC_sendSms
collapsetrue
 UC_sendSms(43525915,"Hello world!");


UC_sendMail

(fromname, to, subject, body)

Sends an Email with the system account.

fromname: Name of the From.

to: Destination email.

subject: Subject.

body: Text can be plain or html.


Code Block
languagejs
themeMidnight
titleUC_sendMail
collapsetrue
UC_sendMail(clienteseleccionado.campana, $('#txtEmailGestion').val(), $('#txtDatoGestion').val(), $('#txtComentarios').val());


UC_sendMailCampaignv2

Sends an email using an account of the specified campaign

Code Block
languagejs
{
    "campaign": "Email",
    "to": "adress@ucontactcloud.com",
	"cc":"example@example.com",
    "cco":"example@example.com,example2@example2.com",
    "subject": "Subject",
    "body": "This is an email body can be HTML",
	"attachments": ["020212/738hbjk-h73894algo.jgp", "020212/738hbjk-h73894algo.jgp"],
    "reports":["<generated_report_guid>.pdf"],
    "schedule": {
        "title": "Date title",
        "organizer": "Myself",
        "from": "2018-08-24 00:00:00",
        "to": "2018-08-24 01:00:00"
    }
	"template": "templateName",
	"variables": {
		"var1":"value",
		"var2":"value2"
	}
}


CC, CCO, Template and variables fields are optionally.

The variables in the template will be replaced before sending the email. Template only will be sent if the body is not specified.

Attachments are optional. It will be a list of strings. Each string returned by the function addAttachment.

Reports field is optional. It will be an array of guid reports with its extension.


Code Block
languagejs
await UC_sendMailCampaignv2_async({
    campaign: "Email",
    to: "santiviglione@gmail.com",
    subject: "Subject",
    body: "Hola",
    attachments: [
        "20190513/92c59937-194a-4ef0-a183-9f55d551eb94.Captura%20de%20pantalla%202019-02-23%20a%20la%28s%29%2018.25.28.png",
        "20190513/24817ad7-efc5-4277-8995-d64ee6e988a5.foton%20de%27cereat.jpg"
    ]
})


UC_addAttachment(file, id)

Upload any type of file to the server

file: File object javascript

id (optional): used to recognize the file in the response

Response: ["20190513/a6d9f3c6-9574-44ca-8b6f-ec02e2c977d1.filename.txt", "1234"]

the first string is the file's path on the server.

the second string is the id 

await UC_addAttachment(new File(["test1234filecontent"], "filename.txt", {type: "text/plain", lastModified: new Date()}))
UC_sendHeyNowMessage_async

Send message with hey now api. This method uses the provider previously configured

Code Block
languagejs
{
	"clientId": "598112321323",
	"message": "Hola",
	"providerName": "HeyNowProviderName"
}



Code Block
languagejs
let obj = {
	"clientId": "598112321323",
	"message": "Hola",
	"providerName": "HeyNowProviderName"
}

await UC_sendHeyNowMessage_async(obj)


UC_getAgents

(callback)

Get agents in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getAgents
collapsetrue
UC_getAgents(setAgents);


UC_getAgents_async

Structue: ()

Get agents in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getAgents
collapsetrue
let response = await UC_getAgents();
return response;


UC_getSystemCampaigns

(callback)

Get campaings in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getSystemCampaigns
collapsetrue
UC_getSystemCampaigns(setComboCampaigns);


UC_getSystemCampaigns_async

Structure: ()

Get campaings in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getSystemCampaigns
collapsetrue
let response = await UC_getSystemCampaigns();
return response;


UC_getMyAgentCampaigns

(callback)

Get agents of my campaings in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getMyAgentCampaigns
collapsetrue
UC_getMyAgentCampaigns(respGetAgentCampaigns);


UC_getMyAgentCampaigns_async

Structure: ()

Get agents of my campaings in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getSystemCampaigns
collapsetrue
let response = await UC_getSystemCampaigns();
return response;


UC_getMySuperCampaigns

(callback)

Get campaigns if Im a supervisor in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getMySuperCampaigns
collapsetrue
 UC_getMySuperCampaigns(callback);


UC_getMySuperCampaigns_async

Structure: ()

Get campaigns if Im a supervisor in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getMySuperCampaigns
collapsetrue
let response = await UC_getMySuperCampaigns();
return response;


UC_getAgentForCampaign

(campaign,callback)

Get agents of an specific campaign in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getAgentForCampaign
collapsetrue
 UC_getAgentForCampaign(campaign,callback);


UC_getAgentForCampaign_async

Structure: (campaign)

Get agents of an specific campaign in the callback in json format.


Code Block
languagejs
themeMidnight
titleUC_getAgentForCampaign
collapsetrue
let response = await UC_getAgentForCampaign(campaign);
return rsponse;


UC_subirArchivoCSV

(archivo, tabla,sentence,callback)

Upload a CSV file to a database table.

archivo: Obtained from an upload

tabla: Destination table.

sentence: If changes are required (check MYSQL LOAD IN FILE syntax).

callback: Null or name of the function to execute on completion, returns the result.


Code Block
languagejs
themeEmacs
titleUC_subirArchivoCSV
collapsetrue
UC_subirArchivoCSV(archivo, "DC_Telefono","IGNORE 1 LINES (agente,telefono)\n",respUploadCodigoCSV);


UC_subirArchivoCSV_async

Structure: (archivo, tabla, sentence)

Upload a CSV file to a database table.

archivo: Obtained from an upload

tabla: Destination table.

sentence: If changes are required (check MYSQL LOAD IN FILE syntax).


Code Block
languagejs
themeEmacs
titleUC_subirArchivoCSV
collapsetrue
let response = await UC_subirArchivoCSV(archivo, "DC_Telefono","IGNORE 1 LINES (agente,telefono)\n");
return response;


UC_generateReport

(jsonReport,html,excel,pdf,doc)

Generates and download a report excel, pdf, doc,txt, cvs.

jsonReport: The object with the following format:

Code Block
languagejs
themeMidnight
titleObject Report
collapsetrue
{"name":"Breaks Totales", //name of the report 
"file":"TiemposPausaBreakePorAgente.jrxml", //  jrxml file
"description":"Breaks Totales", //description
"dsn":"Repo", // data source name
"parameters":"INITIAL_DATE=Timestamp=2015-11-03 00:00:00;FINAL_DATE=Timestamp=2015-11-03 3:59:59;REPORT_LOCALE=Locale=es;AGENT=Agent='Admin',,'Agente1','Agente10','Agente11',",
//report parameters type and value for generation.
"grouped":"Agentes", //group
"language":"es", //language
"license":"CCS"}

html, excel, pdf, doc: this parameters are 1 o 0, when 1 is downloaded in the following format. (excel 2 is a csv) (doc in 2 is txt)



Code Block
languagejs
themeEmacs
titleUC_generateReport
collapsetrue
UC_generateReport(objetoReporte,0,2,0,0);


UC_closeForm

Close actual Form.


Code Block
languagejs
themeMidnight
titleUC_closeForm
collapsetrue
UC_closeForm();


UC_ShowXForm

Shows X button on Form Tab.


Code Block
languagejs
themeMidnight
titleUC_ShowXForm
collapsetrue
UC_ShowXForm(); 


UC_setChannelVariable

(variable, value, callback)

Sets a variable to an active call.

variable:Name of the value.

value: Value.

callback: Returns.


Code Block
languagejs
themeMidnight
titleUC_setChannelVariable
collapsetrue
UC_setChannelVariable('nombre','pepe',null);


UC_setChannelVariable_async

Structure: (variable, value)

Sets a variable to an active call.

variable:Name of the value.

value: Value.


Code Block
languagejs
themeMidnight
titleUC_setChannelVariable
collapsetrue
let response = await UC_setChannelVariable('nombre','pepe');
return response;


UC_TagRecord

(guid, data) 

Tag a recording so we can search for that value on Recordings.

guid: Id of the call from CTI object.

data: Text to tag it.


Code Block
languagejs
themeMidnight
titleUC_TagRecord
collapsetrue
 UC_TagRecord(guid, "data");


UC_respool

(objetoRespool, callback)

Respool for a Dialer call when you havent reach the client you wanted. is possible to add the next phone of the contact to the dialer altough was an answered call.

 objetoRespool: Object of the type UC_DialerObject (check function).

callback: Response of the function.



Code Block
languagejs
themeMidnight
titleUC_Respool
collapsetrue
 UC_respool(objetoRespool, callback);


UC_respool_async

Structure: (objetoRespool)

Respool for a Dialer call when you havent reach the client you wanted. is possible to add the next phone of the contact to the dialer altough was an answered call.

 objetoRespool: Object of the type UC_DialerObject (check function).



Code Block
languagejs
themeMidnight
titleUC_Respool
collapsetrue
let response = await UC_respool(objetoRespool);
return response;


UC_DialerObject

(dialer)

Returns an object type calls_spool (dialer table), so we can make a respool or dialer schedule.

dialer: String of the attribute Dialer in the CTI object.


Code Block
languagejs
themeMidnight
titleUC_DialerObject
collapsetrue
UC_DialerObject(CTI.Dialer);


UC_replaceAll

(str, find, replace)

Replace all occurrences of a string.

str: Original String.

find: String to find.

replace: What to replace with.

Returns changed String.


Code Block
languagejs
themeMidnight
titleUC_replaceAll
collapsetrue
 UC_replaceAll("Hello world","world","how are you?");


UC_generateNamedReport

(jsonReport, html, excel, pdf, doc, name)

Generates and download a report excel, pdf, doc,txt, cvs. but with a determinated name (not a guid).

jsonReport: The object with the following format:

Code Block
languagejs
themeMidnight
titleObject Report
collapsetrue
{"name":"Breaks Totales", //name of the report 
"file":"TiemposPausaBreakePorAgente.jrxml", //  jrxml file
"description":"Breaks Totales", //description
"dsn":"Repo", // data source name
"parameters":"INITIAL_DATE=Timestamp=2015-11-03 00:00:00;FINAL_DATE=Timestamp=2015-11-03 3:59:59;REPORT_LOCALE=Locale=es;AGENT=Agent='Admin',,'Agente1','Agente10','Agente11',",
//report parameters type and value for generation.
"grouped":"Agentes", //group
"language":"es", //language
"license":"CCS"}

html, excel, pdf, doc: This parameters are 1 o 0, when 1 is downloaded in the following format. (excel 2 is a csv) (doc in 2 is txt).

name: Name of the file to download.


Code Block
languagejs
themeEmacs
titleUC_generateNamedReport
collapsetrue
UC_generateNamedReport(objetoReporte,0,2,0,0,"nombreReport");


UC_DialerSchedule

(callDate, objectDialer, callback)

Schedule a call for a Dialer in a determinated date for a campaign and destination.

callDate: Datetime for the schedule call.

objetDialer: Object UC_DialerObject with the Dialer String of the CTI object ,

callback: Response of the function.



Code Block
languagejs
themeMidnight
titleUC_DialerSchedule
collapsetrue
UC_DialerSchedule(objetoScheudle, callbackDialerSchedule);


UC_DialerSchedule_async

Structure: (callDate, objectDialer)

Schedule a call for a Dialer in a determinated date for a campaign and destination.

callDate: Datetime for the schedule call.

objetDialer: Object UC_DialerObject with the Dialer String of the CTI object.



Code Block
languagejs
themeMidnight
titleUC_DialerSchedule
collapsetrue
let response = UC_DialerSchedule(objetoScheudle);
return response;


notification

(title, message, icon, type)

Shows a message to the user.

title: Title of the notification.

message: Message of the notification.

icon: Fontawesome string for icon.

Example:"fa fa-times"(error),"fa fa-check"(success),"fa fa-warning"(warning)

type: Type of the notification.

-Example:"danger"(error),"success"(success),"warning"(warning)


Code Block
languagejs
themeMidnight
titlenotification
collapsetrue
notification("Error","Must enter the name","fa fa-times","danger");


UC_audit

(audit)

Audits actions of the user.

Adds a record to ccrepo.auditory with user and IP.


Code Block
languagejs
themeEmacs
titleUC_audit
collapsetrue
UC_audit('The user successfully logging');


UC_goToTab

(idTabPane)

Go to other tab of the Form.

idTabPane: Tab-pane id we want to show.


Code Block
languagejs
themeMidnight
titleUC_goToTab
collapsetrue
UC_goToTab("Ventas");


UC_generateGraphic

(idContenedor, datos, tipo,titulo, colores, tamano)

Genete charts.

idContenedor: If of the chart container.

datos: Array of the data for the chart.

tipo: Chart type if lineal null else pie, donut, bars.

titulo: Title for a donut chart else null.

colores: Array of colors in hexadecimal (['#2334','#45454']).

tamaño: Size in pixels of the chart ('240px') else null takes the size of the container.


Code Block
languagejs
themeMidnight
collapsetrue
var arrayDatos= [['data1', 30],['data2', 120]];
UC_generateGraphic("idContenedor",arrayDatos,"pie",null,null);
 
var arrayDatosLineas=[
	 ['data1', 30, 200, 100, 400, 150, 250],
	 ['data2', 50, 20, 10, 40, 15, 25]
];
UC_generateGraphic("idContenedor",arrayDatosLineas,null,null,null);


UC_Http_proxy

Only url and method fields are required

Method must be: GET, POST, PUT or DELETE

The body field must be the same string you want to send in the request

Code Block
languagejs
themeMidnight
titleUC_generateGraphic
await UC_RestHttp_proxy({
	url: 'https://api-mirror.herokuapp.com/', 
	method: 'POST', 
	headers:{'authorization': 'header1'}, 
	body: '{}', 
	type: 'application/json'
})


Response example

Code Block
languagejs
themeMidnight
titleUC_generateGraphic
{
	body: "the body response",
	code: "200", //401, 504 etc
	headers: {
		content-type: ['application/json'],
		server: ['gunicorn/19.7.1']
	}
}



UC_ExecGet_async
await UC_ExecGet_async({url: 'https://google.com.uy', headers: {'Authorization': '1234'}})

UC_ExecPost

(url, data, callback)


Executes a POST webService from our domain.

url: Pass the url of the web service .

data: If the web service expects parameters, you must pass on data. 

calback : Return.

header: Array containing list of headers


Code Block
languagejs
themeMidnight
titleUC_ExecPost
collapsetrue
UC_ExecPost(url, data, callback, [{header: 'Name', value: 'value'}]);


UC_ExecPost_async

Structure: (url, data)


Executes a POST webService from our domain.

url: Pass the url of the web service .

data: If the web service expects parameters, you must pass on data. 



Code Block
languagejs
themeMidnight
titleUC_ExecPost
collapsetrue
let response = UC_ExecPost_async('https://5dc2cc541666f6001477f514.mockapi.io/post/test', '{"data": "data to be sended"}', [{header: 'Name', value: 'value'}]);
return response;


UC_ExecPostSOAP

(url, body, callback)


Executes a SOAP action from a web service

url: URL of the soap action, including the action name

body: XML of the soap request

callback : Return.

headers : Headers to include in the http request


Code Block
languagejs
themeMidnight
titleUC_GM_LoadActions
collapsetrue
var xml = '<?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">   <soap12:Body>     <ObtengoDatos_HomeBanking_DOC xmlns="http://www.italcred.com">       <DOC>2905977</DOC>     </ObtengoDatos_HomeBanking_DOC>   </soap12:Body> </soap12:Envelope>';

UC_ExecPost(http://serverip/ws_integra_beta/servicio.asmx?op=ObtengoDatos_Disponible, xml, function(xmlResponse){
	// xmlResponse	
},[{header: "Autorization", value: "Basic 748o748974837489237489"}, {header: "Custom-header", value: "Value header"}]);


UC_ExecPostSOAP_async

Structure: (url, body)


Executes a SOAP action from a web service

url: URL of the soap action, including the action name

body: XML of the soap request

headers : Headers to include in the http request


Code Block
languagejs
themeMidnight
titleUC_GM_LoadActions
collapsetrue
var xml = '<?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">   <soap12:Body>     <ObtengoDatos_HomeBanking_DOC xmlns="http://www.italcred.com">       <DOC>2905977</DOC>     </ObtengoDatos_HomeBanking_DOC>   </soap12:Body> </soap12:Envelope>';

let response = await UC_ExecPost(http://serverip/ws_integra_beta/servicio.asmx?op=ObtengoDatos_Disponible, xml,[{header: "Autorization", value: "Basic 748o748974837489237489"}, {header: "Custom-header", value: "Value header"}]);
return response;


UC_GM_LoadActions

(measure, actions, callback)

Executes a Gamification WebService that allows to add points to the agent.

measure: Name of the measure

actions: Ammount of actions to credit (it will be multiplied with the measure to calculate the points)

callback: Return.


Code Block
languagejs
themeMidnight
titleUC_GM_LoadActions
collapsetrue
UC_GM_LoadActions('measureName', 100, callback);



UC_GM_LoadActions_async

Structure: (measure, actions)

Executes a Gamification WebService that allows to add points to the agent.

measure: Name of the measure

actions: Ammount of actions to credit (it will be multiplied with the measure to calculate the points)


Code Block
languagejs
themeMidnight
titleUC_GM_LoadActions
collapsetrue
let response = await UC_GM_LoadActions('measureName', 100);
return response;


UC_openForm

(name, ctiObj)

Open new form with the name given 

name: Form name

ctiObj: Null or cti object


UC_Encrypt

text: Text to encrypt

Encrypts the string passed by parameter and returns an object. You can save that object and decrypt it later or you can get the object value by executing obj.toString() 


Code Block
languagejs
let test = UC_Encrypt('text to encrypt or whatever')
console.log(test.toString()) // result is: "+VZ5lGWZ0DAONrcnP3MkEFGfpgP/LSPqhUDU4aXfY6U="

//Decrypt
UC_Decrypt('+VZ5lGWZ0DAONrcnP3MkEFGfpgP/LSPqhUDU4aXfY6U=')
UC_Decrypt(test)
//this expressions will give you the same result: "text to encrypt or whatever"


UD_Decrypt

text: Text or object to decrypt

Decrypts the object returned by the encrypt funcion or the value obtained by excuting obj.toString()


UC_Add_Blacklist

Adds a contact to blacklist

Recibes: Json object with contact data, callback.




Code Block
languagejs
let my_object = {"name":'name', "campaign":"hello", "username": "username", "phone": "phonenumber", "company": "Integra", "job_title": "Developer", "name": "name"}
UC_Add_Blacklist(my_object, callback)


UC_Remove_Blacklist

Removes a contact from blacklist

Recibes: Json object with contact data, callback.



Code Block
languagejs
let my_object = {"name":'name', "campaign":"hello", "username": "username", "phone": "phonenumber", "company": "Integra", "job_title": "Developer", "name": "name"}
UC_Remove_Blacklist(my_object, callback)


UC_RemoveContactDialer


Removes a contact for the dialer of a given campaign

Recibes: Campaign and number

If * is the campaign value, the system will remove the contact for all campaigns.


Code Block
languagejs
UC_RemoveContactDialer('campaign', '36472974932')
UC_RemoveContactDialer('*', '36472974932')


UC_RemoveContactScheduler

Removes a contact for the scheduler of a given campaign

Recibes: Campaign and number

If * is the campaign value, the system will remove the contact for all campaigns.


Code Block
languagejs
UC_RemoveContactScheduler('campaign', '36472974932')
UC_RemoveContactScheduler('*', '36472974932')


UC_UploadBase

Uploads a dialer list

campaign: name of campaign

name: name of list

list: Array[] of Objects{}

callback (optional): response of function

Example of list array:

Code Block
languagejs
var list=[{campaign:"campaignTest<-",destination:"099111111",data:"variable1=val1:variable2=val2",alternatives:"099222222:099333333",priority:"9999",agent:"Agent1"},{campaign:"campaignTest<-",destination:"213123",data:"variable1=val1",alternatives:"213213:123123",priority:"1233"}]

Use:


UC_UploadBase("campaignTest←","nameOfList",list,callbackFunctionName)


UC_GenerateExampleCSV

Function download a CSV file is used for files that show the rise format CSV file.


textToWrite: Text that you want to give as an example in the CSV file.

idbtnCSV: Button identifier The same should be written between '', example 'idButton'.


The button to which we are calling in the function must be of the <a> type, since the <a> tag allows the href which is what is used in the function, but not the <button>. Example of a button with the <a> tag:


<a id="btnBuscar" class="btn btn-primary" style="width: 100%;height: 100%;color:white;padding:0px;background-color: rgba(0, 0, 0, 0.3);" name="btnBuscar">
       <span data-fa="fa"></span> 
       <span class="btnText">Buscar</span>
</a>

UC_GenerateExampleCSV('ExampleEmailCamp;email;value1;value2;value3;NOACTION','btnBuscar');
UC_MuteRecording

This function mutes or unmute the recording according to the value receive in the parameter


Structure (value)


Value: 0 or 1, 1 for muting, 0 for unmuting


UC_StartRecording

Starts a new mix monitor on the channel

Structure: (complete_path, callback)

callback: retrieves the mix monitor id.

Complete_path: complete path location of the file (including name)




UC_StopRecording

Stops a previously started mix monitor (UC_StartRecording)

Structure: (idMix)

IdMix: Mix monitor id to be stopped. Obtained from UC_StartRecording




UC_getCurrentCallInfo

Returns the state of the actual call. If it isn't in call, the property isInCall will be false

Code Block
languagejs
{
    "isInCall":true,
    "startDate":"2019-11-21T19:46:38.833Z",
    "callerIdNum":"12343434",
    "inbound":false,
    "guid":"7dbaab4e-4d10-460f-a5e6-787c49351006",
    "campaign":"Hola->"
}



UC_ExecScript_async

Executes one command on the application server

Parameters

command: command 

Example


Code Block
languagejs
titleEjemplo
let value = await UC_ExecPythonScript_async('python /etc/IntegraServer/scripts/test.py');



...