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://zt.plivo.com/v1/Account/{auth_id}/Call/

    Arguments

    initiation_time string

    The timestamp when the call was initiated.

    Timezone: Local timezone as updated in the Plivo console

    Format: yyyy-MM-dd HH:mm:ss

    call_direction string

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

    Allowed values: </mark>inbound</mark>, outbound.

    from_number string

    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 string

    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.

    trunk_id string

    The ID of a trunk, if you want to retrieve only calls made from a specific trunk.

    bill_duration optional

    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 optional

    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]

    limit optional

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

    Defaults to 20.

    offset optional

    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.

    Response

    HTTP Status Code: 200

    {
      "api_id": "91d15144-e8c1-45fa-8226-061702f297fe",
      "meta": {
        "limit": 20,
        "next": true,
        "offset": 0,
        "previous": false,
        "total_count": 4
      },
      "objects": [
        {
          "call_uuid": "6c3a8b60-26e0-4842-9387-2350de79f16b",
          "bill_duration": 7200,
          "trunk_id": "126041xxxx",
          "end_time": "2022-05-26 13:32:37",
          "from_number": 552135006716,
          "to_number": 12604109832,
          "call_direction": "outbound",
          "duration": 28,
          "hangup_cause": "normal_hangup",
          "hangup_initiator": "customer",
          "rate": 0.318,
          "total_amount": 0.318,
          "initiation_time": "2022-05-26 13:32:06",
          "answer_time": "2022-05-26 13:32:09",
          "trunk_domain": "31723558297410168.zt.plivops.com",
          "region": "us-east-1",
          "from_country": "BR",
          "to_country": "US",
          "transport_protocol": "udp",
          "srtp": false,
          "hangup_code": 3010,
          "secure_trunking": true,
          "secure_trunking_rate": 0,
          "stir_verification": "Not Verified"
        }
      ]
    }
    

    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://zt.plivo.com/v1/Account/{auth_id}/Call/
    
    1