Get Details of a Single Call

    To get the details of a Single Call, make an HTTP GET request to the Call API by passing the Call UUID.

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

    Prerequisites

    1. Sign up for a trial account at plivo.com.
    2. Check out our server-side SDKs page and install the right helper based on the programming language you want to use.

    Implementation

    1. Sign in to your Plivo account.
    2. On the dashboard you can find your Auth ID and Auth Token. Copy those values and paste them into Auth ID and Auth Token variables.
    3. Add the unique call_uuid, which is sent to the answer_url once the call is placed. See Parameters sent to the answer url.

    Code

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    import plivo, plivoxml
    
    auth_id = "Your AUTH_ID"
    auth_token = "Your AUTH_TOKEN"
    
    p = plivo.RestAPI(auth_id, auth_token)
    
    params = {
        'call_uuid': '55309cee-821d-11e4-9a73-498d468c930b' # The ID of the call
    }
    
    response = p.get_cdr(params)
    print str(response)
            
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    
    require 'rubygems'
    require 'plivo'
    include Plivo
    
    AUTH_ID = "Your AUTH_ID"
    AUTH_TOKEN = "Your AUTH_TOKEN"
    
    p = RestAPI.new(AUTH_ID, AUTH_TOKEN)
    
    params = {
        'record_id' => '55309cee-821d-11e4-9a73-498d468c930b' # The ID of the call
    }
    
    response = p.get_cdr(params)
    print response
            
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    var plivo = require('plivo');
    var p = plivo.RestAPI({
        authId: 'Your AUTH_ID',
        authToken: 'Your AUTH_TOKEN'
    });
    
    var params = {
        'call_uuid': '55309cee-821d-11e4-9a73-498d468c930b' // The ID of the call
    };
    p.get_cdr(params, function (status, response) {
        console.log('Status: ', status);
        console.log('API Response:\n', response);
    });
            
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    <?php
        require 'vendor/autoload.php';
        use Plivo\RestAPI;
        $auth_id = "Your AUTH_ID";
        $auth_token = "Your AUTH_TOKEN";
        $p = new RestAPI($auth_id, $auth_token);
        $params = array(
                'record_id' => '55309cee-821d-11e4-9a73-498d468c930b' # The ID of the call
            );
        $response = $p->get_cdr($params);
        // Print the response
        print_r ($response);
    
    ?>
            
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    
    package com.plivo.test;
    
    import java.lang.reflect.Field;
    import java.lang.reflect.Modifier;
    import java.util.LinkedHashMap;
    
    import com.plivo.helper.api.client.*;
    import com.plivo.helper.api.response.call.CDR;
    import com.plivo.helper.exception.PlivoException;
    
    public class App {
        public static void main(String[] args) throws IllegalAccessException {
    
            String auth_id = "Your AUTH_ID";
            String auth_token = "Your AUTH_TOKEN";
    
            RestAPI api = new RestAPI(auth_id, auth_token, "v1");
    
            LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();
            parameters.put("record_id", "55309cee-821d-11e4-9a73-498d468c930b"); // The ID of the call
    
            try {
                CDR cdr = api.getCDR(parameters);
                System.out.println(cdr);
            } catch (PlivoException e) {
                System.out.println(e.getLocalizedMessage());
            }
        }
    }
            
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    using System;
    using System.Collections.Generic;
    using RestSharp;
    using Plivo.API;
    
    namespace get_details_single
    {
        class Program
        {
            static void Main(string[] args)
            {
                RestAPI plivo = new RestAPI("Your AUTH_ID", "Your AUTH_TOKEN");
    
                IRestResponse&lt;CDR&gt; resp = plivo.get_cdr(new Dictionary&lt;string, string&gt;()
                {
                    { "record_id", "55309cee-821d-11e4-9a73-498d468c930b" } // The ID of the call
                });
    
                Console.Write(resp.Content);
    
                Console.ReadLine();
            }
        }
    }
            
    
    1
    2
    3
    
    curl -i --user AUTH_ID:AUTH_TOKEN \
        https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/
            
    

    Sample Response

    (200,
      {
        u'bill_duration': 0,
        u'billed_duration': 0,
        u'total_amount': u'0.00000',
        u'parent_call_uuid': None,
        u'call_direction': u'outbound',
        u'call_duration': 0,
        u'to_number': u'2222222222',
        u'total_rate': u'0.00000',
        u'api_id': u'fba71e98-901b-11e4-a2d1-22000ac5040c',
        u'from_number': None,
        u'end_time': u'2014-12-12 20:39:02+04:00',
        u'call_uuid': u'55309cee-821d-11e4-9a73-498d468c930b',
        u'resource_uri': u'/v1/Account/XXXXXXXXXXXX/Call/55309cee-821d-11e4-9a73-498d468c930b/'
      }
    )
    

    Next Step

    Learn how to Get Details of Live Calls

    1. Make an Outbound Call
    2. Play a Text-to-speech Message
    3. Connect Call to a Second Person
    4. Greet Caller by Name
    5. Play MP3/WAV Audio to Caller
    6. Hangup Using API
    7. Receive Incoming Call
    8. Forward Incoming Call
    9. Record Using API
    10. Screen Incoming Call
    11. Reject incoming call
    12. Get Details of all Calls
    13. Get Details of a single Call
    14. Get Details of Live Calls
    15. Build an IVR Phone Menu
    16. Conference Call
    17. Call Forward
    18. SIP Endpoint (Direct-Dial)