- Constant Contact Community
- :
- Developer Community
- :
- Getting Started with API's
- :
- Code Samples: .NET (C#) Sample Forms Error 400: Ba...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Code Samples: .NET (C#) Sample Forms Error 400: Bad Request
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2011 10:27 AM
I do apologize as I know this has been asked before, however I am relatively new to the API and am not sure what may be wrong in my xml.
I downloaded the Sample Forms, and just tried simply adding a contact out of the box. I plugged in my API key and it retrieves my lists so I know it is connecting. However, when I click add, I get 'The remote server returned and error. (400) Bad Request.'
Here is my xml, pretty simple:
<entry xmlns=\"http://www.w3.org/2005/Atom\"> <title type=\"text\"></title> <updated>2008-07-23T14:21:06.407Z</updated> <author></author> <id>data:,none</id> <summary type=\"text\">Contact</summary> <content type=\"application/vnd.ctct+xml\"> <Contact xmlns=\"http://ws.constantcontact.com/ns/1.0/\"> <EmailAddress>john@doe.com</EmailAddress> <FirstName>John</FirstName> <MiddleName></MiddleName> <LastName>Doe</LastName> <HomePhone></HomePhone> <Addr1></Addr1> <Addr2></Addr2> <Addr3></Addr3> <City></City> <StateCode></StateCode> <StateName></StateName> <PostalCode></PostalCode> <SubPostalCode></SubPostalCode> <CountryCode></CountryCode> <CompanyName></CompanyName> <JobTitle></JobTitle> <WorkPhone></WorkPhone> <EmailType>HTML</EmailType> <Note></Note> <CustomField1></CustomField1> <CustomField2></CustomField2> <CustomField3></CustomField3> <CustomField4></CustomField4> <CustomField5></CustomField5> <CustomField6></CustomField6> <CustomField7></CustomField7> <CustomField8></CustomField8> <CustomField9></CustomField9> <CustomField10></CustomField10> <CustomField11></CustomField11> <CustomField12></CustomField12> <CustomField13></CustomField13> <CustomField14></CustomField14> <CustomField15></CustomField15> <ContactLists> <ContactList id=\"http://api.constantcontact.com/ws/customers/myaccountname/lists/1\"/> <ContactList id=\"http://api.constantcontact.com/ws/customers/myacco untname/lists/11\"/> </ContactLists> </Contact> </content> </entry>"
What am I missing? Thanks!
Solved! Go to Solution.
Re: Code Samples: .NET (C#) Sample Forms Error 400: Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2011 11:49 AM
Hi Todd,
You are missing a node:
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
See this link for all required nodes.
Associate Product Manager for EventSpot
Re: Code Samples: .NET (C#) Sample Forms Error 400: Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-20-2011 02:22 PM
That was it, thank you!


