Latest

Retrieve details of all calls

This method lets you retrieve details of all completed calls. The maximum number of results that you can fetch with a single API call is 20.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/

Arguments

All the below arguments are optional

from_number

The number from which the calls were made. If you want to filter results by source number. You can filter the details by using the exact number or the prefix.

to_number

The destination number to which the calls were made, if you want to filter results by destination. You can filter the details by using the exact number or the prefix

call_direction

The direction of the call, if you want to filter results by call direction.

Allowed values: inbound, outbound

bill_duration

Filters calls by billed duration in seconds. The filter can be used in these five forms:

  • bill_duration: Input the exact value. For example, to retrieve calls that were exactly three minutes long, use bill_duration=180
  • bill_duration__gt: gt stands for greater than. To retrieve calls that were more than two hours long, use bill_duration__gt=7200
  • bill_duration__gte: gte stands for greater than or equal to. To retrieve calls that were two hours or more in duration, use bill_duration__gte=7200
  • bill_duration__lt: lt stands for less than. To retrieve calls that were less than seven minutes long, use bill_duration__lt=420
  • bill_duration__lte: lte stands for lesser than or equal to. To retrieve calls that were two hours or less in duration, use bill_duration__lte=7200
end_time

Filters calls by their completion time. The time format expected is YYYY-MM-DD HH:MM[:ss[.uuuuuu]]. The filter can be used in these five forms:

  • end_time: To get all calls that ended at 2021-03-21 11:47[:30], use end_time=2021-03-21 11:47[:30]
  • end_time__gt: gt stands for greater than. To get all calls that ended after 2021-03-21 11:47, use end_time__gt=2021-03-21 11:47
  • end_time__gte: gte stands for greater than or equal to. To get all calls that ended after or exactly at 2021-03-21 11:47[:30], use end_time__gte=2021-03-21 11:47[:30]
  • end_time__lt: lt stands for less than. To get all calls that ended before 2021-03-21 11:47, use end_time__lt=2021-03-21 11:47
  • end_time__lte: lte stands for less than or equal to. To get all calls that ended before or exactly at 2021-03-21 11:47[:30], use end_time__lte=2021-03-21 11:47[:30]
Note: Calls made only in the last 90-days can be retrieved via APIs.

You can combine these filters to get call detail records that were added during a particular time range.

If you don’t use the end_time filter when you search, Plivo uses a search window of the last 30 days from the current date. Alternatively, you can use end_time__[lt|lte] and end_time__[gt|gte] to search a range of times for CDRs of up to 90 days of search boundary. If the provided range exceeds the 90-day boundary, the API will return a 400 response code, signaling an error.


Timestamps need to be UTC timestamps.

hangup_cause_code

Retrieves calls that were hung up with a specific hangup cause code. Refer to our list of hangup causes and sources

hangup_source

Retrieves calls that were hung up by a specific hangup source. Refer to our list of hangup causes and sources

Allowed values: customer, carrier & zentrunk

limit

Limits the number of results retrieved. The maximum it can be set to is 20.

Defaults to 20.

offset

Denotes the number of value items by which the results should be offset. For example, if the results contains 1,000 values and limit is set to 10 and offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.

stir_verification

For outbound calls: Gives details about the attestation assigned to the call by Plivo

For inbound calls: Gives details about the attestation received on the inbound call to your Plivo phone number.

Allowed Values:

  • Verified means the call is from a verified caller who has authorized access to the customer’s caller ID, and hence should be treated with confidence. Verified is equivalent to attestation level A.
  • Not Verified means that, for this call, either the caller is not verified, or it’s uncertain whether they have access to the caller ID used, or both. Not Verified means the call received attestation level B or C.
  • Not Applicable means STIR/SHAKEN doesn’t apply to this call, as would be the case if a call is not addressed to a US number or if it’s a cloud call (WebRTC or SIP).
  • Read more about STIR/SHAKEN.

Returns

Returns the call objects that match the filters specified in the request.

Response

{
  "api_id": "a04ad809-3b78-4bbe-9baf-acfc7800b10f",
  "meta": {
    "limit": 20,
    "offset": 0,
    "total_count": 2,
    "previous": null,
    "next": null
  },

  "objects": [
    {
      "call_uuid": "90b6eb07-796c-4d86-a4fd-44ed11667ddb",
      "from_number": "+12025551111",
      "to_number": "+13128574907",
      "call_direction": "outbound",
      "call_duration": 4,
      "bill_duration": 60,
      "end_time": "2022-12-06 07:02:00",
      "hangup_cause_name": "normal_hangup",
      "hangup_source": "carrier",
      "total_rate": "0.03000",
      "total_amount": "0.00200",
       “billed_duration”: 60,
      "initiation_time": "2022-12-06 07:01:48",
      "answer_time": "2022-12-06 07:01:56",
      "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
      "from_country": "IN",
      "to_country": "IN",
      "transport_protocol": "udp",
      "srtp": false,
      "hangup_cause_code": 3000,
      "secure_trunking": false,
      "secure_trunking_rate": "0.00000",
      "stir_verification": "Verified",
      "attestation_indicator": "A"
    },
    {
      "call_uuid": "0b6eb07-796c-4d86-a4fd-44ed11667ddbe",
      "from_number": "+912235328936",
      "to_number": "+919943720205",
      "call_direction": "outbound",
      "trunk_id": "0b6eb07-796c-4d86-a4fd-44ed11667ddb",
      "call_duration": 4,
      "bill_duration": 4,
      "end_time": "2022-12-06 07:02:00",
      "hangup_cause_name": "normal_hangup",
      "hangup_source": "carrier",
      "total_rate": "0.03000",
      "total_amount": "0.00200",
       “billed_duration”: 60,
      "initiation_time": "2022-12-06 07:01:48",
      "answer_time": "2022-12-06 07:01:56",
      "trunk_domain": "93667062664669661.ap-south-1.zt.plivo.com",
      "from_country": "IN",
      "to_country": "IN",
      "transport_protocol": "udp",
      "srtp": false,
      "hangup_cause_code": 3000,
      "secure_trunking": false,
      "secure_trunking_rate": "0.00000",
      "stir_verification": "Not Applicable",
      "attestation_indicator": "null"
    }
  ]
}

Example Request

1
1
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;
use Plivo\Exceptions\PlivoRestException;
$client = new RestClient("<auth_id>", "<auth_token>");
try {
      $response = $client->ZentrunkCalls->list(
        [
        	'limit' => 5,
		    'offset' => 2
        ]
      );
    print_r($response);
    }
catch (PlivoRestException $ex)
 {
   print_r($ex);
 }
?>
1
1
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Zentrunk/Call/
1