> For the complete documentation index, see [llms.txt](https://docs.plumvoice.com/insight/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plumvoice.com/insight/api/checking-status-for-an-outbound-call.md).

# Checking Status for an Outbound Call

## Check Status for an Outbound Call

<mark style="color:blue;">`GET`</mark> `https://insight.plumvoice.com/api/outbound/{call_id}`

#### Path Parameters

| Name     | Type   | Description    |
| -------- | ------ | -------------- |
| call\_id | string | Call ID number |

#### Headers

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| content-type | string | application/x-www-form-urlencoded |

{% tabs %}
{% tab title="200 Note: The sample call was queued and then canceled." %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{
  'success':true,
  'call_details': {
  'status':'canceled',
  'attempts':'1',
  'max_attempts':'1',
  'queued_timestamp':'1429214458',
  'last_attempt_timestamp':'1429214474',
  'start_timestamp':'1429214400',
  'end_timestamp':'1429218000',
  'reattempt_wait':'0',
  'events': [
    {
      'event':'queued',
      'timestamp':'1429214465'
    },
    {
       'event':'canceled',
       'timestamp':'1429214474'
    }
    ]
  }
}
```

{% endtab %}

{% tab title="XML" %}

```markup
<result>
  <success>true</success>
  <call_details>
    <status>canceled</status>
    <attempts>1</attempts>
    <max_attempts>1</max_attempts>
    <queued_timestamp>1429214458</queued_timestamp>
    <last_attempt_timestamp>1429214474</last_attempt_timestamp>
    <start_timestamp>1429214400</start_timestamp>
    <end_timestamp>1429218000</end_timestamp>
    <reattempt_wait>0</reattempt_wait>
    <events>
      <item><event>queued</event><timestamp>1429214465</timestamp></item>
      <item><event>canceled</event><timestamp>1429214474</timestamp></item>
    </events>
  </call_details>
</result>
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="404 Example: no outbound id was found" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{'success':false,'error':'An outbound call was not found by that id.'}
```

{% endtab %}

{% tab title="XML" %}

```markup
<result>
  <success>false</success>
  <error>An outbound call was not found by that id.</error>
</result>
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

### **Possible Response Codes**

* **200**: success
* **401**: authentication headers invalid or the account is inactive
* **403**: the account attempting to view the outbound call details does not have appropriate permissions
* **404**: outbound call was not found
* **405**: invalid HTTP method supplied (only GET allowed)
* **415**: unsupported media type (Content-Type value in request)
* **500**: database error

The return structure will contain the following item(s):

| Name          | Data Type | Always Present | Description                                                                                    |
| ------------- | --------- | -------------- | ---------------------------------------------------------------------------------------------- |
| success       | boolean   | yes            | Indicates the outcome of the request                                                           |
| error         | string    | no             | If the success value is false this provides a message indicating what error(s) occurred        |
| call\_details | mixed     | no             | All call data for the outbound call. See the table below for all of the data required therein. |

### Definitions: Call Details Data

| Name                     | Data Type | Value                                                                                                                                      |
| ------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| status                   | string    | Current status for the outbound call.                                                                                                      |
| attempts                 | int       | Total number of attempts made                                                                                                              |
| max\_attempts            | int       | Maximum number of attempts to be made                                                                                                      |
| queued\_timestamp        | int       | Unix timestamp of when the call was queued                                                                                                 |
| last\_attempt\_timestamp | int       | Unix timestamp of when the last event for the outbound call occurred                                                                       |
| start\_Timestamp         | int       | Unix timestamp of when the call was scheduled to start outbound call attempts                                                              |
| end\_timestamp           | int       | Unix timestamp of when the outbound call was scheduled to stop outbound attempts                                                           |
| reattempt\_wait          | int       | Time, in seconds, to wait between retrying the outbound call after a failure                                                               |
| events                   | mixed     | Numerically indexed array of outbound call events, each row with the indices 'event' and 'timestamp' indicating the event and its duration |

### **Sample Code**

This sample PHP code makes a request to this method:

```php
<?php
$ch = curl_init();
$url = 'https://insight.plumvoice.com/api/outbound/{call_id}';
$username = 'you@yourdomain.com';
$password = 'you_developer_key';
curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-Type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);
```
