I am using the PHP SDK to interact with the Constant Contact API. Without going into too much detail we have a list of members stored as part of a website CMS which we then need to add/remove to a few different Constant Contact email lists based on certain fields in our CMS for each member. The original idea had been when a member created or dropped their account to add/remove that person from the appropriate mailing lists individually. Unfortunately due to how the CMS is set up it does not look like it compatible with the PHP SDK to add/remove a person individually when their account is created.
As an alternative I wanted to set up a solution that would allow the member list to be periodically synced with the mailing lists in Constant Contact. Does the PHP SDK include any bulk functions that can add/remove people from the respective mailing lists and/or add them as a new contact or do I need to loop through each person individually?
This process would likely involve 100-150 person at a time. I just want to make sure I was doing this process in the most efficient manner and also not violating any limits on the number of add/remove requests that can be made at one time.
Hope the above makes sense! Please post a reply here when you have a chance. Thank you for your help!
Thank you for reaching out to Constant Contact API Developer Support.
Our PHP SDK uses our v2 API and has the full API call functionality available as functions of the library. Given that it sounds like you will be changing individual contacts' list memberships, the easiest method may just be to loop through each contact. You can set a single contact's entire list memberships with a single PUT call to the contact ID with updateContact(). So if I understand your use case properly, you could getContacts passing in the email address as a parameter, check the contact that is returned against the lists they should be on, make changes to the lists if necessary and then updateContact() to make the change in Constant Contact.
Our standard API key rate limits are 4 calls per second and 10,000 calls per day, so if you were only doing this for ~150 contacts then you should stay well within your daily call limits.
Please let me know if you have any other questions!
Thanks for getting back to me. Everything you outlined in your reply will work well on our end. Looping through each contact as you outlined will be fine, I had just wanted to double check that this wouldn't run up against the daily call limits.
Thanks again for your help! I will get this set up and tested, I will post here if I run into any additional issues.
You can post a new message in the Community or find us on Twitter Mon-Fri 8am-8pm ET, Sat 10am-8pm ET, & Sun 10am-6pm ET. We've got real people waiting to help you out. Click below to start a conversation!