Developer & API Support
Regular Visitor
Posts: 2
Registered: ‎03-09-2012
Accepted Solution

Adding New Contact Record: 400 Error

[ Edited ]

Hello! I'm a developer trying to build a simple add contact script in .NET. (I'm talking about a brand-new contact here, not about adding an existing contact to a contact list.)  I'm authenticating fine using basic HTTPS, but I'm getting a 400 error every time I try to send new contact XML. According to the documentation, that means my XML is probably ill-formed, but I built my code based on the sample ASP.NET signup form project on SourceForge (  Can someone please take a look and tell me what I'm missing?


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


Posts: 30
Topics: 0
Kudos: 1
Solutions: 3
Registered: ‎02-15-2011

Re: Adding New Contact Record: 400 Error

[ Edited ]

Hi Stephen,


I notice in your XML that many of the tags are all lower-case. However, XML is case sensitive. So, for example, you have <optinsource>, but the correct casing is <OptInSource>. Our XML elements are camel cased.



Richard Maxwell
Support Engineer, Constant Contact
Regular Visitor
Posts: 2
Registered: ‎03-09-2012

Re: Adding New Contact Record: 400 Error

Thank you sincerely!  I'm not sure how some of the tags got that way, since I literally copy-pasted right out of the sample project.  But sure enough, the sample project had good capitalization and my code did not.  (I think maybe it was because, to start with, I commented out those particular lines of code... maybe Visual Studio did something crazy, or else I accidently hit some other shortcut while those lines were highlighted).


In any case, I fixed the capitalization and now I'm set.  Thanks for your help!