Added ability to set scheduled callbacks through the non-agent-api in the add_lead and update_lead functions.

git-svn-id: svn://192.168.202.10@1730 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-09-29 01:27:48 +00:00
parent 82383bd1ef
commit d7b6cf4ea4
3 changed files with 278 additions and 5 deletions
+28 -2
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2011-08-21
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2011-09-28
This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -64,6 +64,7 @@ Changes:
110614-0726 - Added reset_lead option to update_lead function(issue #502)
110705-1928 - Added options for USACAN 4th digit prefix(no 0 or 1) and valid areacode filtering to add_lead
110821-2318 - Added update_phone, add_phone_alias, update_phone_alias functions
110928-2110 - Added callback options to add_lead and update_lead
@@ -291,7 +292,7 @@ source - description of what originated the API call (maximum 20 characters)
SETTINGS FIELDS-
dnc_check - Y, N or AREACODE, default is N
campaign_dnc_check - Y, N or AREACODE, default is N
campaign_id - 2-8 Character campaign ID, required if using campaign_dnc_check
campaign_id - 2-8 Character campaign ID, required if using campaign_dnc_check or callbacks
add_to_hopper - Y or N, default is N
hopper_priority - 99 to -99, the higher number the higher priority, default is 0
hopper_local_call_time_check - Y or N, default is N. Validate the local call time before inserting lead in the hopper
@@ -315,6 +316,12 @@ custom_fields - Y or N, default is N. Defines whether the API will accept custo
tz_method - <empty>, POSTAL or TZCODE, default is <empty> which will use the country code and areacode for time zone lookups
POSTAL relies on the postal_code field
TZCODE relies on the owner field being populated with a proper time zone code
callback - Y or N, default is N. Set this lead as a scheduled callback. campaign_id field is REQUIRED for callbacks
callback_status - 1-6 Character, callback status to use, default is CALLBK (vicidial_list status will be set to CBHOLD to lock)
callback_datetime - YYYY-MM-DD+HH:MM:SS, date and time of scheduled callback. REQUIRED if callback is set. NOW can be used for current datetime.
callback_type - USERONLY or ANYONE, default is ANYONE
callback_user - User ID the USERONLY callback is assigned to
callback_comments - Optional comments to appear when the callback is called back
(for fields with spaces in the values, you can replace the space with a plus + sign[address, city, first_name, etc...])
OPTIONAL FIELDS-
@@ -365,6 +372,7 @@ http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&functio
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=add_lead&phone_number=7275551212&phone_code=1&list_id=999&custom_fields=Y&favorite_color=blue
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=add_lead&phone_number=7275551111&campaign_id=TESTCAMP&callback=Y&callback_status=CALLBK&callback_datetime=NOW&callback_type=USERONLY&callback_user=6666&callback_comments=Comments+go+here
Example responses:
SUCCESS: add_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193715|-4
@@ -378,6 +386,10 @@ NOTICE: add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED - 7275551111|1234|10
NOTICE: add_lead MULTI-ALT-PHONE NUMBERS LOADED - 3|6666|193716
NOTICE: add_lead NOT ADDED TO HOPPER, OUTSIDE OF LOCAL TIME - 7275551111|6666|193716|-4|0
NOTICE: add_lead SCHEDULED CALLBACK ADDED - 1234|2011-09-29 12:00:01|TESTCAMP|6666|USERONLY|CALLBK
NOTICE: add_lead SCHEDULED CALLBACK NOT ADDED, USER NOT VALID - 1234|TESTCAMP|6|
NOTICE: add_lead SCHEDULED CALLBACK NOT ADDED, CAMPAIGN NOT VALID - 1234|XYZ
ERROR: add_lead INVALID PHONE NUMBER LENGTH - 72755|6666
ERROR: add_lead INVALID PHONE NUMBER PREFIX - 72755|6666
ERROR: add_lead INVALID PHONE NUMBER AREACODE - 72755|6666
@@ -436,6 +448,12 @@ no_update - Y or N, Setting this to Y will not perform any updates, but will in
you if a lead exists that matches the search criteria, default is N.
delete_lead - Y or N, Setting this to Y will delete the lead from the vicidial_list table, default is N.
reset_lead - Y or N, Setting this to Y will reset the called-since-last-reset flag of the lead, default is N.
callback - Y, N or REMOVE, default is N. Set this lead as a scheduled callback. REMOVE will delete the scheduled callback entry
callback_status - 1-6 Character, callback status to use, default is CALLBK (vicidial_list status will be set to CBHOLD to lock)
callback_datetime - YYYY-MM-DD+HH:MM:SS, date and time of scheduled callback. REQUIRED if callback is set. NOW can be used for current datetime.
callback_type - USERONLY or ANYONE, default is ANYONE
callback_user - User ID the USERONLY callback is assigned to
callback_comments - Optional comments to appear when the callback is called back
EDITABLE FIELDS-
user_field - 1-20 characters, this updates the 'user' field in the vicidial_list table
@@ -490,6 +508,8 @@ http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&functio
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_lead&lead_id=27&delete_lead=Y&custom_fields=Y
http://server/vicidial/non_agent_api.php?source=test&user=6666&pass=1234&function=update_lead&lead_id=406757&campaign_id=TESTCAMP&callback=Y&callback_status=CALLBK&callback_datetime=NOW&callback_type=USERONLY&callback_user=1028&callback_comments=Comments+go+here+again
Example responses:
SUCCESS: update_lead LEAD HAS BEEN UPDATED - 6666|193716
NOTICE: update_lead CUSTOM FIELDS VALUES UPDATED - 7275551111|1234|101
@@ -497,6 +517,12 @@ NOTICE: update_lead CUSTOM FIELDS NOT UPDATED, CUSTOM FIELDS DISABLED - 72755511
NOTICE: update_lead CUSTOM FIELDS NOT UPDATED, NO CUSTOM FIELDS DEFINED FOR THIS LIST - 7275551111|1234|101
NOTICE: update_lead CUSTOM FIELDS NOT UPDATED, NO FIELDS DEFINED - 7275551111|1234|101
NOTICE: update_lead SCHEDULED CALLBACK UPDATED - 1234|2011-09-29 12:00:01|TESTCAMP|6666|USERONLY|CALLBK
NOTICE: update_lead SCHEDULED CALLBACK NOT UPDATED, NO FIELDS SPECIFIED - 1234|
NOTICE: update_lead SCHEDULED CALLBACK ADDED - 1234|2011-09-29 12:00:01|TESTCAMP|6666|USERONLY|CALLBK
NOTICE: update_lead SCHEDULED CALLBACK NOT ADDED, USER NOT VALID - 1234|TESTCAMP|6|
NOTICE: update_lead SCHEDULED CALLBACK NOT ADDED, CAMPAIGN NOT VALID - 1234|XYZ
NOTICE: update_lead NO MATCHES FOUND IN THE SYSTEM - 6666|4567|897654327|7275551212
SUCCESS: update_lead LEAD HAS BEEN ADDED - 7275551111|6666|999|193716|-4