I am getting a Bad Upload Data error when I try to send bul contacts using the C# Wrapper. I have included the JSON it creates for the submission. Please let me know if you see anything that may be causeing the problem. Thanks.
{"column_names":["EMAIL","FIRST NAME","MIDDLE NAME","LAST NAME","JOB TITLE","COMPANY NAME","WORK PHONE","HOME PHONE","ADDRESS LINE 1","ADDRESS LINE 2","ADDRESS LINE 3","CITY","STATE","ZIP\/POSTAL CODE"],"
import_data":[{"addresses":[{"city":"Edmonton","line1":"11111 11 Avenue NW","line2":"","line3":"","postal_code":"S0S 0S0","state_code":"AB"}],"company_name":"Mr. Gant Bans","custom_fields":[],"email_addresses":["gant.bans@c.ca"],"first_name":"Gant","job_title":"Sales","last_name":"Bans","work_phone":"(555) 555-5555ext. "},{"addresses":[{"city":"Edmonton","line1":"10050 Jasper Avenue NW","line2":"","line3":"","postal_code":"T5J 1V7","state_code":"AB"}],"company_name":"Bank of Nova Scotia","custom_fields":[],"email_addresses":["Joe@email.com"],"first_name":"Joe","job_title":"Senior Account Manager","last_name":"Ko","work_phone":"(555) 555-5555ext. "}],"lists":["1","49"]}
Hello,
After testing your JSON, I found there was a carraige return immediately before the "import_data" in your post that caused my first attempt to verify your JSON to fail. However, once I corrected that issue your JSON was accepted without any issue. If you are still experiencing this issue, it may be helpful if you can send us an email at webservices@constantcontact.com with a snippet of, or the full code responsible for generating this JSON. This way we can look into the cause of the issue, since I was unable to replicate it by submitting the JSON through a REST client.
Sincerely,
Elijah G.
API Support Specialist
Hi,
I am using the C# wrapper to send the data. The method being called is CreateAddContactsActivity. I stepped in to the method while debugging to get the JSON. It looks like it is using a system method to serialize the JSON. So, I am not sure where teh carraige return came from.
Hello,
Thanks for the info about the C# wrapper! Would it be possible to send to webservices@constantcontact.com the code which is being used to create the AddContacts object and the AddContactsImportData which is used to populate it? If so, I may be able to find the source of the issue for you.
Sincerely,
Elijah G.
API Support Specialist
Hi Elijah,
Thanks for looking into this for me. I have sent in the code you requested. As well, I did some more testing and was able to isolate the issue. The carriage return from previous must have been introduced by me when I was reviewing the JSON string. In my other tests, there was no carriage return. Sorry about that.
What I did find, though, is that there appears to be an issue if you try to pass a value for the postal code. Putting any value in that parameter results in an error. Hope that helps.
Best regards,
Cory
Hello,
I sent you an email back with some more info. Looking forward to hearing back from you!
Sincerely,
Elijah G.
API Support Specialist