- Constant Contact Community
- :
- Developer Community
- :
- Getting Started with API's
- :
- The remote server returned an error: (400) Bad Req...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
The remote server returned an error: (400) Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-31-2011 05:32 PM
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="http://www.w3.org/2005/Atom">
<title type="text" />
<updated>2008-07-23T14:21:06.407Z</updated>
<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>sds@yahoo.com</EmailAddress>
<FirstName />
<MiddleName />
<LastName />
<HomePhone />
<Addr1 />
<Addr2 />
<Addr3 />
<City />
<StateCode />
<StateName />
<PostalCode />
<SubPostalCode />
<CountryCode />
<CompanyName />
<JobTitle />
<WorkPhone />
<EmailType>HTML</EmailType>
<OptInSource>ACTION_BY_CONTACT</OptInSource>
<Note />
<CustomField1 />
<CustomField2 />
<CustomField3 />
<CustomField4 />
<CustomField5 />
<CustomField6 />
<CustomField7 />
<CustomField8 />
<CustomField9 />
<CustomField10 />
<CustomField11 />
<CustomField12 />
<CustomField13 />
<CustomField14 />
<CustomField15 />
<ContactLists>
<ContactList id="http://api.constantcontact.com/ws/customers/Acuity
</ContactLists>
</Contact>
</content>
</entry>
Please let me know what is the issue?
Thanks
Acuity Team
Re: The remote server returned an error: (400) Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2011 07:20 AM
Your XML looks like it is meant to create a single contact (sds@yahoo.com) 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="http://api.constantcontact.com/ws/customers/Acuity
instead of:
<ContactList id="http://api.constantcontact.com/ws/customers/Acuity
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
Connection Closed Error.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-01-2011 04:56 PM
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
Thanks
API not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-02-2011 07:17 AM
Hello,
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.
Regards,
NOC Analyst
Constant Contact
Re: The remote server returned an error: (400) Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-05-2012 03:49 AM
Hi All,
I'm getting 400 Bad request error when I using POST method to add new contact. Here is my XML:
<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>hien@yahoo.com</EmailAddress>
<FirstName>hien</FirstName>
<MiddleName></MiddleName>
<LastName>hien</LastName>
<HomePhone></HomePhone>
<Addr1>123</Addr1>
<Addr2></Addr2>
<Addr3></Addr3>
<City>tp</City>
<StateCode></StateCode>
<StateName></StateName>
<PostalCode></PostalCode>
<SubPostalCode></SubPostalCode>
<CountryCode>vn</CountryCode>
<CompanyName></CompanyName>
<JobTitle></JobTitle>
<WorkPhone></WorkPhone>
<EmailType>HTML</EmailType>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<Note></Note>
<CustomField1>1</CustomField1>
<CustomField2>2</CustomField2>
<CustomField3>3</CustomField3>
<CustomField4>4</CustomField4>
<CustomField5>5</CustomField5>
<CustomField6>6</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/hienbt
</ContactLists></Contact>
</content></entry>
What am I missing?
Thanks!
Re: The remote server returned an error: (400) Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-05-2012 08:11 AM
Hello,
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 webservices@constantcontact.com for us to take a look at.
Let me know if you have any questions. Thanks!
Support Engineer
Re: The remote server returned an error: (400) Bad Request
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-05-2012 10:58 PM
Hi Nick_G
Thanks for help from you.
I using https://api.constantcontact.com/ws/customers/hienb
Re: The remote server returned an error: (400) Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-08-2012 11:38 PM
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?
Thanks!
Re: The remote server returned an error: (400) Bad Request
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-09-2012 09:24 AM
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.
Product Manager, Constant Contact


