INTERACTIVE VOICE RESPONSE (IVR) MENUS
- Creating New Interactive Voice Response
[[API:Function]] – goAddIVRmenu
-
This application is used to create new IVR menu. Newly created IVR menu belongs to user that authenticated a request.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
menu_id – menu id. Integer
-
menu_name – name of the IVR menu. String
-
custom_dialplan_entry – custom dialplan entry. String
-
menu_prompt – menu prompt. String
-
menu_timeout – menu time-out. Time
-
menu_timeout_prompt – menu time-out prompt. Time
-
menu_invalid_prompt – menu invalid prompt. String
-
menu_repeat – menu repeat. String
-
call_time_id – call time id. Integer
-
tracking_group - tracking group. String
-
user_group – assign user group to specific user group. String
Returns:
result – “success” means that IVR menus has been created. String
result – “error” means that IVR menus has not been created, containing the error occurred. String
-
Error: Set a value for Menu ID not less than 4 characters.
-
Error: Set a value for menu_name.
-
Error: Set a value for user_group.
-
Error: Set a value for menu_timeout.
-
Error: Set a value for menu_repeat
-
Error: Set a value for menu_time_check.
-
Error: Set a value for track_in_vdac.
-
Error: Set a value for tracking_group.
-
Error: Special characters found in menu_id
-
Error: Special characters found in menu_name
-
Error: Special characters found in menu_timeout
-
Error: Special characters found in menu_repeat
-
Error: Special characters found in tracking_group
-
Error: Set a value for user_group.
-
Error: menu_time_check Value should be 0 or 1
-
Error: track_in_vdac Value should be 0 or 1
-
CALL MENU NOT ADDED - there is already a CALL MENU in the system with this ID
-
Error: CALL MENU NOT ADDED - there is already a CALL MENU in the system with this ID
menu_id – created menu id. Integer
Sample Code:
<?php
$url = "https://jameshv.goautodial.com/goAPI/goInbound/goAPI.php"; # URL to GoAutoDial API file
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]
$postfields["responsetype"] = "json"; #json. (required)
$postfields["hostname"] = $_SERVER['REMOTE_ADDR']; #Default value
$postfields["menu_name"] = ""; #Desired name (required)
$postfields["menu_id"] = ""; #Desired menu ID (required)
$postfields["custom_dialplan_entry"] = ""; #Desired dialplan entry (required)
$postfields["menu_prompt"] = ""; #Desired prompt (required)
$postfields["menu_timeout"] = ""; #Desired timeout (Required)
$postfields["menu_timeout_prompt"] = ""; #Desired time out prompt (required)
$postfields["menu_invalid_prompt"] = ""; #Desired invali prompt (required)?
$postfields["menu_repeat"] = ""; #Desired menu repeat (required)
$postfields["call_time_id"] = ""; #Desired time (required)
$postfields["tracking_group"] = ""; #Desired tracking group (required)
$postfields["user_group"] = ""; #Assign to user group (required
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
echo "Added New IVR Menu ID";
} else {
# An error occured
echo $output->result;
}
?>
-
- Updating Interactive Voice Response
[[API:Function]] – goEditIVR
-
This application is used to update a IVR menu. Only IVR menu that belongs to authenticated user can be updated.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
menu_id – menu id. Integer
Returns:
result – “success” means that IVR menus has been updated successfully. String
result – “error” means that IVR menus has not been updated, containing the error occurred. String
-
Error: Set a value for menu ID.
-
Error: Special characters found in menu_name
-
Error: Special characters found in menu_prompt
-
Error: Special characters found in menu_timeout
-
Error: Special characters found in menu_timeout_prompt
-
Error: Special characters found in menu_invalid_prompt
-
Error: Special characters found in menu_repeat
-
Error: Special characters found in call_time_id
-
Error: Special characters found in tracking_group
-
Error: Special characters found in custom_dialplan_entry
-
Error: menu_time_check Value should be 0 or 1
-
Error: track_in_vdac Value should be 0 or 1"
-
Error: CALL MENU NOT FOUND
-
Error: Failed to update
menu_id – updated menu id. Integer
Sample Code:
<?php
$url = "https://jameshv.goautodial.com/goAPI/goInbound/goAPI.php"; # URL to GoAutoDial API file
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]
$postfields["responsetype"] = "json"; #json. (required)
$postfields["hostname"] = $_SERVER['REMOTE_ADDR']; #Default value
$postfields["menu_id"] = ""; #Desired menu ID (required)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
echo "Update Success";
} else {
# An error occured
echo $output->result;
}
?> -
- Deleting Interactive Voice Response
[[API:Function]] – goDeleteIVR
-
This application is used to delete a IVR menu. Only IVR menu that belongs to authenticated user can be delete.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
menu_id – menu id. Integer
Returns:
result – “success” means that IVR menu has been deleted successfully. String
result – “error” means that IVR menu has not been deleted, containing the error occurred. String
-
Error: Set a value for Menu ID.
-
Error: IVR doesn't exist.
menu_id – deleted menu id. Integer
Sample Code:<?php
$url = "https://YOUR_URL/goAPI/goInbound/goAPI.php"; #URL to GoAutoDial API. (required)
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)
$postfields["responsetype"] = "json"; #json. (required)
$postfields["menu_id"] = ""; #Desired menu ID. (required)
$postfields["hostname"] = $_SERVER['REMOTE_ADDR']; #Default value
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
if ($output->result=="success") {
# Result was OK!
echo " IVR menu deleted successfully";
} else {
# An error occured
echo $output->result;
}
?>
-
- Displaying Interactive Voice Response
[[API:Function]] – goGetIVRMenusList
-
This application is used to get list of IVR menu belongs to user.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
Returns:
result – “success” means that query was successful. String
result – “error” means that query was not successful. , containing the error occurred. String
menu_id – menu id. Integer
menu_name – name of IVR menu. String
menu_prompt – menu prompt. String
menu_timeout – menu time-out. String
Sample Code:
<?php
$url = "https://YOUR_URL/goAPI/goInbound/goAPI.php"; #URL to GoAutoDial API. (required)
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)
$postfields["responsetype"] = "json"; #json. (required)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
if ($output->result=="success") {
# Result was OK!
for($i=0;$i<count($output->menu_id);$i++){
echo $output->menu_id[$i]."</br>";
echo $output->menu_name[$i]."</br>";
echo $output->menu_prompt[$i]."</br>";
echo $output->menu_timeout[$i]."</br>";
}
} else {
# An error occured
echo "The following error occured: ".$results["message"];
}
?>
-
- Displaying Interactive Voice Response Information
[[API:Function]] – goGetIVRInfo
-
Allows to retrieve some attributes of a given IVR menu. IVR menu should belong to the user that authenticated the request.
Mandatory parameters from “postfields” variables:
-
goUser- Username. String
-
goPass- Password. String
-
goAction- Action performed by the [[API:Functions]]. String
-
menu_id – menu id. Integer
Returns:
result – “success” means that query was successful. String
result – “error” means that query was not successful. , containing the error occurred. String
-
Error: Set a value for Menu ID.
-
Error: IVR menu doesn't exist.
menu_id – menu id. Integer
menu_name – name of IVR menu. String
menu_prompt – menu prompt. String
menu_timeout – menu time-out. String
Sample Code:
<?php
$url = "https://YOUR_URL/goAPI/goInbound/goAPI.php"; #URL to GoAutoDial API. (required)
$postfields["goUser"] = ""; #Username goes here. (required)
$postfields["goPass"] = ""; #Password goes here. (required)
$postfields["goAction"] = ""; #action performed by the [[API:Functions]]. (required)
$postfields["responsetype"] = "json"; #json. (required)
$postfields["menu_id"] = ""; #Desired menu id. (required)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
$output = json_decode($data);
// print_r($data);
if ($output->result=="success") {
# Result was OK!
for($i=0;$i<count($output->menu_id);$i++){
echo $output->menu_id[$i]."</br>";
echo $output->menu_name[$i]."</br>";
echo $output->menu_prompt[$i]."</br>";
echo $output->menu_timeout[$i]."</br>";
}
} else {
# An error occured
echo $output->result;
}
?>
-