The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Get Optout contacts only

SOLVED
Go to solution
Highlighted
Occasional Advisor

Get Optout contacts only

Hi,

We are using v2 API and we need to get all the OPTOUT contacts. The API when used with the filter status=OPTOUT, returns the Optedout contacts, but there are contacts which have been even soft deleted (removed which can be identified by looking at email_addresses status as REMOVED as shown in the below example). We don't want these contacts to be seen in the API response. Is there any way to get these filtered out using the API request parameters?

 

A sample response would be something like this:

 

{
            "id": "55555",
            "status": "OPTOUT",
            "fax": "",
            "addresses": [],
            "notes": [],
            "confirmed": false,
            "lists": [],
            "source": "",
            "email_addresses": [
                {
                    "id": "1-2-3-4",
                    "status": "REMOVED",
                    "confirm_status": "NO_CONFIRMATION_REQUIRED",
                    "opt_out_date": "2018-12-27T22:20:47.000Z",
                    "email_address": "dummy@sample.com"
                }
            ],
            "prefix_name": "",
            "first_name": "DUMMY CONTACT",
            "middle_name": "",
            "last_name": "",
            "job_title": "",
            "company_name": "",
            "home_phone": "",
            "work_phone": "",
            "cell_phone": "",
            "custom_fields": [],
            "created_date": "2018-06-18T20:04:54.000Z",
            "modified_date": "2018-12-28T17:17:23.000Z",
            "source_details": ""
        },

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: Get Optout contacts only

Hello @YahoM ,

 

Thank you for reaching out to Constant Contact's API Support.

 

The result you posted is a contact that is Opted Out, but they have also been deleted from the account. We do not do a hard delete of contacts and the API can see all soft deleted contacts. Contacts in this status are not visible in the UI, but they are visible in the API.

 

You would need to do the GET on these contacts and then parse through the data and remove the contacts with the REMOVED status on your end if you did not want to include them. However; please keep in mind if the contact has the "status": "OPTOUT" in the main body then they are infact Opted Out/unsubscribed even if they show "status": "REMOVED" in the "email_addresses" object.


Regards,
Jimmy D.
Tier II API Support Engineer

View solution in original post

3 REPLIES 3
Highlighted
Moderator

Re: Get Optout contacts only

Hello @YahoM ,

 

Thank you for reaching out to Constant Contact's API Support.

 

The result you posted is a contact that is Opted Out, but they have also been deleted from the account. We do not do a hard delete of contacts and the API can see all soft deleted contacts. Contacts in this status are not visible in the UI, but they are visible in the API.

 

You would need to do the GET on these contacts and then parse through the data and remove the contacts with the REMOVED status on your end if you did not want to include them. However; please keep in mind if the contact has the "status": "OPTOUT" in the main body then they are infact Opted Out/unsubscribed even if they show "status": "REMOVED" in the "email_addresses" object.


Regards,
Jimmy D.
Tier II API Support Engineer

View solution in original post

Highlighted
Occasional Advisor

Re: Get Optout contacts only

Thanks @Jimmy_D for the confirmation. 

I was doing the same on my end, but wanted to make sure that this is the only way to get the correct set of contacts what we have on the UI side. It's kind of misleading as the count of unsubscribed/opted out users we get when we use the API call from the V3 API gives the same count as the UI, but infact there can be few more contacts which have been soft deleted. 

 

Is there any way to get the total count of unsubscribed/opted out contacts (the count in UI + the soft deleted contact count who have unsubscribed/opted out)? The count we get using V3 API is same as the one in the UI.

 

We need this count in order to do API calls and get those contacts' information. We do have a limit on the number of API callouts and we want to make sure that we are in those limits when we try to get all the opted out contact information.

 

Thank you.

Highlighted
Moderator

Re: Get Optout contacts only

Hi @YahoM,

 

You can do a GET on both the UNSUBSCRIBED and the DELETED status. You can do this in a single call separating the status by a comma. These two status' together will give you both unsubbed contacts and soft deleted contacts.


Regards,
Jimmy D.
Tier II API Support Engineer
Developer Portal

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

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured