Sending to an existing list

Regular Participant

Sending to an existing list

I am trying to send an email campaign to an existing list. Is there a way to get the list URI using the name? The only way I can see is to get all the lists then loop through them looking for the one with the matching name, but it seems like there should be an easier way. Am I missing something?

3 REPLIES 3
Employee

Hello,



The best way to get the list ID from the list name would be to do what you are doing. Do a GET call to your List collection and then find the name of the list, which will also include the ID for that list.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Regular Participant

Since it will only return the first 50 lists. I can't find any documentation on it.

Employee

Hello,



The way that paging works is if there are more than 50 items on a list, it will also provide a link at the top of the XML file with a link to the next page.



An example of this would be here:



<link href="/ws/customers/USERNAME/lists?next=60" rel="next"></link>



If you then go to https://api.constantcontact.com/ws/customers/USERNAME/lists?next=60 it will give you the next 50 lists.



Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Developer Portal

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

Visit Page