apis

Fuse API

Overview

The Fuse API provides programmatic integration points for the following Plum Fuse features:

Base URL

The base URL for all API requests is:

https://fuse.plumvoice.com/api

Authentication

All API requests authenticate using HTTP Basic Authentication. Use the same email address you use to log into your Fuse account for the username value. Your Developer Key, located in your Account Settings, functions as your password.

Most likely, users will be able to use built-in HTTP Basic Authentication, depending on the HTTP libraries available in the programming language they opt to use. If the desired programming language does not have HTTP Basica Authentication, users can build the header manually by base64 encoding their email address and developer key, concatenated with a colon, and then prefixing it with 'Basic'. Manually built HTTP Basic Authentication in this instance should look like the following example:

"Authentication: Basic your_base64_encoded_string"

Any requests made without this header or with invalid credentials return an HTTP 401 Unauthorized error. The body of the error message provides details about what went wrong with the request.

Supported Accept Headers

The API method honors the following Accept header values. These determine the Content-Type and the representation for the response:

  • application/json
  • application/xml

Specifying an Accept header other than these values returns a Content-Type of 'application/json' by default.

Locating your application_id and deployment_id

The Fuse API utilizes the application_id and deployment_id values in many areas. To locate these values for a specific deployment, navigate to the Outbound Interface. The “Outbound API Values” are displayed at the top of the page. These include the application_id and deployment_id for that deployment.

Queuing An Outbound Call

URL:
https://fuse.plumvoice.com/api/apps/{application_id}/{deployment_id}/queue
HTTP method:
POST
Content-Type:
application/x-www-form-urlencoded, application/json
Request Parameters:
Name Data Type Required Description
phone_numberstringyesThis is the destination phone number for the outbound call. There are multiple ways to format phone numbers. They can include the 'tel:' prefix and/or the ANI and postd suffixes, e.g. ani=1234567890 and/or postd=1234. Examples of valid numbers include: 6175551234, tel:+16175551234, 16175551234;ani=5555555555 (this masks the number the recipient sees), 16175551234;ani=5555555555;postd=2 (this masks the number the recipient sees and enters the dtmf tone for 2 when the call connects). It is also possible to combine all of these options: tel:+16175551234;ani=5555555555;postd=2.
start_timestampstringnoUnix timestamp indicating when to begin the outbound dialing attempts. If not specified, the calls go out immediately.
end_timestampstringnoUnix timestamp indicating when to stop attempting the outbound call.
max_attemptsint (between 1-10)noTotal number of times to attempt calling a specific number (if previous attempts are not completed successfully).
reattempt_waitintnoInterval (in seconds) to wait before retrying the outbound call after a failure. This is only required when you set a max_attempts value greater than one, which indicates additional retry attempts. Valid values range from 60 to 86400 (1 minute to 1 day)
metadatamixednoJSON object of key⇒value pairs of variables and their related values for use with an application at run time.
result_urlurlnoCallback URL to your REST service that processes the call status results when the call is completed, canceled, or all attempts have been exhausted. The POST body matches the format of the call_details attribute from the outbound call status API response, shown here.
is_pciint (0 or 1)noFor customers who have been granted access to our HIPAA / PCI compliant secure environment setting this flag to 1 will cause connected outbound calls to execute within that secure environment.

Possible Response Codes:

  • 200: success, call successfully queued.
  • 400: supplied data improperly formatted or invalid
  • 401: authentication headers invalid or the account is inactive
  • 403: the user attempting to queue the outbound call does not have appropriate permissions
  • 404: deployment not found
  • 405: invalid HTTP method supplied (only POST allowed)
  • 409: user, deployment, or application previously deleted
  • 500: database error

The return structure will contain the following item(s):

Name Data Type Always Present Description
errorstringnoThis indicates which error occurred if the HTTP code is not 200.
call_idintnoA 200 HTTP code returns this value, which is the unique identifier for an outbound call when the request is successful. Users can use the call_id value to look up call details in the call details API method outlined below.

Note: The returned 'Link' header provides the URI for checking the status of the most recent outbound call attempt.

Sample Code

This sample PHP code makes a request to queue a new outbound call. This triggers an outbound call that goes out immediately and makes a single attempt to connect:

<?php
// account and application settings
$email = '<your_email_address>';
$developer_key = '<your_developer_key>';
$application_id = '<your_application_id>';
$deployment_id = '<your_deployment_id>';
$phone_number = '<phone_number_to_dial>';

// build the URL and POST parameters
$url = 'https://fuse.plumvoice.com/api/apps/'.$application_id.'/'.$deployment_id.'/queue';
$params = array('phone_number'=>$phone_number);

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $email.':'.$developer_key);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);

Sample Responses

On success (Note the 'Link' header. It's possible to use this URI to check the status of the outbound call):

JSON response:
HTTP Code 200
HTTP Headers:

HTTP/1.1 200 OK
Date: Mon, 07 Nov 2016 17:03:29 GMT
Server: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.2d PHP/5.4.45
X-Powered-By: PHP/5.4.45
Link: https://fuse.plumvoice.com/api/outbound/761
Content-Length: 15
Content-Type: application/json

Response Body:

{"call_id":761}

The same response with an Accept header of application/xml in the request looks like:

XML response:
HTTP Code 200 Headers:

HTTP/1.1 200 OK
Date: Mon, 07 Nov 2016 17:05:29 GMT
Server: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.2d PHP/5.4.45
X-Powered-By: PHP/5.4.45
Link: https://fuse.plumvoice.com/api/outbound/771
Content-Length: 62
Content-Type: application/xml

Response Body:

<?xml version="1.0"?>
<result>
  <call_id>771</call_id>
</result>

On Failure (start_timestamp was after the end_timestamp):

JSON Response:
HTTP Code 400

{ "error": "The end_timestamp cannot be earlier than the start_timestamp." }

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 400

<?xml version="1.0"?>
<result>
    <error>The end_timestamp cannot be earlier than the start_timestamp.</error>
</result>

Queuing Multiple Outbound Calls

URL:

https://fuse.plumvoice.com/api/apps/{application_id}/{deployment_id}/bulk_queue

HTTP method: POST

Content-Type: multipart/form-data

Request Parameters:

Name Data Type Required Description
csvfileyesCSV file of contacts to receive the outbound calls. For a description of how to format this file, see Contacts CSV Formatting.
start_timestampstringnoUnix timestamp indicating when to begin the outbound dialing attempts. If not specified, the calls go out immediately.
end_timestampstringnoUnix timestamp indicating when to stop attempting outbound calls.
max_attemptsint (between 1-10)noTotal number of attempts to be made to a specific phone number (if previous attempts are not completed successfully).
reattempt_waitintnoInterval (in seconds) to wait before retrying the outbound call after a failure. This is only required when the max_attempts value is set to a number greater than one, indicating additional retry attempts. Valid values range from 60 to 86400 (1 minute to 1 day)
result_urlurlnoCallback URL to the REST service that processes the call status results when a call is completed, canceled, or all attempts have been exhausted. The POST body matches the format of the call_details attribute from the outbound call status API response, shown here .
is_pciint (0 or 1)noFor customers who have been granted access to our HIPAA / PCI compliant secure environment setting this flag to 1 will cause connected outbound calls to execute within that secure environment.

Possible Response Codes:

  • 200: success, calls successfully queued
  • 400: supplied data improperly formatted or invalid
  • 401: authentication headers invalid or the account is inactive
  • 403: the user attempting to queue the outbound call does not have appropriate permissions
  • 404: deployment not found
  • 405: invalid HTTP method supplied (only POST allowed)
  • 409: user, deployment, or application previously deleted
  • 500: database error

The return structure will contain the following item(s):

Name Data Type Always Present Description
calls_queuednoThis represents the total number of calls queued when the HTTP code is 200.
errorstringnoIndicates what went wrong when an HTTP code other than 200 is returned.

Sample Code

This sample PHP code makes a request to queue multiple outbound calls (with a queue.csv file in the same working directory as the script):

<?php
// account and application settings
$email = '<your_email_address>';
$developer_key = '<your_developer_key>';
$application_id = '<your_application_id>';
$deployment_id = '<your_deployment_id>';
$phone_numbers_file = '/path/to/csv/file.csv';

// build the URL and POST parameters
$url = 'https://fuse.plumvoice.com/api/apps/'.$application_id.'/'.$deployment_id.'/bulk_queue';
$params = array(
  'csv' => curl_file_create($phone_numbers_file),
  'start_timestamp' => strtotime('+1 minutes'),
  'end_timestamp' => strtotime('+1 hour'),
  'max_attempts' => 1
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $email.':'.$developer_key);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-type: multipart/form-data"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);

Sample Responses

On success:

JSON Response:
HTTP Code 200

{"calls_queued":1}

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 200

<?xml version="1.0"?>
<result>
  <calls_queued>1</calls_queued>
</result>

On Failure (multiple attempts were set without a retry interval):

JSON Response:
HTTP Code 400

{"error":"The reattempt_wait parameter must be supplied when max_attempts is greater than 1."}

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 400

<?xml version="1.0"?>
<result>
  <error>The reattempt_wait parameter must be supplied when max_attempts is greater than 1.</error>
</result>

Checking Status For An Outbound Call

URL:

https://fuse.plumvoice.com/api/outbound/{call_id}

HTTP method: GET

Content-Type: N/A

Possible Response Codes:

  • 200: success
  • 401: authentication headers invalid or the account is inactive
  • 403: user does not have the appropriate permission to view the outbound call (owned by another user)
  • 404: outbound call 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
errorstringnoMessage indicating what went wrong with the request when the HTTP code is not 200.
call_detailsmixednoAll call data for the outbound call. Supplied when the HTTP code is 200. See the table below for more information on the data in this item.

Call Details Data:

Name Data Type Value
statusstringCurrent status for the outbound call.
attemptsintTotal number of attempts made.
max_attemptsintMaximum number of attempts for each queued number.
queued_timestampintUnix timestamp indicating when the call was queued.
start_timestampintUnix timestamp indicating when the call was scheduled to start outbound call attempts.
end_timestampintUnix timestamp indicating when the outbound call was scheduled to stop outbound attempts.
reattempt_waitintTime, in seconds, to wait between retrying the outbound call after a failure.
eventsmixedNumerically indexed array of outbound call events. Each row uses the 'event' and 'timestamp' labels to indicate the event and its duration.
durationintDuration, in seconds, of a successfully completed 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>';
$call_id = '<your_call_id>';

// build the URL
$url = 'https://fuse.plumvoice.com/api/outbound/'.$call_id;

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

Sample Response

On success (this outbound call was queued and then canceled):

JSON Response:
HTTP Code 200

{
  "call_details": {
    "max_attempts": "1",
    "attempts": "1",
    "events": [
      {
        "event": "queued",
        "timestamp": 1475095892
      },
      {
        "event": "dialing",
        "timestamp": 1475095893
      },
      {
        "event": "connected",
        "timestamp": 1475095925
      },
      {
        "event": "disconnected",
        "timestamp": 1475095928
      }
    ],
    "phone_number": "'6173720293'",
    "status": "completed",
    "queued_timestamp": "1475095892",
    "start_timestamp": "1475095925",
    "end_timestamp": "1475095928",
    "reattempt_wait": "300",
    "duration": 3
  }
}

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 200

<?xml version="1.0"?>
<result>
    <call_details>
        <max_attempts>1</max_attempts>
        <attempts>1</attempts>
        <events>
            <item>
                <event>queued</event>
                <timestamp>1475095892</timestamp>
            </item>
            <item>
                <event>dialing</event>
                <timestamp>1475095893</timestamp>
            </item>
            <item>
                <event>connected</event>
                <timestamp>1475095925</timestamp>
            </item>
            <item>
                <event>disconnected</event>
                <timestamp>1475095928</timestamp>
            </item>
        </events>
        <phone_number>'6173720293'</phone_number>
        <status>completed</status>
        <queued_timestamp>1475095892</queued_timestamp>
        <start_timestamp>1475095925</start_timestamp>
        <end_timestamp>1475095928</end_timestamp>
        <reattempt_wait>300</reattempt_wait>
        <duration>3</duration>
    </call_details>
</result>

On Failure (no outbound id was found):

JSON Response:
HTTP Code 404

{"error":"No outbound call was found by that id."}

The same response with an Accept header of 'application/xml' in the request looks like:

XML Response:
HTTP Code 404

<?xml version="1.0"?>
<result>
  <error>No outbound call was found by that id.</error>
</result>

Cancelling All Pending Outbound Calls

URL:

https://fuse.plumvoice.com/api/apps/{application_id}/{deployment_id}/cancel

HTTP method: DELETE

Content-Type: N/A

Possible Response Codes:

  • 202: calls successfully canceled
  • 401: authentication headers invalid or the account is inactive
  • 403: the account attempting to cancel calls does not have appropriate permissions
  • 404: user, deployment, or application not found
  • 405: invalid HTTP method supplied (only DELETE allowed)
  • 500: database error

The return structure contains the following item(s):
Note: No body is returned for a successful response (HTTP code 202).

Name Data Type Always Present Description
errorstringnoIf the HTTP code is not 202, this provides a message indicating what error occurred.

Sample Code

This sample PHP code that makes a request to this method:

<?php
// account and application settings
$email = '<your_email_address>';
$developer_key = '<your_developer_key>';
$application_id = '<your_application_id>';
$deployment_id = '<your_deployment_id>';

// build the URL
$url = 'https://fuse.plumvoice.com/api/apps/'.$application_id.'/'.$deployment_id.'/cancel';

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $email.':'.$developer_key);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
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);

Sample Response

On success:

JSON/XML Response:
HTTP Code 202
No response body returned

On Failure (invalid deployment):

JSON Response:
HTTP Code 404

{"error": "No deployment was found by that application id and deployment id."}

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 404

<?xml version="1.0"?>
<result>
  <error>No deployment was found by that application id and deployment id.</error>
</result>

Fetching Calls

URL:

https://fuse.plumvoice.com/api/calls/{start}/{end}?number=6177123000&limit=1000&offset=0

HTTP method: GET

Content-Type: N/A

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
errorstringnoMessage indicating what went wrong with the request when the HTTP code is not 200.
callsmixednoArray 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_callsintnoThe 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.

Single Call Entry:

Name Data Type Value
deststringDestination phone number of the call.
srcstringSource phone number of the call.
startintStart UNIX timestamp for this call.
endintEnd Unix timestamp for this call.
session_idstringUnique ID for this call, also used to fetch individual call logs.
typestringType for this call (inbound, outbound or transfer).
logboolFlag 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);

Sample Response

On success:

JSON Response:
HTTP Code 200

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

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 200

<?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>

Fetching A Call Log

URL:

https://fuse.plumvoice.com/api/call/{session_id}

HTTP method: GET

Content-Type: N/A

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 an array of log entries

Single Call Log Entry:

Name Data Type Value
eventobjectThe details for this entry.
classstringThe class for this entry (info, event, debug, prompt or error).
timestampintUNIX timestamp for this entry.

Single Call Event:

Name Data Type Value
linestringThe log event string
dataobjectAdditional details about this event

Call log data structure consistency is not guaranteed and can change at any time. Currently, there are two values that will always appear in the event data: module_type and result_variable. All other values are subject to developer discovery and could change at any time:

Name Data Type Value
module_typestringThe type name for the module that was executed, this will determine the other values in the data
result_variablestringThe variable name provided for this module in the callflow editor

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>';
$session_id = '300060;001;1529552581'; // returned by a previous call to https://fuse.plumvoice.com/api/calls

// build the URL
$url = 'https://fuse.plumvoice.com/api/call/'.urlencode($session_id);

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

Sample Response

On success (this outbound call was queued and then canceled):

JSON Response:
HTTP Code 200

[
  {
    "event":{
      "line":"Executing application \"email test\" version \"0.2\"",
      "data":{
        "module_type":"start",
        "result_variable":"start"
      }
    },
    "class":"info",
    "timestamp":1529552692
  },
  {
    "event":{
      "line":"Sending email",
      "data":{
        "type":"static",
        "has_audio":false,
        "revision_id":"52691",
        "prompt_id_type":"module",
        "prompt_id":"845617",
        "language":"en-US",
        "module_type":"prompt",
        "result_variable":"var_0"
      }
    },
    "class":"prompt",
    "timestamp":1529552692
  },
  {
    "event":{
      "line":"Sending",
      "data":{
        "module_type":"email",
        "result_variable":"var_1"
      }
    },
    "class":"info",
    "timestamp":1529552694
  },
  {
    "event":{
      "line":"Sent",
      "data":{
        "to":"tests@plumgroup.com",
        "subject":"This is the subject",
        "body":"This is the body.",
        "module_type":"email",
        "result_variable":"var_1"
      }
    },
    "class":"debug",
    "timestamp":1529552694
  },
  {
    "event":{
      "line":"message sent! goodbye!",
      "data":{
        "type":"static",
        "has_audio":false,
        "revision_id":"52691",
        "prompt_id_type":"module",
        "prompt_id":"845618",
        "language":"en-US",
        "module_type":"prompt",
        "result_variable":"var_2"
      }
    },
    "class":"prompt",
    "timestamp":1529552694
  },
  {
    "event":{
      "line":"Exiting application",
      "data":{
        "module_type":"exit",
        "result_variable":"hangup"
      }
    },
    "class":"info",
    "timestamp":1529552696
  },
  {
    "event":{
      "line":"Disconnecting call",
      "data":{
        "module_type":"exit",
        "result_variable":"hangup"
      }
    },
    "class":"event",
    "timestamp":1529552697
  }
]

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 200

<?xml version="1.0"?>
<result>
  <item>
    <event>
      <line>Executing application "email test" version "0.2"</line>
      <data>
        <module_type>start</module_type>
        <result_variable>start</result_variable>
      </data>
    </event>
    <class>info</class>
    <timestamp>1529552692</timestamp>
  </item>
  <item>
    <event>
      <line>Sending email</line>
      <data>
        <type>static</type>
        <has_audio>false</has_audio>
        <revision_id>52691</revision_id>
        <prompt_id_type>module</prompt_id_type>
        <prompt_id>845617</prompt_id>
        <language>en-US</language>
        <module_type>prompt</module_type>
        <result_variable>var_0</result_variable>
      </data>
    </event>
    <class>prompt</class>
    <timestamp>1529552692</timestamp>
  </item>
  <item>
    <event>
      <line>Sending</line>
      <data>
        <module_type>email</module_type>
        <result_variable>var_1</result_variable>
      </data>
    </event>
    <class>info</class>
    <timestamp>1529552694</timestamp>
  </item>
  <item>
    <event>
      <line>Sent</line>
      <data>
        <to>test@plumgroup.com</to>
        <subject>This is the subject</subject>
        <body>This is the body.</body>
        <module_type>email</module_type>
        <result_variable>var_1</result_variable>
      </data>
    </event>
    <class>debug</class>
    <timestamp>1529552694</timestamp>
  </item>
  <item>
    <event>
      <line>message sent! goodbye!</line>
      <data>
        <type>static</type>
        <has_audio>false</has_audio>
        <revision_id>52691</revision_id>
        <prompt_id_type>module</prompt_id_type>
        <prompt_id>845618</prompt_id>
        <language>en-US</language>
        <module_type>prompt</module_type>
        <result_variable>var_2</result_variable>
      </data>
    </event>
    <class>prompt</class>
    <timestamp>1529552694</timestamp>
  </item>
  <item>
    <event>
      <line>Exiting application</line>
      <data>
        <module_type>exit</module_type>
        <result_variable>hangup</result_variable>
      </data>
    </event>
    <class>info</class>
    <timestamp>1529552696</timestamp>
  </item>
  <item>
    <event>
      <line>Disconnecting call</line>
      <data>
        <module_type>exit</module_type>
        <result_variable>hangup</result_variable>
      </data>
    </event>
    <class>event</class>
    <timestamp>1529552697</timestamp>
  </item>
</result>

On Failure (invalid session ID):

JSON Response:
HTTP Code 404

{"error": "No call log was found."}

The same response with an Accept header of application/xml in the request looks like:

XML Response:
HTTP Code 404

<?xml version="1.0"?>
<result>
  <error>No call log was found.</error>
</result>

apis.txt · Last modified: 2018/06/26 11:03 by admin