The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

400 error code and adding in contacts

Highlighted
Participant

400 error code and adding in contacts

Greetings. Two questions on use with the api. The first is dealing with the api and activityType of SV_ADD. It seems like this can be rather flaky when adding in multiple fields with multiple people. For example I have had to switch from using "Zip/Postal Code" to just "Postal Code" to get it to work for that element. I'm wondering if there are other changes I should make in regard to "US State/CA Provice", "Other State/Province" and Sub Zip/Postal Code" ? Along these same lines I'm wondering if there is ANY way to get more info than the dreaded "400 Bad Request".  Information on WHY this is a bad request would be so helpful...


Thanks,


Craig Baugh

3 REPLIES 3
Highlighted
Frequent Participant

According to the docs below

According to the docs below is the fieldnames you get with an export so importing will use the same:


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, STATE/PROVINCE (US/CANADA), COUNTRY, POSTAL CODE, SUB POSTAL CODE, CUSTOM FIELD 1, CUSTOM FIELD 2, CUSTOM FIELD 3, CUSTOM FIELD 4, CUSTOM FIELD 5, CUSTOM FIELD 6, CUSTOM FIELD 7, CUSTOM FIELD 8, CUSTOM FIELD 9, CUSTOM FIELD 10, CUSTOM FIELD 11, CUSTOM FIELD 12, CUSTOM FIELD 13, CUSTOM FIELD 14, CUSTOM FIELD 15


I think you may have copied the fieldname from the constantocntact.com website rather than the developer docs?


 

James Benson, PHP Developer.


Constant Contact Services: http://integrationservic.es/

Highlighted
Participant

I think you are correct

I switched to using these fieldnames and things are working much, much better. Thanks for the info. Now if I could just get more info from a 400 I'd be in business!

Highlighted
Moderator

Hi Craig,   I did some

Hi Craig,


 


I did some testing on my account and was able to retrieve error messages via the REST client we recommend.  They provided me with details like the following:


Error 400: No activityType specified (I had a space before activityType so it messed up the encoded URI)


Error 400: Bad value(s) for parameter 'lists' found: http://api.constantcontact.com/ws/customers/joesflowers/lists/209 (I used a List ID that doesn't exist in my account)


Error 400: Bad upload data (I used an invalid field name of First+Last)

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured