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 example

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}",
    "created": "Fri, 21 Apr 2017 13:01:25 +0000",
    "account_sid": "{accountSID}",
    "from": "358942417543",
    "to": "79031550066",
    "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"
}

Response parameters

Parameter

Description

call_sid

Call identifier.

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.

Description

Call identifier.

Description

Call creation date.

Description

Account identifier.

Description

Recipient’s phone number.

Description

Caller’s phone number.

Description

Call direction.

Either inbound or outbound.

Description

Call status.

One of the following:

queued, initiated, ringing, answered,

completed, no_answer, busy,

rejected, failed, modified.

Description

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

Description

Method used to make a request.

Description

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

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

Description

Updated date.

Description

Call begin date and time.

Description

Call end date and time.

Description

Duration of the call in seconds.

Description

Cost of the call in USD cents.

Description

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..

 

Call Status

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

Parameter

Description

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.

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

Description

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

Description

The call has been started

Description

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

Description

The call was answered and is currently in progress.

Description

The call was answered and has ended normally.

Description

The call ended without being answered.

Description

The caller received a busy signal.

Description

The call was canceled while queued or ringing.

Description

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

Description

The call was modified by API function Modify live call.