Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

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í

En los ejemplos:

  • Utilizaremos “Basic XXXX” como APIKey

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


UserLogin

 UserLoging JS
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);
});

 UserLoging C#
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);

 UserLoging cURL
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'

 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://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
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);
});

 SubirBase C#
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);

 SubirBase cURL
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);

 SubirBase 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://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
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);
});

 Realizar llamada C#
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);

 Realizar llamada cURL
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'

 Realizar llamada JAVA
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
 {
  "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
}

 Agendar llamada JS
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);
});

 Agendar llamada C#
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);

 Agendar llamada cURL
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

 Agendar llamada JAVA
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
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
	}"
  }
}

 Respool C#
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);

 Respool cURL
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

 Respool JAVA
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

  • No labels