Get Calls
curl --request GET \
--url https://api.example.com/v1/Accounts/{account_sid}/Callsimport requests
url = "https://api.example.com/v1/Accounts/{account_sid}/Calls"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/Accounts/{account_sid}/Calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/Accounts/{account_sid}/Calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/Accounts/{account_sid}/Calls"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/Accounts/{account_sid}/Calls")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/Accounts/{account_sid}/Calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "a173fe94-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "a4941f23-66b8-4b52-b495-94192adee7ec",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 5,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"application_sid": "9984fdc5-89ec-4ffe-9cee-880255a46253",
"call_id": "7ed07f1e-3be0-123a-28b2-0efdfb356c0d",
"call_sid": "6b4931df-436a-4bfe-864e-3513d2917c02",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 16,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "6f7c2d1c-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "65d1cefe-c21a-4f03-92c0-947d6a17fe01",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 5,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "13f2f4b9-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "8f0eb6f4-85d9-40c7-84a8-a7a8228f9816",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 0,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
}
]v1
Get Calls
Retrieve a list of calls for the account that are in progress or recently ended.
Note: calls that have ended more than ten minutes ago will not be returned.
GET
/
v1
/
Accounts
/
{account_sid}
/
Calls
Get Calls
curl --request GET \
--url https://api.example.com/v1/Accounts/{account_sid}/Callsimport requests
url = "https://api.example.com/v1/Accounts/{account_sid}/Calls"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/Accounts/{account_sid}/Calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/Accounts/{account_sid}/Calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/Accounts/{account_sid}/Calls"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/Accounts/{account_sid}/Calls")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/Accounts/{account_sid}/Calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "a173fe94-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "a4941f23-66b8-4b52-b495-94192adee7ec",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 5,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"application_sid": "9984fdc5-89ec-4ffe-9cee-880255a46253",
"call_id": "7ed07f1e-3be0-123a-28b2-0efdfb356c0d",
"call_sid": "6b4931df-436a-4bfe-864e-3513d2917c02",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 16,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "6f7c2d1c-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "65d1cefe-c21a-4f03-92c0-947d6a17fe01",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 5,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "13f2f4b9-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "8f0eb6f4-85d9-40c7-84a8-a7a8228f9816",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 0,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
}
]Path Parameters
Example:
"5f8e8f60-4771-44cb-92a6-94ea66df0450"
Response
200 - application/json
Get Calls
Example:
"5f8e8f60-4771-44cb-92a6-94ea66df0450"
Example:
"9984fdc5-89ec-4ffe-9cee-880255a46253"
Example:
"a173fe94-3be1-123a-28b2-0efdfb356c0d"
Example:
"a4941f23-66b8-4b52-b495-94192adee7ec"
Example:
"completed"
Example:
""
Example:
"outbound"
Example:
5
Example:
"15083728299"
Example:
"http://172.31.32.144:3000"
Example:
200
Example:
"15083084809"
Example:
[
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "a173fe94-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "a4941f23-66b8-4b52-b495-94192adee7ec",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 5,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"application_sid": "9984fdc5-89ec-4ffe-9cee-880255a46253",
"call_id": "7ed07f1e-3be0-123a-28b2-0efdfb356c0d",
"call_sid": "6b4931df-436a-4bfe-864e-3513d2917c02",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 16,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "6f7c2d1c-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "65d1cefe-c21a-4f03-92c0-947d6a17fe01",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 5,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
},
{
"account_sid": "5f8e8f60-4771-44cb-92a6-94ea66df0450",
"call_id": "13f2f4b9-3be1-123a-28b2-0efdfb356c0d",
"call_sid": "8f0eb6f4-85d9-40c7-84a8-a7a8228f9816",
"call_status": "completed",
"caller_name": "",
"direction": "outbound",
"duration": 0,
"from": "15083728299",
"service_url": "http://172.31.32.144:3000",
"sip_status": 200,
"to": "15083084809"
}
]
⌘I

