📞
API Docs
  • Welcome
  • NUMBERS / ORDERING
    • List Areas
    • List Numbers
    • Order Numbers - No Cart
    • Delete Numbers
    • Change Call Forward
    • Vanity Tollfree - Search
    • Vanity Toll Free - Order
  • Shopping Cart Ordering
    • Add Number to Cart
    • List Numbers in Cart
    • Delete Number from Cart
    • Complete Order Cart
  • MY INVENTORY
    • List My Nmbers
    • List Call Flows
    • Change CallFlow
    • CDR Records
  • SMS/MMS
    • Send SMS
    • Send MMS
    • Receive SMS/MMS
    • Receive Delivery Receipts
  • Campaigns
    • Submit TollFree Campaign
  • CALL APIS
    • Calls
    • Set Incoming URL
    • Incoming Calls
    • Listing Calls
    • Making Calls
      • Example Code
        • Outbound to Tel#
        • Outbound to SIP Device
        • Example Responses
    • Modifying Live Calls
      • Examples
    • Recordings
      • Get List of Recordings
      • Delete a Recording
  • CALL API MARKUP
    • API Call Markup Language
      • Say
      • Dial
        • Number
        • Client
        • SIP
      • Play
      • Gather
      • Record
      • Hangup
      • Pause
      • Reject
      • Redirect
  • LOOKUPS
    • Carrier and CNAM
  • Number Portability
    • Validate Portability
    • Lookup Port Request
    • Submit Port Request
  • FAXING
    • Create Outbound Fax
    • Lookup Outbound Fax Status
    • List Faxes
    • Download File
  • registered agent
    • List Companies
    • List Registered Agents
    • List Documents
    • Download Document
    • Create Company
    • Delete Company
    • Create Registered Agent
    • Modify Registered Agent
Powered by GitBook
On this page
  • Successful Responses
  • Unsuccessful Responses
  1. CALL APIS
  2. Making Calls
  3. Example Code

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>

PreviousOutbound to SIP DeviceNextModifying Live Calls

Last updated 8 months ago