I've created a simple form to add a single entry to one of our CC lists. It accepts a first name, last name, and email address, and POSTs the form using PHP, taken directly from the samples provided on this developer site.
The resulting XML string is:
(The email address is real, but it is for a dummy testing account; number 5 is the desired list ID, and "XXXXXXX" is the account name.)
This submission returns a 400 request error. What am I missing?
I took a look at your XML and was successfully able to create a contact using it. The only adjustments that I had to make was to modify the list ID to be an actual list contained within my account. You may possibly be recieving a 400 error if list id number '5' does not exist. Another possible error you could be recieving is an error 409 if the contact already exists within your account.
I would recommend that you take a look at the REST Client and see if you are able to create a contact this program. If you are still running into any issues creating a contact, please reply to this post with the PHP that you are using and I'll be happy to take a look. If you would prefer, you can also send your PHP to our webservices support team and we would be happy to take a look at it. Thanks.
Thanks for getting back to me -- the REST Client really made a difference.
My problem was that I was not programmaticaly generating a response containing my collection of lists.
Instead I was trying to pass a specific list directly, by what I assumed was the ID number ("5").
Turns out that's actually the content of the "ContactCount" element. A little note clarifying the distinction might be helpful, for future reference!