Example Responses
Responses are sent in JSON or XML forward, depending on your request type
Successful Responses
A successful response will give you all information regarding the call
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"
}
}
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>
Unsuccessful Responses
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.
<?xml version="1.0"?>
<CallResponse>
<status>error</status>
<error>user inactive</error>
</CallResponse>
Last updated