Docs

Get details of specific call

https://api.apifonica.com/v2/accounts/{accountSID}/calls/{callSID}

Overview

To get information on a call by its identifier, make the GET request to /accounts/{accountSID}/calls/{callSID}.

When a call is initiated, a new instance of the calls resource is created with the following parameters being populated: call_sid, created, account_sid, to, from, number_sid, and direction. The value of the status parameter is set to queued. All other parameters have the null value.

The status changes during the progress of the call (See the Call Status section for more details)

When the call ends, the status changes to completed and the values of the started, ended, price and duration parameters are updated.
If voice_recording is false (See the Change Number Properties) then the parameter record_sid is null.

In case for any reason the call is not successful, the value of the status parameter is set to failed.

Request examples

The following example demonstrates getting information on the specified call.

curl –X GET https://api.apifonica.com/v2/accounts/{accountSID}/calls/{callSID} \
-u {accountSID}:{authToken}

Response example

{
  "call_sid": "{callSID}",
  "parent_call_sid": "{callSID}",
  "created": "Fri, 21 Apr 2017 13:01:25 +0000",
  "account_sid": "{accountSID}",
  "from": "358942417543",
  "to": "312031550066",
  "direction": "outbound",
  "status": "completed",
  "controller": "http://apifonica.com/voicexml/getxml?xml_variant=welcome_to_apifonica",
  "method": "POST",
  "timeout": 15,
  "updated": "Fri, 21 Apr 2017 13:02:02 +0000",
  "started": "Fri, 21 Apr 2017 13:01:37 +0000",
  "ended": "Fri, 21 Apr 2017 13:01:43 +0000",
  "duration": 18,
  "price": 0.0294
  "record_sid":"rec17cb9958-3878-4562-b6a7-f67a0adsfsdfd"
  "tag": "MyClient_1"
  "channel": "number"
}

Response parameters

ParameterDescription
call_sid

Call identifier.

parent_call_sid

Identifier of the parent call leg

created

Call creation date.

account_sid

Account identifier.

from

Caller’s phone number.

to

Recipient’s phone number.

direction

Call direction.

Either inbound or outbound.

status

Call status.

One of the following: queued, initiated, ringing, answered, completed, no_answer, busy, rejected, failed, modified

See the Call Status section for more details

controller

URL which used to make a request for an XML controller file.

method

Method used to make a request.

timeout

The number of seconds to wait for the answer of the 'to' number.

Important! The period starts when you send the request to API

updated

Updated date.

started
Call begin date and time.
ended

Call end date and time.

duration

Duration of the call in seconds.

price

Cost of the call in EURO cents.

record_sid

System identifier associated with the record file.

Notice: call status 'completed' does not indicate that the recording is ready for downloading. It will be ready after record_sid is available.

tag

Optional string field; can be used for custom filtering of the calls

channel

The call channel. The possible values are 'number' (for calling on local/mobile/SIP numbers), 'viber' (for calling on Viber).

Call status

Call events online statuses. Please note, that not of all these statuses can be catched by GET request

ParameterDescription
queued

The call is ready and waiting in line before going out.

initiated

The call has been started

ringing

The call is currently ringing to the number 'to'.

answered

The call was answered and is currently in progress.

completed

The call was answered and has ended normally.

no_answer

The call ended without being answered.

canceled

The call was canceled by the initiating party before getting answered by the callee.

busy

The caller received a busy signal.

rejected

The call was canceled while queued or ringing.

failed

The call could not be completed as dialed, most likely because the phone number was non-existent

modified

The call was modified by API function Modify live call