Hello LisaJ8997,
Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.
Our API is not able to directly retrieve opt outs from after a certain date.The "updated_at" value displayed for contacts in the section beginning with "create_source" refers to the last time the contact details were updated. As you can see in the Response Schema example in the right-hand side of the API Reference Page, this is grouped in with other contact details such as name and address. These are stored in a different area of the database than the "updated_at" for "email_address" details, which includes the "opt_out_date".
API Reference Page - GET Contacts Collection
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts
The “updated_after” query parameter that can be used with the Contacts endpoint only applies to the "updated_at" value that identifies who last updated the contact’s personal information, and the "update_source" will only appear for contacts who’s contact information has been updated since they were added (examples: "first_name", "last_name", "job_title", "company_name", "birthday_month", etc…).
The "updated_at" value that displays for email addresses in the section starting with "contact_id" does reflect when an email address unsubscribes or is put into another status, but there’s not a parameter available for narrowing by this value when making calls. You can only query for the "updated_at" value for when contact details were last updated.
If you just want the last 500 unsubscribes, you’d want to shorten your request to:
https://api.cc.email/v3/contacts?status=unsubscribed&limit=500
In order to retrieve opt outs after a certain date, your best option would be to send a GET call to the Contacts endpoint with the status parameter set to OPTOUT and then program your application to parse the results and display only values within the desired range as the API cannot call them directly.
{
"contact_id":
"email_address": {
"address":
"permission_to_send":
"created_at":
"updated_at": This identifies the last time the status of the contact was updated (if "permission_to_send" changes), and there is not a direct parameter in the API that can call this value, it is just included in the response when making other calls.
"opt_out_source":
"opt_out_date":
"opt_out_reason":
"confirm_status":
},
"update_source": This identifies who last updated the contact’s personal information. The "update_source" value will only appear for contacts who’s contact information has been updated since they were added (examples: "first_name", "last_name", "job_title", "company_name", "birthday_month", etc…)
"create_source":
"created_at":
"updated_at": The “updated_after” query parameter only applies to this value. The "updated_at" value here only applies to when a contact’s personal information was last updated (examples: "first_name", "last_name", "job_title", "company_name", "birthday_month", etc…)
}
Please have a look and let us know if you have any other questions!
... View more