# Example Responses

## Successful Responses

A successful response will give you all information regarding the call

{% tabs %}
{% tab title="JSON" %}
JSON is the preferred way to receive requests

```
{
  "sid": "ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd",
  "InstanceId": "ID308221e44jfd49b7a7231df9773763d8",
  "date_created": "Thu, 23 Apr 2020 03:47:38 +0000",
  "date_updated": "Thu, 23 Apr 2020 03:47:38 +0000",
  "account_sid": "AC597c33she92a3aed4f54j58ceb22w6qq",
  "to": "13035551212",
  "from": "8142892271",
  "status": "QUEUED",
  "start_time": "2020-04-23T03:47:38.000Z",
  "duration": 0,
  "price_unit": "USD",
  "direction": "outbound-api",
  "api_version": "2012-04-24",
  "caller_name": "8142892271",
  "uri": "/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd.json",
  "subresource_uris": {
    "notifications": "/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd/Notifications.json",
    "recordings": "/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA5439261cd19a45b5b7f925c8f9bd78bd/Recordings.json"
  }
}
```

{% endtab %}

{% tab title="XML" %}
XML is offered for backward compatibility for other service providers

```
<CallResponse>
  <Call>
    <Sid>ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e</Sid>
    <InstanceId>ID308221e44jfd49b7a7231df9773763d8</InstanceId>
    <DateCreated>Thu, 23 Apr 2020 03:43:08 +0000</DateCreated>
    <DateUpdated>Thu, 23 Apr 2020 03:43:08 +0000</DateUpdated>
    <ParentCallSid/>
    <AccountSid>AC597c33she92a3aed4f54j58ceb22w6qq</AccountSid>
    <To>13035551212</To>
    <From>4843728023</From>
    <PhoneNumberSid/>
    <Status>QUEUED</Status>
    <StartTime>2020-04-23T03:43:08.000Z</StartTime>
    <EndTime/>
    <Duration>0</Duration>
    <Price>0.00</Price>
    <PriceUnit>USD</PriceUnit>
    <Direction>outbound-api</Direction>
    <AnsweredBy/>
    <ApiVersion>2012-04-24</ApiVersion>
    <ForwardedFrom/>
    <CallerName>4843728023</CallerName>
    <Uri>/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e</Uri>
    <SubresourceUris>
      <Notifications>/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e/Notifications</Notifications>
      <Recordings>/2012-04-24/Accounts/AC597c33she92a3aed4f54j58ceb22w6qq/Calls/ID308221e44jfd49b7a7231df9773763d8-CA8ccfe7efda354397a0504f47b883cd4e/Recordings</Recordings>
    </SubresourceUris>
    <Ring__duration/>
  </Call>
</CallResponse>
```

{% endtab %}
{% endtabs %}

## Unsuccessful Responses

{% tabs %}
{% tab title="JSON Response 1" %}
Error responses:

```
{"status":"error", "error":"user inactive"}
```

or

```
{"status":"error", "error":"Resource unavailable error}
```

\
Some responses will contain debug messages if the error is not recognized.
{% endtab %}

{% tab title="XML Response" %}

```
<?xml version="1.0"?>
<CallResponse>
<status>error</status>
<error>user inactive</error>
</CallResponse>

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.api19.com/call-apis/making-calls/example-code/example-responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
