We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

400 status code with update of contact

Regular Participant

400 status code with update of contact



We are using the xml V1 of the API, and the C# dot net library linked on your site here https://community.constantcontact.com/t5/Documentation/V1-XML-API-Documentation/ba-p/25125.


I have seen it work fine before but now we are getting a 400 response from the constant contact server when we send a request. Below is the format of our xml request, the request object's content type is being set as "application/atom+xml", as well as its accept property. Any ideas on what the issue could be?


Example request:

<entry xmlns="http://www.w3.org/2005/Atom">
    <title type="text"></title>
        <name>Constant Contact</name>
    <summary type="text">Contact</summary>
    <content type="application/vnd.ctct+xml">
        <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/{redacted}/contacts/10749">
                <ContactList id="http://api.constantcontact.com/ws/customers/{redacted}/lists/2" />



I formatted your response to remove personal information.  Looking at the payload, there doesn't appear to be any errors in the formatting or data.  Can you share the response body that we're returning with the 400 error message? 

Dave Berard
Senior Product Manager, Constant Contact
Regular Participant

Hi Dave,

Thanks for your quick reply. Here is the response from the server.


"Error 400: Received Bad HttpResponse: 409 Conflict ActiveRecord::JDBCError: Column 'contact_id' cannot be null: INSERT INTO `service_addresses` (`account_id`, `address`, `contact_id`, `create_source`, `created_at`, `deleted_at`, `kind`, `service_address_id`, `sort_order`, `type`, `update_source`, `updated_at`) VALUES (1105491688575, '314-919-1800', NULL, 'A', '2014-03-26 20:23:59', NULL, 'work', x'9028cd10b52411e38141d4ae52a68661', 0, 'PhoneNumber', 'A', '2014-03-26 20:23:59')"


It says the contact id is null, is this not the correct contact id?



We are storing your contactid once we search on an email through the api and get the contact record. That way when we want to access the contact in the future we can just go strait to it using the api, instead of searching for the email using the api which appears to perform slower.


In an unrelated topic is there a way to get the contact id's from you guys when we export data?


Thanks, very surprising response there.  That is definitely an internal exception that we shouldn't be sharing out to you.  Will need to look into this on our side.  Will update when we have more to share.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page