Get Call Logs

Get call logs within a timeframe

get
Get Call Logs

https://fuse.plumvoice.com/api/calls/{start}/{end}?number=6177123000&limit=1000&offset=0
Fetch information about completed outbound calls
Request
Response
Request
Path Parameters
start
required
string
UNIX timestamp
end
required
string
UNIX timestamp
Query Parameters
number
optional
string
The phone number of the deployment for which to retrieve call log data.
limit
optional
integer
The maximum number of records per page to return.
offset
optional
integer
Indicates the record number that begins the list of returned records.
Response
200: OK
JSON
XML
JSON
{
"calls":[
{
"dest":"8009957586",
"src":"2125551234",
"start":1529552691,
"end":1529552697,
"session_id":"300060;001;1529552581",
"type":"inbound",
"log":true
},
{
"dest":"8009957586",
"src":"6175551234",
"start":1529550008,
"end":1529550036,
"session_id":"400050;001;1529549919",
"type":"inbound",
"log":true
}
],
"total_calls":2
}
XML
<?xml version="1.0"?>
<result>
<calls>
<item>
<dest>8669077078</dest>
<src>3472550011</src>
<start>1529552691</start>
<end>1529552697</end>
<session_id>300060;001;1529552581</session_id>
<type>inbound</type>
<log>true</log>
</item>
<item>
<dest>8338605949</dest>
<src>3472550011</src>
<start>1529550008</start>
<end>1529550036</end>
<session_id>400050;001;1529549919</session_id>
<type>inbound</type>
<log>true</log>
</item>
</calls>
<total_calls>2</total_calls>
</result>

Possible Response Codes

  • 200: success

  • 401: authentication headers invalid or the account is inactive

  • 405: invalid HTTP method supplied (only GET allowed)

  • 500: database error

The return structure contains the following item(s):

Name

Data Type

Always Present

Description

error

string

no

Message indicating what went wrong with the request when the HTTP code is not 200.

calls

mixed

no

Array of calls that match the query parameters. Supplied when the HTTP code is 200. See the table below for more information on the data in this item.

total_calls

int

no

The total number of calls for the given start, end and number parameters. Supplied when the HTTP code is 200. See the table below for more information on the data in this item.

Definitions: Single Call Entry

Name

Data Type

Value

dest

string

Destination phone number of the call.

src

string

Source phone number of the call.

Outbound calls will be shown as "Outbound"

start

int

Start UNIX timestamp for this call.

end

int

End Unix timestamp for this call.

session_id

string

Unique ID for this call, also used to fetch individual call logs.

type

string

Type for this call (inbound, outbound or transfer).

log

bool

Flag indicating if a call log is available for this call.

Sample Code

This sample PHP code makes a request to this method:

<?php
// account and application settings
$email = '<your_email_address>';
$developer_key = '<your_developer_key>';
$start = strtotime('midnight -5 days);
$end = strtotime('midnight');
$number = '6177123000';
$limit = 10000;
$offset = 0;
// build the URL
$url = 'https://fuse.plumvoice.com/api/calls/'.$start.'/'.$end.'?number='.$number.'&limit='.$limit.'&offset='.$offset;
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $email.':'.$developer_key);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);