Add Record to Dialer
Adds a record to a dialer to launch the call as soon as an agent is available. This record will be added to the queue, meaning that records already in the queue will be dialed first, regardless; this queue will only consider records that do not belong to a dialing list.
You can check the Postman Collection to test in your instance.
All data enclosed in "{{ }}" are values that will be replaced with the client's own data and/or the corresponding instance.
HTTP Request
Method | Resource |
POST | /Integra/resources/Dialers/DialerTask |
Request Header
Key | Value |
Content-Type | application/x-www-form-urlencoded |
Authorization | Basic {{Token}} |
Request Body
Parameter | Type | Required | Description |
call |
JSON String (String) | Yes | JSON Object Converted to Text with the added data in the following example. |
JSON Example
The data added in the following example is purely demonstrative; you will need to replace the data with those corresponding to your instance.
{
"calldate": null, // If you need to call at a specific time, example: '1900-01-01 00:00:00'
"campaign": "POWER<-", // Name of the campaign to add the record to
"destination": "0123456789", // Phone number to be dialed
"alternatives": "", // Alternative number to call if the first number is not reachable
"agent": "", // Phone/Extension of the agent if you want a specific agent to take the call
"data": "idcustomer=7", // Data to show on the instance's form or for specific use
"source": "source", // Pending
"bulk": false, // Pending
"automatic": true // Pending
}
Description of JSON Object
In the JSON, all keys must be included. If a field states that it is not mandatory, it can be added with an empty value.
Parameter | Type | Required | Description |
calldate | Text (String) | No | Defines the time at which the call will be made; it can be 'null' or a date in the format '1900-01-01 00:00:00'. |
campaign | Text (String) | Yes | Name of the campaign to which the record will be added. |
destination | Text (String) | Yes | Phone number to be called. |
alternatives | Text (String) | No | Alternative numbers to contact if the first number cannot be reached; can be left empty. |
agent | Text (String) | No | Phone number/extension of the agent if a specific agent is required to take the call. |
data | Text (String) | No | Data to be added for display in forms, surveys, or for other purposes within the platform. |
source | Text (String) | Yes | |
bulk | Boolean | yes | |
automatic | Boolean | yes |
Code Examples
You can copy the following code examples and replace the "{{variable}}" with the correct data.
HTTP
POST /Integra/resources/Dialers/DialerTask HTTP/1.1
Host: {{Instance}}.ucontactcloud.com
Authorization: Basic {{Token}}
Content-Type: application/x-www-form-urlencoded
Content-Length: 310
call={{Objeto Json}}
cURL
curl --location --request POST 'https://testclever.ucontactcloud.com/Integra/resources/Dialers/DialerTask' \
--header 'Authorization: Basic VmNpc25lcm9zOjY3NDdjODIzLWY5ZmItNDY0My05NTc0LWNjMjJhOTlhZDRlMQ==' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'call={"calldate" : null,"campaign" : "POWER<-","destination": "1234567890","alternatives": "","agent" : "","data": "idcustomer=7","source": "source","bulk": false,"automatic": true }'
JavaScript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Basic {{Token}}");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("call", "{\"calldate\" : null,\"campaign\" : \"POWER<-\",\"destination\": \"0123456789\",\"alternatives\": \"\",\"agent\" : \"\",\"data\": \"idcustomer=7\",\"source\": \"source\",\"bulk\": false,\"automatic\": true }");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://{{Instance}}.ucontactcloud.com/Integra/resources/Dialers/DialerTask", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
JQuery
var settings = {
"url": "https://{{Instance}}.ucontactcloud.com/Integra/resources/Dialers/DialerTask",
"method": "POST",
"timeout": 0,
"headers": {
"Authorization": "Basic {{Token}}",
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"call": "{\"calldate\" : null,\"campaign\" : \"POWER<-\",\"destination\": \"0123456789\",\"alternatives\": \"\",\"agent\" : \"\",\"data\": \"idcustomer=7\",\"source\": \"source\",\"bulk\": false,\"automatic\": true }"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
C#
var client = new RestClient("https://{{Instance}}.ucontactcloud.com/Integra/resources/Dialers/DialerTask");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic {{Token}}");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("call", "{\"calldate\" : null,\"campaign\" : \"POWER<-\",\"destination\": \"0123456789\",\"alternatives\": \"\",\"agent\" : \"\",\"data\": \"idcustomer=7\",\"source\": \"source\",\"bulk\": false,\"automatic\": true }");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "call={\"calldate\" : null,\"campaign\" : \"POWER<-\",\"destination\": \"0123456789\",\"alternatives\": \"\",\"agent\" : \"\",\"data\": \"idcustomer=7\",\"source\": \"source\",\"bulk\": false,\"automatic\": true }");
Request request = new Request.Builder()
.url("https://{{Instance}}.ucontactcloud.com/Integra/resources/Dialers/DialerTask")
.method("POST", body)
.addHeader("Authorization", "Basic {{Token}}")
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
Python
import http.client
conn = http.client.HTTPSConnection("{{Instance}}.ucontactcloud.com")
payload = 'call={{Objeto Json}}'
headers = {
'Authorization': 'Basic {{Token}}',
'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/Integra/resources/Dialers/DialerTask", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HTTP Response
Successful Response
1
Error Response
0