Fixes for inconsistencies in documentation and permissions for some functions in the non-agent API

git-svn-id: svn://192.168.202.10@3854 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-07-18 13:45:24 +00:00
parent e7e303c99d
commit d4dc8de2ba
2 changed files with 14 additions and 12 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2024-07-03 NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2024-07-18
This document describes the functions of an API(Application Programming This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -221,6 +221,7 @@ Changes:
240217-0907 - Added more missing vicidial_users fields from copy function 240217-0907 - Added more missing vicidial_users fields from copy function
240302-0804 - Added delete_dnc_phone function 240302-0804 - Added delete_dnc_phone function
240703-1657 - Added update_remote_agent function 240703-1657 - Added update_remote_agent function
240718-0942 - Fixes for inconsistencies in documentation and permissions for some functions
API Functions use the 'function' variable API Functions use the 'function' variable
@@ -377,7 +378,7 @@ ERROR: agent_ingroup_info INVALID USER ID - 1255|6666
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
agent_campaigns - looks up allowed campaigns/in-groups for a specific user agent_campaigns - looks up allowed campaigns/in-groups for a specific user
NOTE: api user for this function must have user_level set to 7 or higher NOTE: api user for this function must have user_level set to 8 or higher and "view reports" and "modify users" enabled
REQUIRED FIELDS- REQUIRED FIELDS-
agent_user - 2-20 characters agent_user - 2-20 characters
@@ -412,7 +413,7 @@ user|allowed_campaigns_list|allowed_ingroups_list
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
campaigns_list - displays information about all campaigns in the system campaigns_list - displays information about all campaigns in the system
NOTE: api user for this function must have user_level set to 7 or higher NOTE: api user for this function must have user_level set to 8 or higher and "view reports" enabled
REQUIRED FIELDS- REQUIRED FIELDS-
source - description of what originated the API call (maximum 20 characters) source - description of what originated the API call (maximum 20 characters)
@@ -443,7 +444,7 @@ TESTCAMP|Test Campaign|Y|---ALL---|INBOUND_MAN|1|DOWN|PDROP DROP B NEW
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
hopper_list - displays information about leads in the hopper for a campaign hopper_list - displays information about leads in the hopper for a campaign
NOTE: api user for this function must have user_level set to 7 or higher NOTE: api user for this function must have user_level set to 8 or higher and "view reports" enabled
REQUIRED FIELDS- REQUIRED FIELDS-
source - description of what originated the API call (maximum 20 characters) source - description of what originated the API call (maximum 20 characters)
+9 -8
View File
@@ -212,10 +212,11 @@
# 240302-0804 - Added delete_dnc_phone function # 240302-0804 - Added delete_dnc_phone function
# 240420-2236 - Added ConfBridge code # 240420-2236 - Added ConfBridge code
# 240703-1657 - Added update_remote_agent function # 240703-1657 - Added update_remote_agent function
# 240718-0942 - Fixes for inconsistencies in documentation and permissions for some functions
# #
$version = '2.14-189'; $version = '2.14-190';
$build = '240703-1657'; $build = '240718-0942';
$php_script='non_agent_api.php'; $php_script='non_agent_api.php';
$api_url_log = 0; $api_url_log = 0;
$camp_lead_order_random=1; $camp_lead_order_random=1;
@@ -2719,7 +2720,7 @@ if ($function == 'agent_campaigns')
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit; exit;
} }
$stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 6 and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 7 and modify_users='1' and active='Y';";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$allowed_user=$row[0]; $allowed_user=$row[0];
@@ -2734,7 +2735,7 @@ if ($function == 'agent_campaigns')
} }
else else
{ {
$stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_users='1' and user_level >= 8;"; $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and user_level >= 8;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$user_level = $row[0]; $user_level = $row[0];
@@ -2906,7 +2907,7 @@ if ($function == 'campaigns_list')
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit; exit;
} }
$stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 6 and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 7 and active='Y';";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$allowed_user=$row[0]; $allowed_user=$row[0];
@@ -2921,7 +2922,7 @@ if ($function == 'campaigns_list')
} }
else else
{ {
$stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_users='1' and user_level >= 8;"; $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and user_level >= 8;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$user_level = $row[0]; $user_level = $row[0];
@@ -3037,7 +3038,7 @@ if ($function == 'hopper_list')
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit; exit;
} }
$stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 6 and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1' and view_reports='1' and user_level > 7 and active='Y';";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$allowed_user=$row[0]; $allowed_user=$row[0];
@@ -3052,7 +3053,7 @@ if ($function == 'hopper_list')
} }
else else
{ {
$stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and modify_users='1' and user_level >= 8;"; $stmt="SELECT user_level,user_group from vicidial_users where user='$user' and vdc_agent_api_access='1' and user_level >= 8;";
$rslt=mysql_to_mysqli($stmt, $link); $rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt); $row=mysqli_fetch_row($rslt);
$user_level = $row[0]; $user_level = $row[0];