In recognition of Martin Luther King Day, our Support Centers will be open with limited hours on Monday (1/18) from 10AM ET to 6PM ET. Visit our Help Center to see all of the ways you can find answers to your questions.

The remote server returned an error: (400) Bad Request

Occasional Participant

The remote server returned an error: (400) Bad Request

Hi All,

I am trying to add new contact into Contact List through using c# sample code. I am able to get Contact list and when i try to add new contact into existing optin list then it throw error "The remote server returned an error: (400) Bad Request"

Here is the request which i am sending it

  <entry xmlns="">

  <title type="text" />


  <author />


  <summary type="text">Contact</summary>

  <content type="application/vnd.ctct+xml">

  <Contact xmlns="">


  <FirstName />

  <MiddleName />

  <LastName />

  <HomePhone />

  <Addr1 />

  <Addr2 />

  <Addr3 />

  <City />

  <StateCode />

  <StateName />

  <PostalCode />

  <SubPostalCode />

  <CountryCode />

  <CompanyName />

  <JobTitle />

  <WorkPhone />



  <Note />

  <CustomField1 />

  <CustomField2 />

  <CustomField3 />

  <CustomField4 />

  <CustomField5 />

  <CustomField6 />

  <CustomField7 />

  <CustomField8 />

  <CustomField9 />

  <CustomField10 />

  <CustomField11 />

  <CustomField12 />

  <CustomField13 />

  <CustomField14 />

  <CustomField15 />


  <ContactList id=" Contact List" />






Please let me know what is the issue?



Acuity Team



Your XML looks like it is meant to create a single contact ( rather than a Contact List itself. In order for the XML above to create a contact, you would just need to modify your <ContactList> id to use the list id rather than the name of the list.

For example:

<ContactList id="" />


instead of:

<ContactList id=" Contact List" />


You can find the id of any of your lists from the Lists collection.


I hope this helps, please let me know if you have any questions or concerns regarding this. Thank you.

David J

Regular Participant

Hi All,

I'm getting 400 Bad request error when I using POST method to add new contact. Here is my XML:

<entry xmlns="">
<title type="text"></title>
<summary type="text">Contact</summary>
<content type="application/vnd.ctct+xml">
<Contact xmlns="">
<ContactLists><ContactList id=""/>

What am I missing?



What is the URL that you are POSTing the information to? Also, is there any body returned with your 400 error?


I would also suggest that you take a look at running RESTclient. You can run the same XML through this program, then if you receive the same error, you can save your request as a .RCQ file and email it to for us to take a look at.


Let me know if you have any questions. Thanks!

Nick Galbraith
Support Engineer
Regular Participant

Hi Nick_G

 Thanks for help from you.

I using to POST . Cause my data is wrong enter, I fixed it .

Regular Participant

Hi Nick_G

I'm trying to add new contact into Contact List A, but this contact had existed in Contact List B through using c# sample code. So, it appear error 409
How do to solve this issue?



Once a Contact is created, all subsequent changes must be done using update requests.  In the C# wrapper, this should be done using updateContact() method in the Utility.  You would need to do a getContact request by either the ID or the Email Address and then update the Contact to change their information. 

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

Thanks for reply, Today i am trying to run my application again but i am getting error "The underlying connection was closed: The connection was closed unexpectedly."

Same code was working yestarday, Please let me know what is the issue

My Login Account Id = AcuityTest





Yesterday our API servers were temporarily down for a period between 12:50pm and 6:00pm. During that time you would have received errors such as that.

It should be working fine now, if you are still running into issues after this, please let us know here.


Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page