Application API

Application API Description

Plum offers eight services for its Application REST API:

Method

Service

Description

GET

application/getASR

Returns the ASR value of the given phone number

GET

application/getTTS

Returns the TTS value of the given phone number

GET

application/getURL

Returns the URL value of the given phone number

GET

application/getOptionsASR

Returns a list of ASR options

GET

application/getOptionsTTS

Returns a list of TTS options

POST

application/setASR

Sets the ASR value on the given phone number

POST

application/setTTS

Sets the TTS value on the given phone number

POST

application/setURL

Sets the URL value on the given phone number

Authentication

All API requests authenticate using HTTP Basic Authentication. Use the same username and password that you use to login to your Dev account.

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.

Examples of this for each Method are listed below.

get
Get ASR Value

https://hosting.plumvoice.com/ws/application/getASR/{phone_number}
Returns ASR value currently set to phone number provided.
Request
Response
Request
Path Parameters
phone_number
required
string
10 digit phone number Ex. 3332221111
Headers
Accept
optional
string
application/xml, application/json
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"asr": "Nuance OSR 3.0"
}
}

Sample Request:

<?php
$login = "<username>";
$password = "<password>";
$phone_number = "<phone number>";
$auth = $login . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/getASR/$phone_number";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
?>

get
Get TTS Value

https://hosting.plumvoice.com/ws/application/getTTS/{phone_number}
Returns TTS value currently set to phone number provided.
Request
Response
Request
Path Parameters
phone_number
required
string
10 digit phone number Ex. 3332221111
Headers
Accept
optional
string
application/xml, application/json
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"tts": "AT&T Natural Voices 1.4"
}
}

Sample Request:

<?php
$login = "<username>";
$password = "<password>";
$phone_number = "<phone number>";
$auth = $login . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/getTTS/$phone_number";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
?>

get
Get URL Value

https://hosting.plumvoice.com/ws/application/getURL/{phone_number}
Returns URL value currently set to phone number provided.
Request
Response
Request
Path Parameters
phone_number
required
string
10 digit phone number Ex. 3332221111
Headers
Accept
optional
string
application/xml, application/json
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"url": "http://google.com"
}
}

Sample Request:

<?php
$login = "<username>";
$password = "<password>";
$phone_number = "<phone number>";
$auth = $login . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/getURL/$phone_number";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
?>

get
Get ASR Options

https://hosting.plumvoice.com/ws/application/getOptionsASR
Returns all currently available ASR options.
Request
Response
Request
Headers
Accept
optional
string
application/xml, application/json
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"asr": [
"Nuance OSR 3.0",
"Nuance Recognizer 9"
]
}
}

Sample Request:

<?php
$login = "<username>";
$password = "<password>";
$auth = $login . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/getOptionsASR";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
?>

get
Get TTS Options

https://hosting.plumvoice.com/ws/application/getOptionsTTS
Returns all currently available TTS options.
Request
Response
Request
Headers
Accept
optional
string
application/xml, application/json
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"asr": [
"Nuance RealSpeak 4.0",
"Cepstral Swift 4.1",
"AT&T Natural Voices 1.4",
"Nuance Vocalizer 6.0 Alpha",
"AWS Polly"
]
}
}

Sample Request:

<?php
$login = "<username>";
$password = "<password>";
$auth = $login . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/getOptionsTTS";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
?>

post
Set ASR Value

https://hosting.plumvoice.com/ws/application/setASR/{phone_number}
Sets the ASR of the given phone number to the provided ASR value.
Request
Response
Request
Path Parameters
phone_number
required
string
10 digit phone number Ex. 3332221111
Headers
Content-type
required
string
multipart/form-data
Accept
optional
string
application/xml, applicaton/json
Form Data Parameters
asr
required
string
ASR value to be set
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"asr": "Record updated successfully"
}
}

Sample Request:

<?php
$username = "<login>";
$password = "<password>";
$phone_number = "<phone number>";
$value = "<ASR to be set>";
$params = array("asr"=>$value);
$auth = $username . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/setASR/$phone_number";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-type: multipart/form-data"));
$result = curl_exec($ch);
curl_close($ch);
?>

post
Set TTS Value

https://hosting.plumvoice.com/ws/application/setTTS/{phone_number}
Sets the TTS of the given phone number to the TTS value provided.
Request
Response
Request
Path Parameters
phone_number
required
string
10 digit phone number Ex. 3332221111
Headers
Content-type
required
string
multipart/form-data
Accept
optional
string
application/xml, application/json
Form Data Parameters
tts
required
string
TTS value to be set
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"tts": "Record updated successfully"
}
}

Sample Request:

<?php
$username = "<login>";
$password = "<password>";
$phone_number = "<phone number>";
$value = "<TTS to be set>";
$params = array("tts"=>$value);
$auth = $username . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/setTTS/$phone_number";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-type: multipart/form-data"));
$result = curl_exec($ch);
curl_close($ch);
?>

post
Set URL Value

https://hosting.plumvoice.com/ws/application/setURL/{phone_number}
Sets the URL of the given phone number to the provided URL value.
Request
Response
Request
Path Parameters
phone_number
required
string
10 digit phone number Ex. 3332221111
Headers
Content-type
required
string
multipart/form-data
Accept
optional
string
application/xml, application/json
Form Data Parameters
url
required
string
URL value to be set
Response
200: OK
{
"status": "success",
"error": "",
"result": {
"url": "Record updated successfully"
}
}

Sample Request:

<?php
$username = "<login>";
$password = "<password>";
$phone_number = "<phone number>";
$value = "<URL to be set>";
$params = array("url"=>$value);
$auth = $username . ":" . $password;
$url = "https://hosting.plumvoice.com/ws/application/setURL/$phone_number";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, $auth);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-type: multipart/form-data"));
$result = curl_exec($ch);
curl_close($ch);
?>