/
Examples
Examples
Maria Carina Soca (Unlicensed)
Owned by Maria Carina Soca (Unlicensed)
May 03, 2021
Remember that to use the API you need
Authenticate and get a token for the session
Use the token in the Header Authorization
End session
In the examples:
We will use “Basic XXXX
” as APIKey
We will use "252.ucontactcloud.com
" as the Relative URL
UserLogin
UserLoging JS
var settings = {
"async": true,
"crossDomain": true,
"url": "https://252.ucontactcloud.com/Integra/resources/auth/UserLogin",
"method": "POST",
"headers": {
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"user": "Agent1",
"password": "123"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
UserLoging C#
var client = new RestClient("https://252.ucontactcloud.com/Integra/resources/auth/UserLogin");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "user=Agent1&password=123", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
UserLoging cURL
curl -X POST \
https://252.ucontactcloud.com/Integra/resources/auth/UserLogin \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'user=Agent1&password=123'
UserLoging JAVA
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "user=Agente1&password=123");
Request request = new Request.Builder()
.url("https://252.ucontactcloud.com/Integra/resources/auth/UserLogin")
.post(body)
.addHeader("content-type", "application/x-www-form-urlencoded")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();
Upload contact list for Dialers
UploadBase JS
var settings = {
"async": true,
"crossDomain": true,
"url": "https://252.ucontactcloud.com/Integra/resources/Dialers/uploadbase",
"method": "POST",
"headers": {
"authorization": "Basic XXXX",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"filename": "Testing1234",
"fileb64": "Testing12345",
"campaign": "Campaign",
"cant": "100",
"username": "Agent1"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
UploadBase C#
var client = new RestClient("https://252.ucontactcloud.com/Integra/resources/Dialers/uploadbase");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Basic XXXX");
request.AddParameter("application/x-www-form-urlencoded", "filename=Testing1234&fileb64=Testing12345&campaign=Campaign&cant=100&username=Agent1", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
UploadBase cURL
var client = new RestClient("https://252.ucontactcloud.com/Integra/resources/Dialers/uploadbase");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Basic XXXX");
request.AddParameter("application/x-www-form-urlencoded", "filename=Testing1234&fileb64=Testing12345&campaign=Campaign&cant=100&username=Agent1", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
UploadBase JAVA
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "filename=Testing1234&fileb64=Testing12345&campaign=Campaña&cant=100&username=Agente1");
Request request = new Request.Builder()
.url("https://252.ucontactcloud.com/Integra/resources/Dialers/uploadbase")
.post(body)
.addHeader("authorization", "Basic XXXX")
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Start an outgoing call
AgentCall JS
var settings = {
"async": true,
"crossDomain": true,
"url": "https://252.ucontactcloud.com/Integra/resources/Agents/AgentCall",
"method": "POST",
"headers": {
"authorization": "Basic XXXX",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"callerid": "77778888",
"agent": "Agent1",
"phone": "1001",
"tech": "SIP",
"context": "incoming",
"outqueue": "1234",
"destination": "1002"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
AgentCall C#
var client = new RestClient("https://252.ucontactcloud.com/Integra/resources/Agents/AgentCall");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Basic XXXX");
request.AddParameter("application/x-www-form-urlencoded", "callerid=77778888&agent=Agente1&phone=1122&tech=SIP&context=entrantes&outqueue=1234&destination=1002", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
AgentCall cURL
curl -X POST \
https://252.ucontactcloud.com/Integra/resources/Agents/AgentCall \
-H 'authorization: Basic XXXX' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'callerid=77778888&agent=Agente1&phone=1122&tech=SIP&context=entrantes&outqueue=1234&destination=1002'
AgentCall JAVA
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "callerid=77778888&agent=Agente1&phone=1122&tech=SIP&context=entrantes&outqueue=1234&destination=1002");
Request request = new Request.Builder()
.url("https://252.ucontactcloud.com/Integra/resources/Agents/AgentCall")
.post(body)
.addHeader("authorization", "Basic XXXX")
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Schedule call
ScheduleDialerCall JS
var settings = {
"async": true,
"crossDomain": true,
"url": "https://252.ucontactcloud.com/Integra/resources/Dialers/ScheduleDialerCall",
"method": "POST",
"headers": {
"authorization": "Basic XXXX",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"callschedule": "Testing123.json"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
ScheduleDialerCall C#
var client = new RestClient("https://252.ucontactcloud.com/Integra/resources/Dialers/ScheduleDialerCall");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Basic XXXX");
request.AddParameter("application/x-www-form-urlencoded", "callschedule=Testing123.json", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
ScheduleDialerCall cURL
curl -X POST \
https://252.ucontactcloud.com/Integra/resources/Dialers/ScheduleDialerCall \
-H 'authorization: Basic XXXX' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d callschedule=Testing123.json
ScheduleDialerCall JAVA
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "callschedule={
"calldate" : "2015-10-11 15:00:00", //Calldate to be executed
"campaign" : "Ventas->", //Dialer campaign
"destination" : "098344484", //Destination for the call
"alternatives" : "099124484:099121212", //Alternative phones
"agentphone" : "1001", //Agent phone if progressive
"data" : "Par1=Val1:Par2=Val2" //Values for Forms and Workflows
}");
Request request = new Request.Builder()
.url("https://252.ucontactcloud.com/Integra/resources/Dialers/ScheduleDialerCall")
.post(body)
.addHeader("authorization", "Basic XXXX")
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Respool call
Respool JS
var settings = {
"async": true,
"crossDomain": true,
"url": "https://252.ucontactcloud.com/Integra/resources/Dialers/Respool",
"method": "POST",
"headers": {
"authorization": "Basic XXXX",
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"callspool": "{
"campaign": "Ventas->", //Nombre campaña
"destination": "098344484", //Número destino
"dialerbase": "basetest", //Nombre lista del discador
"status": 1, // 1 registro habilitado a ser marcado
"data": "Par1=Val1:Par2=Val2", // Parametros para flujos y formularios
"alternatives": "098124484", // Números alternativos separados con :
"contact": 222, // Id contacto
"retries": 0, // 0 ya que comenzamos a marcar un nuevo número
"priority": 9999, // Prioridad del registro no usar 1 ya que es para agendados, usar > 1
"agentphone": "1001" // Para marcadores Progresivos
}"
}
}
Respool C#
var client = new RestClient("https://252.ucontactcloud.com/Integra/resources/Dialers/Respool");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddHeader("authorization", "Basic XXXX");
request.AddParameter("application/x-www-form-urlencoded", "callspool=
"campaign": "Ventas->", //Nombre campaña
"destination": "098344484", //Número destino
"dialerbase": "basetest", //Nombre lista del discador
"status": 1, // 1 registro habilitado a ser marcado
"data": "Par1=Val1:Par2=Val2", // Parametros para flujos y formularios
"alternatives": "098124484", // Números alternativos separados con :
"contact": 222, // Id contacto
"retries": 0, // 0 ya que comenzamos a marcar un nuevo número
"priority": 9999, // Prioridad del registro no usar 1 ya que es para agendados, usar > 1
"agentphone": "1001" // Para marcadores Progresivos", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Respool cURL
curl -X POST \
https://252.ucontactcloud.com/Integra/resources/Dialers/Respool \
-H 'authorization: Basic XXXX' \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d callspool= "campaign": "Ventas->", //Nombre campaña
"destination": "098344484", //Número destino
"dialerbase": "basetest", //Nombre lista del discador
"status": 1, // 1 registro habilitado a ser marcado
"data": "Par1=Val1:Par2=Val2", // Parametros para flujos y formularios
"alternatives": "098124484", // Números alternativos separados con :
"contact": 222, // Id contacto
"retries": 0, // 0 ya que comenzamos a marcar un nuevo número
"priority": 9999, // Prioridad del registro no usar 1 ya que es para agendados, usar > 1
"agentphone": "1001" // Para marcadores Progresivos
Respool JAVA
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "callspool={
"campaign": "Ventas->", //Name of the campaign
"destination": "098344484", //Destination number
"dialerbase": "basetest", //Name of the dialer List
"status": 1, // 1 if enable
"data": "Par1=Val1:Par2=Val2", // Params for the workflow and Forms
"alternatives": "098124484", //Alternatives numbers separated by :
"contact": 222, // Contactid
"retries": 0, // 0 as we are starting a new phone
"priority": 9999, // Priority to order the records 1 is used for schedule so use > 1
"agentphone": "1001" // For progressive dialers
}");
Request request = new Request.Builder()
.url("https://252.ucontactcloud.com/Integra/resources/Dialers/Respool")
.post(body)
.addHeader("authorization", "Basic XXXX")
.addHeader("cache-control", "no-cache")
.addHeader("content-type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
, multiple selections available,