List All Calls
Use this endpoint for the Calls method to list all of the calls that are associated with your account. This will be returned as a list of calls.
Parameters
Parameter | Description |
---|---|
EndTime Optional | Returns calls that ended on the specified date. |
From Optional | Returns calls that are from a specified number. |
ParentCallSid Optional | Returns calls that created the leg of the call. |
StartTime Optional | Returns calls that started on the specified date. You can also append < or > to return a range of calls. For example, use StartTime< to return calls started on or before midnight of the date, or StartTime> to return calls started on or after midnight of the date. |
Status Optional | Returns calls with the specified status. |
To Optional | Returns calls that were made to the specified number. |
Request
- cURL
- Node.js
- C#
- Python
- Ruby
curl https://example.signalwire.com/api/laml/2010-04-01/Accounts/{AccountSid}/Calls.json \
-X GET \
-u "YourProjectID:YourAuthToken"
const { RestClient } = require('@signalwire/compatibility-api')
const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
client.calls.each(calls => console.log(calls.sid));
using System;
using System.Collections.Generic;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program
{
static void Main(string[] args)
{
TwilioClient.Init("YourProjectID", "YourAuthToken", new Dictionary<string, object> { ["signalwireSpaceUrl"] = "{SPACE}.signalwire.com" });
var calls = CallResource.Read();
foreach(var record in calls)
{
Console.WriteLine(record.Sid);
}
}
}
from signalwire.rest import Client as signalwire_client
client = signalwire_client("YourProjectID", "YourAuthToken", signalwire_space_url = 'example.signalwire.com')
calls = client.calls.list()
for record in calls:
print(record.sid)
require 'signalwire/sdk'
@client = Signalwire::REST::Client.new 'YourProjectID', 'YourAuthToken', signalwire_space_url: "example.signalwire.com"
calls = @client.calls.list
calls.each do |record|
puts record.sid
end
Responses
200 OK
{
"calls": [
{
"account_sid": "b3877c40-da60-4998-90ad-b792e98472af",
"annotation": null,
"answered_by": null,
"api_version": "2010-04-01",
"caller_name": null,
"date_created": "Wed, 19 Sept 2018 20:00:00 +0000",
"date_updated": "Thur, 20 Sept 2018 10:00:00 +0000",
"direction": "inbound",
"duration": "20",
"end_time": "Fri, 21 Sept 2018 10:00:00 +0000",
"forwarded_from": "+13102259067",
"from": "+13103384645",
"from_formatted": "(310) 338-4645",
"parent_call_sid": "b3877c40-da60-4998-90ad-b792e98472pa",
"phone_number_sid": "b3877c40-da60-4998-90ad-b792e98472ph",
"price": -0.00500,
"price_unit": "USD",
"sid": "b3877c40-da60-4998-90ad-b792e98472pa",
"start_time": "Wed, 19 Sept 2018 20:00:01 +0000",
"status": "completed",
"subresource_uris": {
"notifications": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Notifications.json",
"recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Recordings.json"
},
"to": "+13105678901",
"to_formatted": "(310) 567-8901",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa.json"
}
],
"end": 0,
"first_page_uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls.json?PageSize=1&Page=0",
"next_page_uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls.json?PageSize=1&Page=1",
"page": 0,
"page_size": 1,
"previous_page_uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls.json?PageSize=1&Page=0",
"start": 0,
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls.json?PageSize=1&Page=0",
"account_sid": "b3877c40-da60-4998-90ad-b792e98472af"
}