Skip to main content

Get Campaigns

To obtain all campaigns created within uContact, this API can be used, which returns the totality of Dialers and Queues.

You can check the Colección de Postman to see an example and test it with 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/queues/getqueues

Request Header

Key Value
Content-Type application/x-www-form-urlencoded
Authorization Basic {{Token}}

Request Body

Parameter Type
Required Description
lastrow Text No Send empty

Code Examples

You can copy the following code examples and replace the "{{variable}}" with the correct data.

HTTP

POST /Integra/resources/queues/getqueues HTTP/1.1
Host: {{instance}}.ucontactcloud.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {{Token}}
Content-Length: 8

lastrow=
cURL
curl --location --globoff 'https://{{instance}}.ucontactcloud.com/Integra/resources/queues/getqueues' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic {{Token}}' \
--data-urlencode 'lastrow='
JavaScript
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", "Basic {{Token}}");

const urlencoded = new URLSearchParams();
urlencoded.append("lastrow", "");

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: urlencoded,
  redirect: "follow"
};

fetch("https://{{instance}}.ucontactcloud.com/Integra/resources/queues/getqueues", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
JQuery
var settings = {
  "url": "https://{{instance}}.ucontactcloud.com/Integra/resources/queues/getqueues",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Basic {{Token}}"
  },
  "data": {
    "lastrow": ""
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
C#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://{{instance}}.ucontactcloud.com/Integra/resources/queues/getqueues");
request.Headers.Add("Authorization", "Basic {{Token}}");
var collection = new List<KeyValuePair<string, string>>();
collection.Add(new("lastrow", ""));
var content = new FormUrlEncodedContent(collection);
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "lastrow=");
Request request = new Request.Builder()
  .url("https://{{instance}}.ucontactcloud.com/Integra/resources/queues/getqueues")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .addHeader("Authorization", "Basic {{Token}}")
  .build();
Response response = client.newCall(request).execute();
Python
import http.client

conn = http.client.HTTPSConnection("{{instance}}.ucontactcloud.com")
payload = 'lastrow='
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Basic {{Token}}'
}
conn.request("POST", "/Integra/resources/queues/getqueues", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))


HTTP Response

Responses in which an error occurred due to the sent data will generally be delivered with an HTTP code 200 and a '0' in the response body; therefore, caution should be taken when validating the HTTP Code Response.

The successful response will be a JSON corresponding to an array of objects, where each object represents a campaign.

Respuesta exitosa

[
	{
        "name": "DEMO007->",
        "musiconhold": "default",
        "announce": "",
        "context": "",
        "timeout": 15,
        "monitorType": "MixMonitor",
        "monitorFormat": "gsm",
        "announceFrequency": 0,
        "announceRoundSeconds": 0,
        "announceHoldtime": "no",
        "announcePosition": "no",
        "retry": 3,
        "wrapuptime": 0,
        "maxlen": 100,
        "servicelevel": 15,
        "strategy": "linear",
        "joinempty": "yes",
        "leavewhenempty": "no",
        "eventmemberstatus": false,
        "eventwhencalled": true,
        "reportholdtime": false,
        "memberdelay": 0,
        "weight": 0,
        "timeoutrestart": true,
        "ringinuse": false,
        "setinterfacevar": true,
        "periodicAnnounce": "",
        "periodicAnnounceFrequency": "0",
        "did": "18885751288",
        "direction": "outbound",
        "interactions": "",
        "email": "",
        "thresholds": "40-80-20-50-60-180-300-6-3-",
        "welcome": "&  &    &  &;&  &    &  &",
        "schedule": "sun-sat;00:00-23:59",
        "form": "Totality|true",
        "quality": "",
        "dialstring": "SIP/CLEVERSIP/9898",
        "voicemail": "",
        "queue_survey": 1,
        "queue_timeout": 600,
        "auto_answer": "FALSE",
        "show_dispositions": 1,
        "queue_breaks": "",
        "screen_recording": 0,
        "language": "en",
        "transferCampaigns": ""
    }
]

Respuesta de error

0