Latest Legacy

Get details of all ongoing calls

This method lets you retrieve details of all ongoing calls made from an account.

API Endpoint

GET https://api.plivo.com/v1/Account/{auth_id}/Call/?status=live

Arguments

call_direction optional

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

Allowed values: inbound, outbound

from_number optional

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 optional

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

Returns

Returns the call UUIDs of all ongoing calls.

Response

HTTP Status Code: 200

{
  "api_id": "c9527676-5839-11e1-86da-6ff39efcb949",
  "calls": [
"eac94337-b1cd-499b-82d1-b39bca50dc31",
"0a70a7fb-168e-4944-a846-4f3f4d2f96f1"
  ]
}

Example Request

1
2
3
4
5
6
import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')

response = client.live_calls.list_ids(from_number=123456789, to_number=123456789, call_direction=Inbound)
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# Example for Call List
#
require 'rubygems'
require 'plivo'

include Plivo
include Plivo::Exceptions

api = RestClient.new("<auth_id>","<auth_token>")

begin
  response = api.calls.list_live(
	from_number: 123456789,
	to_number: 123456789,
	call_direction: outbound
)
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Example for LiveCall list

(function main() {
   'use strict';

  // If auth id and auth token are not specified, Plivo will fetch them from the environment variables.
   var client = new plivo.Client("<auth_id>", "<auth_token>")
   client.calls.listLiveCalls(
       {
           to_number : "9880156119",
           from_number : "9880156119",
           call_direction : "outbound"
       }
   ).then(function (response) {
       console.log(response);
   }, function (err) {
       console.error(err);
   });
})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Example for Call list
 */
 require 'vendor/autoload.php';
 use Plivo\RestClient;
 use Plivo\Exceptions\PlivoRestException;
 $client = new RestClient("<auth_id>","<auth_token>");
 try {
     $response = $client->calls->listLive(
 [
 	to_number => 123456789,
 	from_number => 123456789,
 	call_direction => inbound
 ]
 );
     print_r($response);
 }
 catch (PlivoRestException $ex) {
     print_r($ex);
 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.plivo.api.samples.livecall;

import java.io.IOException;
import com.plivo.api.Plivo;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.call.LiveCall;
import com.plivo.api.models.call.LiveCallListResponse;

class LiveCallList {
    public static void main(String [] args) {
        Plivo.init("<auth_id>","<auth_token>");
        try {
            LiveCallListResponse response = LiveCall.listGetter().callDirection(CallDirection.INBOUND).fromNumber("123456789").toNumber("123456789").get();


            System.out.println(response);
        } catch (PlivoRestException | IOException e) {
            e.printStackTrace();
        }
    }
}
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
/**
 * Example for Live Call List
 */
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;

namespace PlivoExamples
{
   internal class Program
   {
       public static void Main(string[] args)
       {
           var api = new PlivoApi("<auth_id>","<auth_token>");
           try
           {
               var response = api.Call.ListLive(callDirection: Inbound, fromNumber: 123456789, toNumber: 123456789);
Console.WriteLine(response);
           }
           catch (PlivoRestException e)
           {
               Console.WriteLine("Exception: " + e.Message);
           }
       }
   }
}
1
2
curl -i --user AUTH_ID:AUTH_TOKEN \
    https://api.plivo.com/v1/Account/{auth_id}/Call/?status=live
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Example for LiveCall list
package main

import (
	"fmt"

	"github.com/plivo/plivo-go/v7"
)

func main() {
	client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	response, err := client.LiveCalls.IDList()
	if err != nil {
		fmt.Print("Error", err.Error())
		return
	}
	fmt.Printf("Response: %#v\n", response)
}