I've successfully create campaigns and add to existing contact lists via the API - I don't see any code samples or options to create a new list. Is this possible using the API?
Solved! Go to Solution.
It is possible to create lists with the API! You can find the documentation for that action here: http://developer.constantcontact.com/docs/contact-list-api/contactlist-collection.html?method=POST
Additionally, if you are using one of our SDKs and let me know which one, I can provide some guidance on how to accomplish this task with that SDK.
If you have any follow-up questions, please let me know!
Here's a very simple snippet of code showing the minimum requirements to create a list with the API.
$cc = new ConstantContact(APIKEY); $newList = $cc->listService->addList(ACCESS_TOKEN,ContactList::create(Array( "name" => "List Name", "status" => "ACTIVE" )));
Please let me know if you have questions!
If you are working with a new campaign, then the only way to specifically send it to only new contacts would be to place those new contacts into a separate list. However, if you have a specific email campaign that you'd like to send to any new contacts over a period of time, you might be able to use our Autoresponder feature.
Autoresponder allows you to create a series of campaigns with a specified time delay. You can then assign lists of contacts to that series and any contacts who are added to those lists will be sent those email with the specified delay from the time they were added to the list. If you're interested in this, you can find more information about autoresponder here: https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5521-about-autoresponder
Thanks alot for your help! I'd like to give a user the option of creating a campaign and creating a new list at the same time. Is it possible to retrieve the list ID right after creating it, or would I have to perform 'getLists', find the newly created list, then add it to the campaign that way?
I apologize for having missed this and not responding sooner!
When you first create a new contact list, the API response includes the new list ID. With the code sample I provided before, $newlist would contain an id that could be assigned to an email campaign. If you have any difficulty with this, please let me know!
Thanks so much - I was able to get the new list ID, as well as create, schedule, update and delete campaigns via the API with your help!