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.

The requested URL returned error: 400


The requested URL returned error: 400

I noticed that existing contacts (by email search) were not getting updated thorugh the API.

Here is my XML request:


<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
        <name>CTCT Samples</name>
    <summary type="text">Customer document</summary>
    <content type="application/vnd.ctct+xml">
        <Contact xmlns="http://ws.constantcontact.com/ns/1.0/">Customer document<EmailAddress>myemail@mycomp.tld</EmailAddress>
            <Addr1>101 N Way</Addr1>
            <City>My City</City>
                <ContactList id="http://api.constantcontact.com/ws/customers/myclient/lists/3"/>
                <ContactList id="http://api.constantcontact.com/ws/customers/myclient/lists/8"/>
                <ContactList id="http://api.constantcontact.com/ws/customers/myclient/lists/21"/>
                <ContactList id="http://api.constantcontact.com/ws/customers/myclient/lists/3"/>
                <ContactList id="http://api.constantcontact.com/ws/customers/myclient/lists/8"/>
                <ContactList id="http://api.constantcontact.com/ws/customers/myclient/lists/21"/>
                <ContactList id="https://api.constantcontact.com/ws/customers/myclient/lists/1"/>

For which I'm getting a 400 error.


The requested URL returned error: 400

Can anyone see where I'm going wrong?





I want to start by apologizing for my delay in getting back to you on this. Based on the XML that you have provided, I can see a few potential issues:


1. You have a single contact list ID that begins with https:// while the format for the ID URIs is to begin with http://

2. Your StateCode field element contains the word State rather than a valid two-character state code (Such as MA)

2a. Your StateName field should contain the matching full name of the state specified in the StateCode field (Such as Massachusetts)

3. You have specified the same lists (3,8,21) twice in your request. They should only listed once per unique list ID.


Hopefully this is enough information to help you get this issue sorted out. If these items do not provide enough information to get this request working, you will want to make sure that you capture the HTTP Response text when you receive a 400 error. This response text will contain an error message describing what the problem is and may provide enough information to correct the problem.


Best Regards,

Elijah G.
API Support Engineer
Developer Portal

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

Visit Page