Added add_list and update_list functions to the Non-Agent API, allowing you to add, modify and delete lists, as well as reset leads in a list, change a list to active or inactive, change the campaign of a list and delete the leads inside of a list.

git-svn-id: svn://192.168.202.10@1614 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-03-06 15:52:54 +00:00
parent 3939276642
commit 3206159d95
3 changed files with 681 additions and 6 deletions
+102 -2
View File
@@ -24,6 +24,8 @@ recording_lookup - looks up recordings based upon user and date or lead_id
did_log_export - exports all calls inbound to a DID for one day
add_user - adds a user to the system
add_phone - adds a phone to the system
add_list - adds a list to the system
update_list - updates list settings in the system, reset leads in list, delete list
@@ -50,6 +52,7 @@ Changes:
101117-1104 - Added callback and custom field entry delete to delete_lead option
101206-2126 - Added recording_lookup and did_log_export functions
110127-2245 - Added add_user and add_phone functions
110306-1044 - Added add_list and update_list functions
@@ -482,8 +485,6 @@ ERROR: update_lead NO VALID SEARCH METHOD - 6666|SYSTEM|||
ERROR: update_lead USER DOES NOT HAVE PERMISSION TO UPDATE LEADS IN THE SYSTEM - 6666|0
ERROR: NO FUNCTION SPECIFIED
@@ -563,3 +564,102 @@ ERROR: add_phone YOU MUST USE A VALID TIMEZONE - 6666|-5
SUCCESS: add_phone PHONE HAS BEEN ADDED - 6666|cc100|10.0.9.8|SIP|100
--------------------------------------------------------------------------------
add_list - adds a list to the system
REQUIRED FIELDS-
list_id - 2-14 digits
list_name - 6-30 characters
campaign_id - 2-8 characters, must be a valid campaign_id
OPTIONAL FIELDS-
active - Must be one of these: 'Y','N', will default to 'N'
outbound_cid - 6-20 digits
script - 1-10 characters, must be a valid script
am_message - 2-100 characters
drop_inbound_group - 1-10 characters, must be a valid in-group
web_form_address - 6-100 characters
web_form_address_two - 6-100 characters
Example URL strings for API calls:
http://server/vicidial/non_agent_api.php?source=test&function=add_list&user=6666&pass=1234&list_id=1101&list_name=Test+API+list&campaign_id=TESTCAMP
http://server/vicidial/non_agent_api.php?source=test&function=add_list&user=6666&pass=1234&list_id=1101&list_name=Test+API+list&campaign_id=TESTCAMP&active=N&outbound_cid=7275551212&script=DEMOSCRIPT&am_message=8304&drop_inbound_group=SALESLINE&web_form_address=http://www.vicidial.org/?testing=hghg
Example responses:
ERROR: add_list USER DOES NOT HAVE PERMISSION TO ADD LISTS - 6666|0
ERROR: add_list YOU MUST USE ALL REQUIRED FIELDS - 6666|1000||
ERROR: add_list CAMPAIGN DOES NOT EXIST - 6666|TESTCIMP
ERROR: add_list LIST ALREADY EXISTS - 6666|1101
ERROR: add_list SCRIPT DOES NOT EXIST, THIS IS AN OPTIONAL FIELD - 6666|TESTSCRIPT
ERROR: add_list IN-GROUP DOES NOT EXIST, THIS IS AN OPTIONAL FIELD - 6666|TEST_IN8
SUCCESS: add_list LIST HAS BEEN ADDED - 6666|1101|TESTCAMP
--------------------------------------------------------------------------------
update_list - updates list information in the vicidial_lists table
REQUIRED FIELDS-
list_id - must be all numbers, 2-14 digits
source - description of what originated the API call (maximum 20 characters)
SETTINGS FIELDS-
insert_if_not_found - Y or N, will attempt to insert as a new list if no match is found, default is N.
If list is not found, the function will change to add_list and be processed in that way
reset_list - Y or N, Setting this to Y will reset the Called-Since-Last-Reset flag for all of the leads in this list, default is N.
delete_list - Y or N, Setting this to Y will delete the list from the vicidial_lists table, default is N.
delete_leads - Y or N, Setting this to Y will delete all of the leads with this list_id from the vicidial_list table, default is N.
EDITABLE FIELDS-
list_name - 6-30 characters
campaign_id - 2-8 characters, must be a valid campaign_id
active - Must be one of these: 'Y','N', will default to 'N'
outbound_cid - 6-20 digits
script - 1-10 characters, must be a valid script
am_message - 2-100 characters
drop_inbound_group - 1-10 characters, must be a valid in-group
web_form_address - 6-100 characters
web_form_address_two - 6-100 characters
NOTES:
- in order to set a field to empty('') set it equal to --BLANK--, i.e. "&drop_inbound_group=--BLANK--"
- please use no special characters like apostrophes, quotes or amphersands
Example URL strings for API calls:
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_list&list_id=1101&list_name=Updated+test+API+list
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_list&list_id=1101&active=N
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_list&list_id=1102&active=N&insert_if_not_found=Y&list_name=Updated+test+API+list&campaign_id=TESTCAMP&outbound_cid=7275551212&script=DEMOSCRIPT&am_message=8304&drop_inbound_group=SALESLINE&web_form_address=http://www.vicidial.org/?testing=hghg
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_list&list_id=1102&reset_list=Y
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_list&list_id=1102&delete_list=Y&delete_leads=Y
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_list&list_id=1102&campaign_id=ASTRICON
Example responses:
ERROR: update_list USER DOES NOT HAVE PERMISSION TO UPDATE LISTS - 6666
ERROR: update_list YOU MUST USE ALL REQUIRED FIELDS - 6666|1
NOTICE: update_list LIST DOES NOT EXIST, SENDING TO add_list FUNCTION - 6666|1000
ERROR: update_list LIST DOES NOT EXIST - 6666|1000
ERROR: update_list CAMPAIGN DOES NOT EXIST, THIS IS AN OPTIONAL FIELD - 6666|TESTCIMP
ERROR: update_list SCRIPT DOES NOT EXIST, THIS IS AN OPTIONAL FIELD - 6666|TESTSCRIPT
ERROR: update_list IN-GROUP DOES NOT EXIST, THIS IS AN OPTIONAL FIELD - 6666|TEST_IN8
ERROR: update_list LIST NAME MUST BE FROM 6 TO 30 CHARACTERS, THIS IS AN OPTIONAL FIELD - 6666|test
ERROR: update_list ACTIVE MUST BE Y OR N, THIS IS AN OPTIONAL FIELD - 6666|U
ERROR: update_list OUTBOUND CID MUST BE FROM 6 TO 18 DIGITS, THIS IS AN OPTIONAL FIELD - 6666|12345
ERROR: update_list ANSWERING MACHINE MESSAGE MUST LESS THAN 101 DIGITS, THIS IS AN OPTIONAL FIELD - 6666|123...
NOTICE: update_list NO UPDATES DEFINED - 6666|
SUCCESS: update_list LIST HAS BEEN UPDATED - 6666|1101
NOTICE: update_list LEADS IN LIST HAVE BEEN RESET - 6666|1101|324
NOTICE: update_list USER DOES NOT HAVE PERMISSION TO DELETE LISTS - 6666|0
NOTICE: update_list LIST HAS BEEN DELETED - 6666|1101|1
NOTICE: update_list USER DOES NOT HAVE PERMISSION TO DELETE LEADS - 6666|0
NOTICE: update_list LEADS IN LIST HAVE BEEN DELETED - 6666|1101|324
ERROR: NO FUNCTION SPECIFIED