Let's Play Bingo in Week 4 of the Ready, Set, Send Challenge!

How do I get the latest unsubscribe customers using the v3 api

LisaJ8997
Rookie

Hello,

I've been trying out your api and seem to have run into an issue. When I fire: https://api.cc.email/v3/contacts?status=unsubscribed&updated_after=2022-05-01&limit=500
It only shows 10 or 15 contacts who have unsubscribed. However, we have had a large amount unsubscribe since the 1st of May, so much so that it was in the 100s. How come there is a "
updated_after" parameter, but no "unsubscribed_after" or anything that would just let me see the LAST 500 starting from TODAY backwards until we hit 500?

I've read all of your API documentation and there doesn't seem to be a solution.

3 REPLIES 3
Courtney_E
Moderator

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!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
user6365
Campaign Contributor
0 Votes

Hi Courtney E.,

 

I got the same issue here when I can't get all the unsubscribed contacts using https://api.cc.email/v3/contacts?updated_after 
On the documentation also mentioned use this https://v3.developer.constantcontact.com/api_guide/contacts_sync.html#sync_unsubscribed to get the contacts that are unsubscribed but the parameter "updated_after" doesn't work at all as the way it's s supposed to work.

 

The CC engineers should look at this endpoint and release a fix ASAP please. This is really bad. 

Courtney_E
Moderator
0 Votes

Hello user6365,

 

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.

 

To get ALL Unsubscribed contacts within the account, you'd want to use the GET /contacts endpoint using the parameters for "status" and "optout_after".

 

Status needs to be set to "all". Even though there is a status option for "unsubscribed", that will only return contacts that are unsubscribed but are still visible in the account, whereas by using "all" and then filtering by "optout_after", you get ALL unsubscribed contacts after a certain date (for all Unsubscribes, set the date to when the account was opened, or for when your first contact was added).

 

Example:

GET https://api.cc.email/v3/contacts?status=all&optout_after=2022-11-16T16%3A20%3A59.091Z

 

[API Reference] - GET Contacts Collection

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

The reason why it is relevant to get ALL unsubscribes, rather than just active ones:

 

Once a contact (email address) has been added into the system, even if it is deleted, the contact entry and details still remain on the back end of the system for reporting and compliance purposes. 

 

For example, if a contact unsubscribes from your organization’s mailing list, and you were to delete and then re-add that contact, they would be re-added as unsubscribed rather than as a new contact. This allows us to be compliant with the CAN-SPAM Act, as well as other applicable laws and regulations. 

 

AN-SPAM Act and how it affects your campaigns

https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5825-can-spam-act-and-how-it-affect... 

 

Frequently Asked Questions for Contacts

https://www.constantcontact.com/legal/about-constant-contact-faqs 

 

Essentially, deleting a contact never really deletes them. It just strips their list memberships, moves them into a “deleted” status, and hides them from being visible in the account.

 

Please have a look and let us know if you have any other questions!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up