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.

add_contact API doesn't work

Highlighted
Occasional Participant

add_contact API doesn't work

This is my first foray into the CC API. I have implemented the cc_class in PHP and build a signup form based on add_contact.php. I obtained an API key. I have sucessfully tested authentication via RESTclient. GET works fine for contacts and lists. POST simply doesn't work for adding a new contact from RESTclient, my app or anywhere else.


I have used the cc_class member createContactXML to generate the XML and have written test XML by hand using your API documentation. All POST requests return the following 400 error regardless of the XML source:


Error 400: The request contains errors in the common Atom sections, which lie outside <entry> or <Content>, such as <feed>, <id>, <author> or <updated>.


This suggests to me that your server-side app is broken. Pleas fix it immediatley. I am on a deadline.

Bruce G. Mills


studiotech-lps.com

4 REPLIES 4
Highlighted
Employee

Error 400

I have done some testing with our API and I was successfully able to perform an http GET, POST, and PUT, and our servers appear to be functoning properly.


The error messaging that you are recieving is indicating an error in the strcture of your XML, but I am not able to give you more information without seeing the XML that you are posting. If you could please reply to this post with your XML, or send it in to our webservices support team and I will be happy to review it and give you feedback.

David J

Highlighted
Occasional Participant

Followup on 400 error

Sent the XML to your support team yesterday. What's the verdict?

Bruce G. Mills


studiotech-lps.com

Highlighted
Employee

RE: Followup on 400 error

Hi Bruce,


 


I have replied to your email regarding creating a new contact. Please feel free to reply to that email, or post on these forums with any other questions or concerns regarding this. Thanks.

David J

Highlighted
Occasional Participant

Partial Success

I implemented this XML string in may app. It does indeed insert a new record in the customer contact database. However, while I specified list number '2' it was inserted into list #1 (the default list). Not the expected outcome. We created a second list for the purpose of capturing contacts from a new promotion separate from the default list.What is the correct logic/syntax for targeting a specific list? Are lists identified by an integer or a string? Do I need to insert new contacts into the default list and then add the second list to their record?


None of this information appears to be in the online documentation. Some sample code would make this a whole lot easier.


OK. By relentless guesswork and trial-and-error I have gotten this simple function to work. Why so difficult? How about hiring some documentation professionals. Your site/apps would be more widely adopted and your support costs would plummet. Hire me, I'll give you a discount.

Bruce G. Mills


studiotech-lps.com

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