I'm writing an extension to our CRM application to allow exporting our contact information to Constant Contact so that they can use the service to handle their email campaigns. Our users requested that we export the contacts to a contact list they specify, and I'm running into a design issue.
In the case of an email address already existing in Constant Contact we should update that contact to add them to the contact list (unless they are in the Do Not Mail list, of course). However, it wouldn't be unreasonable to expect exports containing thousands of email addresses. Unless I'm missing something, the only way to achieve this could similarly require thousands of GET requests, and potentially the same for POST requests.
Is anyone familiar with a better way to accomplish this? Is there a bulk updating API planned?
Solved! Go to Solution.
We do have bulk API's that are already in our current offering that can help you accomplish this. First, we have a bulk add/remove contacts activity that can both add and update your contacts, depending on what is appropriate. This will help you update those contacts without running thousands of post/put requests. You can find more information on this at Creating an Add Contacts/Remove Contacts Acitivity.
We also have a bulk activity that can help you export the contacts information into a .csv or .txt file, depending on what you specify. This would allow you to post an activity, which would take a certain amount of time to queue and run, and once complete would offer the url of a file containing your requested info. You can find more about this at Creating an Export Contacts Activity.
I hope this answers your question. Please let us know if this is unclear or you you have any other questions. Thanks.
I may have found a solution to my own problem. Looking through the API docs I found mention, at the bottom of the Searching for a Contact by Email page, of the ability to query multiple email addresses in one request.
Practical limits on URL length, however, limit the effectiveness of this method; it decreases the overall number of requests required, but it's only an optimization.
Does anyone know of an actual solution?
Thanks for the response, David. I think the Export Contacts activity will help alleviate the issue by batching the request for contacts, allowing me to identify existing contacts.
As far as I can tell from reading and testing, though, the Add/Remove contacts activity won't update existing contacts. That still leaves me with using the Contacts API to update existing contacts individually. Since I'm only adding them to a contact list, that seems like a waste of everyone's resources. Do you have any other advice?
The Add Contacts activity will either add a new contact, or update the contact if it already exists. You do not need to specify in that the contact already exists, as the bulk activity will determine the necessary course of action of the fly. I hope this clears things up.