We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

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

HudsonH
Participant

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
Richard_M
Member

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