Add New Contact and Figuring out List ID's


Add New Contact and Figuring out List ID's



Got a backend application that would attempt adding users to contact lists.


I've got a solution using cc_class.php


And the following XML document returns an error "An Error Occured"



<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns=""><title>TitleNode</title><updated>2011-05-10T17:19:53+01:00</updated><author><name>[Value Passed in Realtime]</name></author><id>[Value Passed in Realtime]/contacts</id><summary type="text">Customer document</summary><content type="application/vnd.ctct+xml"><Contact xmlns="">Customer document<EmailAddress></EmailAddress><FirstName>Karen</FirstName><LastName>Althouse</LastName><OptInSource>ACTION_BY_CUSTOMER</OptInSource><ContactLists><ContactList id=">[Value Passed in Realtime]"/></ContactLists></Contact></content></entry>



What am I doing wrong? and how do I go about getting a List ID ? all I see is the name of the List.


All I want to do is, uisng the First, Last name and Email Address that's available to the application in realtime, initialte the add to contact process.


Thanks in advance







AIM @ iiyohan




I can definitely help you with the issue that you are having with your XML.  I took a look at it and I see that the only issue is that you need to have at least one contact list already added when you add the contact.  The best way to get the contact list ID is to pull the list of contact lists in the API.  You can do this by using the getLists function in the cc_class file.


If you have any questions please let me know.



Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page