Versions Compared

Key

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

Here we can find all the information relevant to the telephony actions that can be performed through our API.

Info

Remember that to use the API you need

  1. Authenticate and get a token for the session

  2. Use the token in the Header Authorization

  3. End session

See more here…

Table of Contents
typeflat



Calls

With the calls we can find the following available actions

Expand
titleClick here to expand Make Call

Code Block
Relative URL: Integra/resources/Agents/AgentCall
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params: callerid (From number that the call will go out with)
        agent    (Name of the Agent that generates the call)
        phone    (Phone of the Agent that generates the call)
        tech     (Usually SIP)
        context  (Context of the Agent configured in uContact)
        outqueue (Name of the Outbound Campaign to compute the call)
        destination (Destination number)
Result: TEXT  (Guid of the generated call)
              0 if Error

This is a two step call will call the agent and when answer (or auto answer), 
the final call it is generated.

via Proxy

Code Block
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/porthole/1.0.0/porthole.js"></script>
<script type="text/javascript">
 
   function Call () {
       var windowProxy;
       windowProxy.addEventListener(onResponse);
       windowProxy = new Porthole.WindowProxy(window.location.protocol + window.location.hostname);
       windowProxy.post({'action': 'call', 'campaign' : '<CAMPAIGN>', 'callerid' : '<CALLERID>', 'destination' : '<NUMBER>'});
   }
 
  function onResponse(messageEvent) {
        response = messageEvent.data.guid; //returns uniqueid of the call
  
    }
</script>

Expand
titleClick here to expand Make call by phone
Info

This function allows you to make a call directly using the portal's phone. The only way to use it is via proxy, because the communication is with the uContact portal.

Code Block
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/porthole/1.0.0/porthole.js"></script>
<script>
        function call(){
 
            var windowProxy;
             
            windowProxy = new Porthole.WindowProxy(window.location.protocol + '//' + window.location.hostname);
            windowProxy.addEventListener(onResponse);
            windowProxy.post({
                action: 'callWithPhone',
                destination: '091000000',
                campaign: 'Sale->'
            });
        }
 
    
  
        function onResponse(messageEvent) {
            var response = messageEvent.data.guid;
            alert(response);
        }
</script>

Expand
titleClick here to expand HungUp Call

Code Block
Relative URL: Integra/resources/Agents/HungupPhone
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params: phone    (Phone of the Agent that generates the call)

Result: 	  1  Success on hung up
              0 if Error

via Proxy

Code Block
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/porthole/1.0.0/porthole.js"></script>
<script type="text/javascript">
//for example on click when you want to hangup
   function Hangup () {
       var windowProxy;
       windowProxy = new Porthole.WindowProxy(window.location.protocol + window.location.hostname);
       windowProxy.post({'action': 'hangup'});
   }
 
</script>

Expand
titleClick here to expand Disposition Call
Info

Disposition the call using dialer actions and taging

  • RESPOOL

  • RESPOOLALTERNATIVE

  • BLACKLIST

  • SCHEDULE

Dispositions must be configured in uContact.

Code Block
Relative URL: Integra/resources/api/DispositionCall
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:     campaign      (campaign name)
            agent         (agent name)
            callerid      (customer phone number)
            guid          (call id)
            l1            (level 1 disposition)
            l2            (level 2 disposition)
            l3            (level 3 disposition)
            d1            (extra data)
            d2            (extra data)
            comment       (comment)
            schedule      (if action RESCHEDULE will schedule a call in the future for that number)
Result:  1

Expand
titleClick here to expand External Workflow call
Info

Allows to call a web service that injects information into a voice dialplan allowing multiple actions by workflows

Code Block
Relative URL: Integra/resources/admin/CallWorkflow
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:    context       (incoming context of the flow)
           extension     (incoming extension of the flow) 
           jsonparams    (JSON Object)
Result:  OK

Expand
titleClick here to expand Add to DNCR (blacklist)
Info

Add number to Do not call Registry (black list) by campaign or use * on campaign for all

Code Block
Relative URL: Integra/resources/admin/addblack
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:     black (JSON Object)
Result:  1

Json object

Code Block
{"phone": "phone number", "campaign":"Campaign or *", "username": "user",  "company": "Customer data", "job_title": "Customer data","name": "Name"}


Recordings

Here you will find how to use recordings with the API

Expand

Expand

Expand
titleClick here to expand Tag Record



Dialers

Here we see some actions that we use only for voice markers.

Expand
titleClick here to expand CTI

This JSON object is found on LocalStorage and encrypted, this has the information of the Answered Call and if is From a Dialer all the information of the Next alternative phone to Respool.

Dialer: Campaign, Main number, status(always 1), data (params and values for the workflow), alternatives (with :), retries (for this main number), contact (id), dialebase, priority, agentphone


Convert this datas to the Objet Respool shown below.

What can we do with Objet Respool?:

  • Change main number and alternatives and reorder them

  • Change retries for the main number (example if we use an alternative number as main then we set retries to 0)

  • Change priorities

  • Add data or change them for the workflow

  • agentphone, if progressive we can assign it to other agent

  • DON'T CHANGE: campaign, status, contact, dialerbase: Can alter the dialer beheavior.

via Proxy

Code Block
windowProxy = new Porthole.WindowProxy('<URL PARENT>');
windowProxy.addEventListener(onMessage);
windowProxy.post({'action': 'CTI'});
 
 
function onMessage(messageEvent) {
  CTI = messageEvent.data.CTI;
 
}

Expand
titleClick here to expand Respool Call

Code Block
Relative URL: Integra/resources/Dialers/Respool
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:  callspool   (JSON Object)
Result:  1

Json object

Code Block
{
 
  "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
}
Warning

Never Respool a destination that is already on the Spool always a alternative number, in CTI the principal number is already the first alternative.

via Proxy

Code Block
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/porthole/1.0.0/porthole.js"></script>
<script type="text/javascript">
 
   function Respool () {
       var windowProxy;
       windowProxy = new Porthole.WindowProxy(window.location.protocol + window.location.hostname);
       windowProxy.post({'action': 'respool', 'objetoRespool' : <Objeto Respool>});
   }
 
</script>

Expand
titleClick here to expand Schedule Call
Warning

The dialer has to be Enable and On Date To process Schedule Calls if not this will be the first to go out when the Dialer starts again.

Code Block
Relative URL: Integra/resources/Dialers/ScheduleDialerCall
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:  callschedule   (JSON Object)
Result:  1 OK
         0 ERROR

Json Object

Code Block
{
  "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
}

via Proxy

Code Block
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/porthole/1.0.0/porthole.js"></script>
<script type="text/javascript">
 
   function Schedule () {
       var windowProxy;
       windowProxy = new Porthole.WindowProxy(window.location.protocol + window.location.hostname);
       windowProxy.post({'action': 'schedule', 'callDate' : '<2016-10-10 15:00:00>', 'objectDialer' : <Objecto Respool> });
   }
 
</script>

Expand
titleClick here to expand Dialer Tasks
Info

If the call date is specified, the task will execute at this exact moment, on the contrary, if the date is specified as null, the task will execute when the schedule is free.

The priority of the scheduled task with an specific date will be higher than the one that date is null.

Code Block
Dialer Task

URL Relativa: Integra/resources/Dialers/DialerTask
Método: POST
content-type: application/x-www-form-urlencoded
Parámetros:  call   (Objeto JSON)
Resultado:  1 OK
            0 ERROR

Examples for each mode

Insert Dialer with priority

2 (

X

Info

Bulk list made one by one

.


Alternative phones separated

)

Code Block
Dialer, Priority X

{"calldate" : null,
"campaign" : "campName<-",
"destination": "12-345-678",
"alternatives": "",
"agent" : "",
"data": "idcustomer=7",
"source": "source",
"bulk": true,
"automatic": false }

Insert Dialer with high priority

Info

"calldate" is NOW
This action is used to call moments after being executed.

Code Block
Dialer, Priority High

{"calldate" : null,
"campaign" : "campName<-",
"destination": "12-345-678",
"alternatives": "",
"agent" : "",
"data": "idcustomer=7",
"source": "source",
"bulk" : false,
"automatic" : true }

Insert Scheduled Call for anytime

(

Info

Calldate is any future date time

)

Code Block
Dialer, Any Time

{"calldate" : "2018-01-01 00:00:00",
"campaign" : "campName<-",
"destination": "12-345-678",
"alternatives": "",
"agent" : "",
"data": "idcustomer=7",
"source": "source",
"bulk" : false,
"automatic" : false }

Insert Dialer call to a Dialer with ownership

(

Info

Assigned to an specific Agent

)


This action is executed for a Progressive type dialer

Code Block
Dialer, Specific Agent

//Identify Agent by its username:

{"calldate" : null,
"campaign" : "campName->",
"destination": "12-345-678",
"alternatives": "",
"agent" : "Agent1",
"data": "idcustomer=7",
"source": "source",
"bulk" : false,
"automatic" : false}

//Identify Agent by its assigned phone number:

{"calldate" : null,
"campaign" : "campName->",
"destination": "12-345-678",
"alternatives": "",
"agent" : "1001",
"data": "idcustomer=7",
"source": "source",
"bulk" : false,
"automatic" : false}
Expand
titleClick here to expand Delete Contact from Dialer

Code Block
Relative URL: Integra/resources/Dialers/RemoveContact
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:     campaign
            number
Result:  1

Expand
titleClick here to expand Delete Schedule from Dialer
Info

Deletes a schedule call, parameters campaign, number,date from and to format:

(YYYY-MM-DD HH:mm:ss) to be able to delete in a date time range

Code Block
Relative URL: Integra/resources/Dialers/RemoveScheduleDialerCall
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:     campaign
            destination
            from
            to
Result:  1



Upload Bases

The API gives us the possibility to upload the lists of dialers in a simple way, with parameters and with timezone so that it is used the most appropriate to your needs.

Expand
titleClick here to expand Upload Calls Base

Code Block
Relative URL: Integra/resources/Dialers/uploadbase
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:  filename         (Name of the file)
         fileb64          (base64 content of the file)
         campaign         (Name of the campaign)
         cant             (Count of records)
		 username		  (user uploading)
Result: 1 (Async Method)

File Format

Code Block
prueba1;098344484;var1=val1:var2=val2;099124484:099111111;9999;1001
campaign;principanumber;parameters and values for workflows and forms;alternatives phones separated by :; priority (optional);agentphone (optional)

Expand
titleClick here to expand Upload Calls Base with Timezone

Code Block
Relative URL: Integra/resources/Dialers/uploadbasewithtimezone
Method: POST
content-type:application/x-www-form-urlencoded; charset=UTF-8
Params:  filename         (Name of the file)
         fileb64          (base64 content of the file)
         campaign         (Name of the campaign)
         cant             (Count of records)
         username         (user uploading)
         timezone         (Timezone, the list of zones can be found in: uContact Timezones)
Result: 1 (Async Method)

File format

Code Block
prueba1;098344484;var1=val1:var2=val2;099124484:099111111;9999;1001
campaign;principanumber;parameters and values for workflows and forms;alternatives phones separated by :; priority (optional);agentphone (optional)



Campaigns

You can also get voice campaign information through the API.

Expand

Expand


Colección de postman con algunas de las llamadas.