Get Call Logs With Details

Get call logs with details 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.

Only for the last 5 days:

Detailed call logs are only available for calls made within the last 5 days.

Getting Call Logs With Details

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

Retrieve all call logs for the defined calls.

Path Parameters

NameTypeDescription

start

string

UNIX timestamp

end

string

UNIX timestamp

Query Parameters

NameTypeDescription

number

string

Filters the list of call logs for only calls to this phone number.

offset

integer

Number of call logs to skip before returning results. Default: 0

limit

integer

Maximum number of call logs to return. Default: 1000, Minimum: 1, Maximum: 10000

{
  "calls": [
    {
      "dest": "6177123001",
      "src": "6177123000",
      "start": "1575898386",
      "end": "1575898423",
      "session_id": "100035;000;1575898377",
      "detail": [
        {
          "event": {
            "line": "Executing application \"Welcome Application\" version \"1.0\"",
            "data": {
              "module_type": "start",
              "result_variable": "start"
            }
          },
          "class": "info",
          "timestamp": 1575898386
        },
        {
          "event": {
            "line": "Hello, welcome to the Plum Fuse Plus sample application.  This application will show off a few different modules.  Let's start with some simple math.",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598801",
              "language": "en-US",
              "module_type": "prompt",
              "result_variable": "welcome"
            }
          },
          "class": "prompt",
          "timestamp": 1575898386
        },
        {
          "event": {
            "line": "Please enter a number using your telephone keypad.  We will store this value as X.",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598811",
              "language": "en-US",
              "module_type": "number",
              "result_variable": "X"
            }
          },
          "class": "prompt",
          "timestamp": 1575898399
        },
        {
          "event": {
            "line": "User input: 6 (dtmf)",
            "data": {
              "module_type": "number",
              "result_variable": "X"
            }
          },
          "class": "event",
          "timestamp": 1575898405
        },
        {
          "event": {
            "line": "Please enter another number using your telephone keypad.  We will store this value as Y.",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598821",
              "language": "en-US",
              "module_type": "number",
              "result_variable": "Y"
            }
          },
          "class": "prompt",
          "timestamp": 1575898405
        },
        {
          "event": {
            "line": "User input: 9 (dtmf)",
            "data": {
              "module_type": "number",
              "result_variable": "Y"
            }
          },
          "class": "event",
          "timestamp": 1575898411
        },
        {
          "event": {
            "line": "Executing JavaScript",
            "data": {
              "module_type": "eval_js",
              "result_variable": "sum"
            }
          },
          "class": "info",
          "timestamp": 1575898411
        },
        {
          "event": {
            "line": "X plus Y equals: ",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598831",
              "language": "en-US",
              "module_type": "prompt",
              "result_variable": "result"
            }
          },
          "class": "prompt",
          "timestamp": 1575898411
        },
        {
          "event": {
            "line": "15 (say-as: prompt)",
            "data": {
              "type": "dynamic",
              "language": "en-US",
              "module_type": "prompt",
              "result_variable": "result"
            }
          },
          "class": "prompt",
          "timestamp": 1575898411
        },
        {
          "event": {
            "line": ".",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598851",
              "language": "en-US",
              "module_type": "prompt",
              "result_variable": "result"
            }
          },
          "class": "prompt",
          "timestamp": 1575898411
        },
        {
          "event": {
            "line": "To try that again, press 1.  Otherwise, press 2.",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598861",
              "language": "en-US",
              "module_type": "yes_no",
              "result_variable": "try_sum_again"
            }
          },
          "class": "prompt",
          "timestamp": 1575898415
        },
        {
          "event": {
            "line": "User input: false (dtmf)",
            "data": {
              "module_type": "yes_no",
              "result_variable": "try_sum_again"
            }
          },
          "class": "event",
          "timestamp": 1575898419
        },
        {
          "event": {
            "line": "Now let's try capturing an address.",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598881",
              "language": "en-US",
              "module_type": "prompt",
              "result_variable": "info"
            }
          },
          "class": "prompt",
          "timestamp": 1575898419
        },
        {
          "event": {
            "line": "Please say a US city and state.",
            "data": {
              "type": "static",
              "has_audio": false,
              "revision_id": "61231",
              "prompt_id_type": "module",
              "prompt_id": "598871",
              "language": "en-US",
              "module_type": "address",
              "result_variable": "city_state"
            }
          },
          "class": "prompt",
          "timestamp": 1575898423
        },
        {
          "event": {
            "line": "Disconnecting call",
            "data": {
              "module_type": "address",
              "result_variable": "city_state"
            }
          },
          "class": "event",
          "timestamp": 1575898423
        }
      ],
      "type": "inbound",
      "log": true
    }
  ],
  "total_calls": 1
}

Possible Response Codes

  • 200: success

  • 401: authentication headers invalid or the account is inactive

  • 404: call log not found

  • 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.

Response Data Definitions

Single Call Entry

Name

Data Type

Value

dest

string

Destination phone number of the call.

src

string

Source phone number of the call.

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.

details

json

json format of log details for each call

false if the call was made more than 5 days ago

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/all_logs/'.$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