Added lead_search Non-Agent API function

git-svn-id: svn://192.168.202.10@3533 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-10-27 14:43:14 +00:00
parent 3f8d247c5b
commit cc26a700a7
3 changed files with 383 additions and 18 deletions
+42 -1
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2021-09-17
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2021-10-27
This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -45,6 +45,7 @@ lead_field_info - pulls the value of one field of a lead
lead_callback_info - outputs scheduled callback data for a specific lead
lead_all_info - outputs all lead data for a lead(optionally including custom fields)
lead_status_search - displays all field values of all leads that match the status and call date in request
lead_search - searches for leads in the vicidial_list table by phone numbers
ccc_lead_info - outputs lead data for cross-cluster-communication call
server_refresh - forces a conf file refresh on all telco servers in the cluster
check_phone_number - allows you to check if a phone number is valid and dialable
@@ -830,6 +831,46 @@ test_custom_field => new value
--------------------------------------------------------------------------------
lead_search - searches for leads in the vicidial_list table by phone numbers
NOTE: api user for this function must have user_level set to 7 or higher and "view reports" enabled and modify_leads set to 1-5
REQUIRED FIELDS-
phone_number - 6-19 digits(multiple separated by a comma ',', for example: 3125551212,9055551212,4075551212)
source - description of what originated the API call (maximum 20 characters)
SETTINGS FIELDS-
records - number of records to display in results if more than 1 found (defaults to '1000'[most recently inserted leads displayed first])
SETTINGS FIELDS-
header - include a header(YES) or not(NO). This is optional, default is not to include a header
NOTES-
- If no results are found for any of the searched phone numbers, then an error will be displayed
- If there are any matches found, every phone number searched for will have one line in the output, detailed below
- If more than 1 matching lead is found for a phone number, then the matching lead_ids will be separated by a dash '-'
Example URL strings for API calls:
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=lead_search&phone_number=9998885112,9998887112,9998886112,4075551212
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=lead_search&phone_number=9998885112,9055551212,9998886112,4075551212&header=YES
Example responses:
ERROR: lead_search USER DOES NOT HAVE PERMISSION TO SEARCH FOR LEADS - 6666|0
ERROR: lead_search NO VALID SEARCH METHOD - ||||
ERROR: lead_search NO MATCHES FOUND IN THE SYSTEM - ||||
A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
search_key|records_found|lead_ids
9998885112|4|1949076-1946517-1943958-1941399
9998887112|8|1946941-1946940-1946939-1946875-1946805-1946656-1946655-1944382
9998886112|1|1946891
4075551212|0|
--------------------------------------------------------------------------------
ccc_lead_info - outputs lead data for cross-cluster-communication call