Get Call Logs

Get call logs within a timeframe

- NEW! - Interactive API docs, now live!

Visit api-docs.plumvoice.com to read Plum API documentation, build and test requests in our interactive API sandbox, review the responses, and share it all with your team.

Get Call Logs

GET https://fuse.plumvoice.com/api/calls/{start}/{end}

Fetch information about completed outbound calls

Path Parameters

NameTypeDescription

start

string

UNIX timestamp

end

string

UNIX timestamp

Query Parameters

NameTypeDescription

number

string

The phone number of the deployment for which to retrieve call log data.

limit

integer

The maximum number of records per page to return.

offset

integer

Indicates the record number that begins the list of returned records.

{
  "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
}

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);

Last updated