400 Bad Request


400 Bad Request

We have some code that worked a few weeks ago and is now returning 400 errors. I'm wondering why and if anything has changed on your end.

Ruby code from isolated example (using constant_contact gem):

ConstantContact::Contact.new(:email_address => "spam@freerobby.com", :first_name => "Robby", :last_name => "Grossman").save

Here's the encoded/generated XML:

<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"> </title>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/"><LastName>Grossman</LastName><EmailAddress>spam@freerobby.com</EmailAddress><FirstName>Robby</FirstName><OptInSource>ACTION_BY_CUSTOMER</OptInSource><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/oneforty/lists/1"/></ContactLists></Contact>



Your XML looks perfectly fine to me, and successfully created a contact in my account. I did notice however that you referenced list id 1, and it looks like you only have a list id 2 in your account.  This may have happened if you erased your initial list and created a new one.


You can obtain a listing of all contact lists in your account by performing a get on https://api.constantcontact.com/ws/customers/{user-name}/lists. For more information, please see Getting a Listing of Contact Lists.

David J

Developer Portal

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

Visit Page