Versions Compared

Key

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

Recordar que para poder usar la API se necesita.:

  1. Autenticarse y obtener un token para la sesión.

  2. Usar el token en el Header Authorization.

  3. Finalizar sesión.

Vea más aquí

Tip

En los ejemplos:

  • Utilizaremos “Basic XXXX” como APIKey

  • Utilizaremos “dominio.ucontactcloud.com“ como URL Relativa

...

UserLogin

...

UserLoging JS

expand
Code Block
languagejs
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://dominio.ucontactcloud.com/Integra/resources/auth/UserLogin",
  "method": "POST",
  "headers": {
    "cache-control": "no-cache",
    "content-type": "application/x-www-form-urlencoded"
  },
  "data": {
    "user": "Agente1",
    "password": "123"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
title

UserLoging C#

Code Block
languagec#
var client = new RestClient("https://dominio.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=Agente1&password=123", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Expand
title

UserLoging cURL

expand
Code Block
curl -X POST \
  https://dominio.ucontactcloud.com/Integra/resources/auth/UserLogin \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/x-www-form-urlencoded' \
  -d 'user=Agente1&password=123'
title

UserLoging JAVA

Code Block
languagejava
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://dominio.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();

...

Subir lista de contactos a Marcador

...

SubirBase JS

title
Code Block
languagejs
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://dominio.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": "Campaña",
    "cant": "100",
    "username": "Agente1"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
Expand

SubirBase C#

Code Block
languagec#
var client = new RestClient("https://dominio.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=Campaña&cant=100&username=Agente1", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Expand
title

SubirBase cURL

expand
Code Block
languagetext
var client = new RestClient("https://dominio.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=Campaña&cant=100&username=Agente1", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
title

SubirBase JAVA

Code Block
languagejava
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://dominio.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();

...

Realizar una llamada

...

Realizar llamada JS

title
Code Block
languagejs
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://dominio.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": "Agente1",
    "phone": "1001",
    "tech": "SIP",
    "context": "agentes",
    "outqueue": "CampSaliente->",
    "destination": "240099111"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
Expand

Realizar llamada C#

expand
Code Block
languagec#
var client = new RestClient("https://dominio.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=1001&tech=SIP&context=agentes&outqueue=CampSaliente->&destination=240099111", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
title

Realizar llamada cURL

Code Block
curl -X POST \
  https://dominio.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=1001&tech=SIP&context=agentes&outqueue=CampSaliente->&destination=240099111'
Expand
title

Realizar llamada JAVA

Code Block
languagejava
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "callerid=77778888&agent=Agente1&phone=1001&tech=SIP&context=agentes&outqueue=CampSaliente->&destination=240099111");
Request request = new Request.Builder()
  .url("https://dominio.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();

...

Agendar llamada

...

Objeto Json

Code Block
languagejs
 {
  "calldate" : "2018-10-11 15:00:00",              //Fecha a ser ejecutada
  "campaign" : "Ventas->",                         //Campaña de marcador
  "destination" : "098344484",                     //Destino de la llamada
  "alternatives" : "099124484:099121212",          //Números alternativos
  "agentphone" : "1001",                           //Número de agente si Progresivo
  "data" :  "Par1=Val1:Par2=Val2"                  //Valores para Flujos y Formularios
}
Expand
title

Agendar llamada JS

expand
Code Block
languagejs
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://dominio.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);
});
title

Agendar llamada C#

title
Code Block
languagec#
var client = new RestClient("https://dominio.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);
Expand

Agendar llamada cURL

expand
Code Block
curl -X POST \
  https://dominio.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
title

Agendar llamada JAVA

Code Block
languagejava
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "callschedule={
  "calldate" : "2018-10-11 15:00:00",              //Fecha a ser ejecutada
  "campaign" : "Ventas->",                         //Campaña de marcador
  "destination" : "098344484",                     //Destino de la llamada
  "alternatives" : "099124484:099121212",          //Números alternativos
  "agentphone" : "1001",                           //Número de agente si Progresivo
  "data" :  "Par1=Val1:Par2=Val2"                  //Valores para Flujos y Formularios
}");
Request request = new Request.Builder()
  .url("https://dominio.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 llamada

...

Respool JS

title
Code Block
languagejs
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://dominio.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
	}"
  }
}
Expand

Respool C#

Code Block
languagec#
var client = new RestClient("https://dominio.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);
Expand
title

Respool cURL

Code Block
curl -X POST \
  https://dominio.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
Expand
title

Respool JAVA

Code Block
languagejava
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "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
}");
Request request = new Request.Builder()
  .url("https://dominio.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();

Funcionamiento de la API

...

...