The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Getting 400 Bad Request error while adding a contact using trial version

Highlighted
New Member

Getting 400 Bad Request error while adding a contact using trial version

Hi ,

 This is my xml to create new contact.

 

<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"> </title>

<updated>2011-07-26T14: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>tnichols001@aol.com</EmailAddress>
<FirstName>Tracy</FirstName>

<LastName>Roloff</LastName>

<EmailType>HTML</EmailType>

<OptInSource>ACTION_BY_CUSTOMER
</OptInSource>
<ContactLists>

<ContactList id="http://api.constantcontact.com/ws/customers/hudsonhorizons/lists/2"/>
</ContactLists>

</Contact>

</content>

</entry>

 

I am getting 400 bad request error. I can see one contact which is my account using "GetContactCollection".

Any help is greatly appreciated. I am posting to "https://api.constantcontact.com/ws/customers/hudsonhorizons/contacts" and using "POST" method. I am using trial version.

Thanks in advance,

Veena

1 REPLY 1
Highlighted
Regular Advisor

Re: Getting 400 Bad Request error while adding a contact using trial version

Hi Veena,

 

Try moving the </OptInSource> closing tag up a line and see if it helps. Here is what it would look like:

 

<OptInSource>ACTION_BY_CUSTOMER</OptInSource>

 

Let us know if that fixes the issue.

 

Regards,

Richard Maxwell
Support Engineer, Constant Contact
Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured