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.

1 REPLY 1
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.
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

Polls
How confident are you about the effectiveness of your current marketing strategy?

Top Choice: Not confident at all (63%)