Cannot Add Contacts to non-default list using API

Andrew H
Participant

Cannot Add Contacts to non-default list using API

Hi,


I have written some asp.net code to generate and send the XML required to add contacts.


The code allows the user to select the list they wish to add the user too.


This works fine for adding to the default list (1), with contacts being successfully added, but I cannot add contacts to the other lists I have created using the Constant Contact Manage Contacts tab, on the website.


Can you only add to the default list using the API or do you need to set queue permissions?


If so, why do you need to specify list number in the XML?


 


Thanks


Andrew Harvey


 


 

1 REPLY 1
bsoder
Employee

Hello Andrew,



You can definetly add a contact to lists other than the default list. In order to do this, when creating the XML, there is a section for contact lists:



<ContactLists>

<ContactList id="http://api.constantcontact.com/ws/customers/joesflowers/lists/1" />

</ContactLists>



In order to add contacts to other lists, you need to get the other lists ListID, which you can get by doing a GET call on the List Collection API and then you can add as many lists as you like between the ContactLists node in the XML.



The default list is not always list ID 1, it just happens to start out that way. The list ID that you specify in the XML is seperate from anything in the user interface of Constant Contact. If you have any questions regarding this please let me know.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page