# Call Disposition

When a call is ended in uContact, a disposition can be added to identify how the call concluded, allowing for reporting or creating actions based on the disposition.

<p class="callout info">All data enclosed in "{{ }}" are values that will be replaced with the client's own data and/or the corresponding instance.</p>

---

### HTTP Request

<table border="1" id="bkmrk-opcion-http-valor-re" style="border-collapse: collapse; width: 100%; height: 148.984px;"><tbody><tr style="height: 29.7969px;"><td class="align-center" style="width: 20.3956%; height: 29.7969px;">**Method**</td><td class="align-center" style="width: 79.6044%; height: 29.7969px;">**Resource**</td></tr><tr style="height: 29.7969px;"><td style="width: 20.3956%; height: 29.7969px;">POST</td><td style="width: 79.6044%; height: 29.7969px;">Integra/resources/api/DispositionCall</td></tr></tbody></table>

#### Request Header

<table border="1" id="bkmrk-opcion-valor-content" style="border-collapse: collapse; width: 100%; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-center" style="width: 20.7664%; height: 29.7969px;">**Key**</td><td class="align-center" style="width: 79.2336%; height: 29.7969px;">**Value**</td></tr><tr style="height: 29.7969px;"><td style="width: 20.7664%; height: 29.7969px;">Content-Type</td><td style="width: 79.2336%; height: 29.7969px;">application/x-www-form-urlencoded</td></tr><tr style="height: 29.7969px;"><td style="width: 20.7664%; height: 29.7969px;">Authorization</td><td style="width: 79.2336%; height: 29.7969px;">Basic {{Token}}</td></tr></tbody></table>

#### Request Body

<table border="1" class="align-center" id="bkmrk-parametro-tipo-descr" style="border-collapse: collapse; width: 100%; height: 503.4px;"><tbody><tr style="height: 29.8px;"><td style="width: 20.5192%; height: 29.8px;">**Parameter**</td><td style="width: 17.4289%; height: 29.8px;">**Type**</td><td style="width: 13.8443%; height: 29.8px;">**Required**</td><td style="width: 48.2077%; height: 29.8px;">**Description**</td></tr><tr style="height: 35.4px;"><td data-colwidth="210" style="width: 20.5192%; height: 35.4px;">campaign

</td><td data-colwidth="549" style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Name of the campaign</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">agent

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Agent's username</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">callerid

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Phone number of the contact</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">guid

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Unique call identifier</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">l1

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Level 1 disposition</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">l2

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Level 2 disposition (Can be empty)</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">l3

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Level 3 disposition (Can be empty)</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">d1

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Extra data to save (Can be empty)</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">d2

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Extra data to save (Can be empty)</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">comment

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Comment for the disposition (Can be empty)</td></tr><tr style="height: 48.8px;"><td style="width: 20.5192%; height: 48.8px;">schedule

</td><td style="width: 17.4289%; height: 48.8px;">Text</td><td style="width: 13.8443%; height: 48.8px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 48.8px;">Date and time to schedule the call in the format AAAA-MM-DD HH:MI:SS (Can be empty)</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">camptoreschedule

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Dialer to schedule the call (Can be empty)</td></tr><tr style="height: 35.4px;"><td style="width: 20.5192%; height: 35.4px;">tag

</td><td style="width: 17.4289%; height: 35.4px;">Text</td><td style="width: 13.8443%; height: 35.4px;">Yes</td><td class="align-left" style="width: 48.2077%; height: 35.4px;">Text for disposition tag or empty (Can be empty)</td></tr></tbody></table>

---

### Code Examples

<p class="callout info">You can copy the following code examples and replace the "{{variable}}" with the correct data.</p>

##### HTTP

```VBScript
POST /Integra/resources/api/DispositionCall HTTP/1.1
Host: {{Instancia}}.ucontactcloud.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic {{Token}}
Content-Length: 173

campaign=campana-%3E&agent=Vcisneros&callerid=1234567890&guid=f9b7ada3-a4e5-4795-834d-aa1c1a37ee57&l1=Tipificacion1&l2=&l3=&d2=&d2=&comment=&schedule=&camptoreschedule=&tag=
```

##### cURL

```VBScript
curl --location --request POST 'https://{{Instancia}}.ucontactcloud.com/Integra/resources/api/DispositionCall' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic {{Token}}' \
--data-urlencode 'campaign=campana->' \
--data-urlencode 'agent=Vcisneros' \
--data-urlencode 'callerid=1234567890' \
--data-urlencode 'guid=f9b7ada3-a4e5-4795-834d-aa1c1a37ee57' \
--data-urlencode 'l1=Tipificacion1' \
--data-urlencode 'l2=' \
--data-urlencode 'l3=' \
--data-urlencode 'd2=' \
--data-urlencode 'd2=' \
--data-urlencode 'comment=' \
--data-urlencode 'schedule=' \
--data-urlencode 'camptoreschedule=' \
--data-urlencode 'tag='
```

##### JavaScript

```JavaScript
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", "Basic {{Token}}");

var urlencoded = new URLSearchParams();
urlencoded.append("campaign", "campana->");
urlencoded.append("agent", "Vcisneros");
urlencoded.append("callerid", "1234567890");
urlencoded.append("guid", "f9b7ada3-a4e5-4795-834d-aa1c1a37ee57");
urlencoded.append("l1", "Tipificacion1");
urlencoded.append("l2", "");
urlencoded.append("l3", "");
urlencoded.append("d2", "");
urlencoded.append("d2", "");
urlencoded.append("comment", "");
urlencoded.append("schedule", "");
urlencoded.append("camptoreschedule", "");
urlencoded.append("tag", "");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("https://{{Instancia}}.ucontactcloud.com/Integra/resources/api/DispositionCall", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

##### JQuery

```JavaScript
var settings = {
  "url": "https://{{Instancia}}.ucontactcloud.com/Integra/resources/api/DispositionCall",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Basic {{Token}}"
  },
  "data": {
    "campaign": "campana->",
    "agent": "Vcisneros",
    "callerid": "1234567890",
    "guid": "f9b7ada3-a4e5-4795-834d-aa1c1a37ee57",
    "l1": "Tipificacion1",
    "l2": "",
    "l3": "",
    "d2": "",
    "d2": "",
    "comment": "",
    "schedule": "",
    "camptoreschedule": "",
    "tag": ""
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

##### C#

```C#
var client = new RestClient("https://{{Instancia}}.ucontactcloud.com/Integra/resources/api/DispositionCall");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeader("Authorization", "Basic {{Token}}");
request.AddParameter("campaign", "campana->");
request.AddParameter("agent", "Vcisneros");
request.AddParameter("callerid", "1234567890");
request.AddParameter("guid", "f9b7ada3-a4e5-4795-834d-aa1c1a37ee57");
request.AddParameter("l1", "Tipificacion1");
request.AddParameter("l2", "");
request.AddParameter("l3", "");
request.AddParameter("d2", "");
request.AddParameter("d2", "");
request.AddParameter("comment", "");
request.AddParameter("schedule", "");
request.AddParameter("camptoreschedule", "");
request.AddParameter("tag", "");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

##### Java

```Java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "campaign=campana->&agent=Vcisneros&callerid=1234567890&guid=f9b7ada3-a4e5-4795-834d-aa1c1a37ee57&l1=Tipificacion1&l2=&l3=&d2=&d2=&comment=&schedule=&camptoreschedule=&tag=");
Request request = new Request.Builder()
  .url("https://{{Instancia}}.ucontactcloud.com/Integra/resources/api/DispositionCall")
  .method("POST", body)
  .addHeader("Content-Type", "application/x-www-form-urlencoded")
  .addHeader("Authorization", "Basic {{Token}}")
  .build();
Response response = client.newCall(request).execute();
```

##### Python

```Python
import http.client

conn = http.client.HTTPSConnection("{{Instancia}}.ucontactcloud.com")
payload = 'campaign=campana-%3E&agent=Vcisneros&callerid=1234567890&guid=f9b7ada3-a4e5-4795-834d-aa1c1a37ee57&l1=Tipificacion1&l2=&l3=&d2=&d2=&comment=&schedule=&camptoreschedule=&tag='
headers = {
  'Content-Type': 'application/x-www-form-urlencoded',
  'Authorization': 'Basic {{Token}}'
}
conn.request("POST", "/Integra/resources/api/DispositionCall", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

---

### HTTP Response

#### Successful Response

```JSON
"OK"
```

#### Error Response

```JSON
"0"
```