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.

400 Error

Highlighted
Occasional Participant

400 Error

 I have been testing my API calls with a test account and everything seemed to be working well.


I switched over to a "live" account and I getting a 400 error when I pass:


 - <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>kelly-harris@comcast.net</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/MDGrantsOffice/lists/26" />


  </ContactLists>



  </Contact>



  </content>



  </entry>

Can someone tell me what is wrong with this data that is attempting to add a new contact?


5 REPLIES 5
Highlighted
Employee

400 error when posting

Hello,



I tried taking your XML and posting it to my own account, changing the list to my own list, and it successfully created the contact.



What URI are you posting this XML to? Also, are you sure you have a list 26? Please keep in mind that the list ID is not the same as the Sort order number from the User Interface when looking at a list.



If you have any questions please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Highlighted
Occasional Participant

Ben S.

 Thanks for your quick response,


https://api.constantcontact.com/ws/customers/MDGrantsOffice/contacts


Yes, I do appear to have list id = 26.

Highlighted
Occasional Participant

Sort id is not list id?

 Oops. I just realized what you said.  How would I know what the list id is by looking at the list?

Highlighted
Occasional Participant

Thanks

Thanks for pointing me in the right direction.  I see from the address bar that the list id is 94.   That is a bit confusing.

Highlighted
Employee

list ID

Hello,



I apologize for the confusion, usually the best way to find the list ID would be to do an API GET call on the lists URI, and you will find your list there.



Regards,

Benjamin Soder
NOC Analyst
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