- Created by Daniel Olivera (Unlicensed) , last modified on Nov 25, 2019
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 2 Next »
Here we can find all the information relevant to the telephony actions that can be performed through our API.
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
Calls
With the calls we can find the following available actions
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
<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>
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.
<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>
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
<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>
Disposition the call using dialer actions and taging
RESPOOL
RESPOOLALTERNATIVE
BLACKLIST
SCHEDULE
Dispositions must be configured in uContact.
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
Allows to call a web service that injects information into a voice dialplan allowing multiple actions by workflows
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
Add number to Do not call Registry (black list) by campaign or use * on campaign for all
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
{"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
Dialers
Here we see some actions that we use only for voice markers.
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
windowProxy = new Porthole.WindowProxy('<URL PARENT>'); windowProxy.addEventListener(onMessage); windowProxy.post({'action': 'CTI'}); function onMessage(messageEvent) { CTI = messageEvent.data.CTI; }
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
{ "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 }
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
<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>
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.
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
{ "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
<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>
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.
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 (Bulk list made one by one. Alternative phones separated)
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
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 (Calldate is any future date time)
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 (Assigned to an specific Agent)
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}
Relative URL: Integra/resources/Dialers/RemoveContact Method: POST content-type:application/x-www-form-urlencoded; charset=UTF-8 Params: campaign number Result: 1
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
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.
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
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)
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
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.
Colección de postman con algunas de las llamadas.
- No labels