Non-Agent API update_lead "INVALID DATA FOR LEAD INSERTION"
Posted: Mon Apr 06, 2020 12:00 pm
Hey guys, I have a script I wrote that's importing leads into our VICIdial system, and I'm getting the error above, and I can't quite figure out why.
VERSION: 2.14-673a
BUILD: 180512-2217
(old, I know)
Here's an example of the call I'm using:
If you want an example with actual dummy data to see how I'm formatting things:
And the response I'm getting (with the dummy data above):
The script is updating existing leads just fine, so I don't really know why it's not liking the data for inserting a new lead. I just don't see what it's not liking, I'm guessing it's the empty column after the '1' in the response, but I don't know what these columns are supposed to be, and I can't find clear documentation of it anywhere. So if someone can provide me with some insight on what's wrong here, I'd really appreciate it, thank you.
VERSION: 2.14-673a
BUILD: 180512-2217
(old, I know)
Here's an example of the call I'm using:
- Code: Select all
http://<ip>/vicidial/non_agent_api.php?source=mailerrecycler&user=<user>&pass=<pass>&function=update_lead&insert_if_not_found=Y&search_method=VENDOR_LEAD_CODE_PHONE_NUMBER&search_location=LIST&records=1&vendor_lead_code=<vendor_lead_code>&phone_number=<phone_number>&first_name=<first_name>&last_name=<last_name>&address1=<address1>&city=<city>&state=<state>&postal_code=<postal_code>&security_phrase=<security_phrase>&list=<list>&title=<title>&phone_code=1&status=NEW
If you want an example with actual dummy data to see how I'm formatting things:
- Code: Select all
http://127.0.0.1/vicidial/non_agent_api.php?source=pythonscript&user=1234&pass=password&function=update_lead&insert_if_not_found=Y&search_method=VENDOR_LEAD_CODE_PHONE_NUMBER&search_location=LIST&records=1&vendor_lead_code=18675309&phone_number=1234567890&first_name=John&last_name=Doe&address1=1234+56th+St+Apt+9Z&city=Utopia+City&state=CA&postal_code=12345&security_phrase=Bert+Borta&list=1234&title=XYZ&phone_code=1&status=NEW
And the response I'm getting (with the dummy data above):
Response code: <Response [200]>
['NOTICE: update_lead NO MATCHES FOUND IN THE SYSTEM: ', '1234', '', '18675309', '1234567890\nERROR: update_lead INVALID DATA FOR LEAD INSERTION - 1234', '1234567890', '1', '', 'Y\n']
The script is updating existing leads just fine, so I don't really know why it's not liking the data for inserting a new lead. I just don't see what it's not liking, I'm guessing it's the empty column after the '1' in the response, but I don't know what these columns are supposed to be, and I can't find clear documentation of it anywhere. So if someone can provide me with some insight on what's wrong here, I'd really appreciate it, thank you.