Error 400: Bad Request

Highlighted
New Member

Error 400: Bad Request

Hi, i am receiving Error 400 from the server while posting a new contact (The remote server returned an error: (400) Bad Request.)


The XML is:


<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>gigi@gelu.com</EmailAddress>

  <FirstName />

  <MiddleName />

  <LastName>Bouzek</LastName>

  <HomePhone />

  <Addr1 />

  <Addr2 />

  <Addr3 />

  <City />

  <StateCode />

  <StateName />

  <PostalCode />

  <SubPostalCode />

  <CountryCode />

  <CompanyName />

  <JobTitle />

  <WorkPhone />

  <EmailType>HTML</EmailType>

  <OptInSource>ACTION_BY_CUSTOMER</OptInSource>

  <Note />

  <CustomField1>District of Delaware</CustomField1>

  <CustomField2>XXXXX</CustomField2>

  <CustomField3>YYYYY</CustomField3>

  <CustomField4 />

  <CustomField5>09-12019 (CSS)</CustomField5>

  <CustomField6 />

  <CustomField7>09/10/2010</CustomField7>

  <CustomField8>92a275ef02c64e04a9ff0dd3059c5b48</CustomField8>

  <CustomField9>GIGEL</CustomField9>

  <CustomField10>Ms.</CustomField10>

  <CustomField11 />

  <CustomField12 />

  <CustomField13 />

  <CustomField14 />

  <CustomField15 />

 <ContactLists>

  <ContactList id="http://api.constantcontact.com/ws/customers/claimsrecovery/lists/General Interest" />

  </ContactLists>

  </Contact>

  </content>

  </entry>


Also, i would like to send a batch of more than one contacts (either new or updates) instead of sending them one by one. Is this possible?


 


Thank you

6 REPLIES 6
Highlighted
CTCT Employee

Posting a Contact

Hello,



I have looked over your XML and I believe you are getting the 400 error because of the way you have the List node. The list URI has to lead to the lists actual LIST ID, not the name of the list.



Usually, your General Interest list is list 1, so instead of what you have, the list would be http://api.constantcontact.com/ws/customers/(USERNAME)/lists/1.



If you have any questions please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Member

Re: Posting a Contact

How do you know what the List ID is?  Is it the same as Order?   (i.e. if I change the order of the lists, am I changing the list's ID too?)

 

Highlighted
CTCT Employee

Re: Posting a Contact

Hey,

 

You can get the list-id by doing a get to your list collections.  You can find out more about this here.

 

Please let me know if this helps.

Ryan Davis
Quality Engineer
Highlighted
Member

Re: Posting a Contact

Thank you for your prompt answer!

 

OK I used RestClient to get the information so it was relatively painless.  :-)

 

Thanks for the help!  Got the correct ID now.  But if you just display the ID on the website, that would probably be a handy thing to be able to see.

 

Highlighted
Member

Re: Posting a Contact

To get the id of a list in the admin you can just mouse over the list name link and look at the url in the browser status bar.

Highlighted
New Member

Re: 400 error

Thank you, it worked.

Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured