Search By Custom Fields using API v2 / Get all Unsubscribes

Frequent Participant

Search By Custom Fields using API v2 / Get all Unsubscribes

I'm wondering if the two following operations are available in the Constant Contact API v2.


1) Search By Custom Fields:

My process currently syncs our backend database to Constant Contact by matching on email address.  We keep the primary key value in a Custom Field.  In the scenario where someone changes the email address in our system, there is no way to know which contact it should be synced with in Constant Contact.  Is it possible to search on the primary key stored in the Custom Field?  I can't pull every contact as there are 30k contacts.  I only need to sync 30-50 daily.


2) Get All Unsubscribes for past week.

Our Marketing department says they get a list of everyone who has unsubscribed via email once per week.  Is there a way I can pull this data via the API?  I currently am pulling the unsubscribes by looking for EmailCampaigns that are 7 days old.  I'd rather be able to pull all people who have unsubscribed within the past week, regardless of which campaign it was.



Hi Andrew, 


On the first point, the API does not provide the ability to search on custom_field values, unfortunately. 


Regarding your 2nd question, check out the GET Contacts documetation here

 You can GET contacts using the modified_since and status query parameters to retrieve all contacts who have opted out, and have been modified in the past week.


The caveat is that if you use the Bulk activity Import Contacts endpoint to update all contacts (even if their data has not changed), all contacts will have a modified_date corresponding to the last import/update activity. If an any opt-outs occur in the same week as a bulk update, then the GET response would be a superset of the opted-out contacts you are looking for plus the modified/updated contacts. In this case, you could then parse the results using the opt_out_date value to grab only the contacts opted out in the last week.


Hope this helps - let me know if I you need more info/clarification.




Rich Marcucella
Sr. Technical Writer, Content Developer
Web Services Team
Developer Portal

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

Visit Page