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.

Retrieve Do Not Mail List?

SOLVED
Go to solution
Highlighted
Occasional Advisor

Retrieve Do Not Mail List?

I am using the v2 API. Previously, in v1, we had created a method to retrieve all contacts on the Do Not Mail list. But in my attempts to convert our integration to v2, I do not see a way to do this. Can anyone help? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Honored Contributor

Re: Retrieve Do Not Mail List?

Hello Dave,

 

After spending some time double-checking my information, I found that the system lists such as removed/opted-out are only available in V2 through the bulk activities API. However, you can also filter the contacts collection based on the status of a contact. While the effectively achieves the same result, it's a bit of a different process. An exmaple of a request URI would be: https://api.constantcontact.com/v2/contacts?status=OPTOUT

 

For information on this, look at the status parameter on this page: http://developer.constantcontact.com/docs/contacts-api/contacts-collection.html

 

Also, you can find more information about the API for exporting lists of contacts via bullk activities here:

http://developer.constantcontact.com/docs/bulk_activities_api/bulk-activities-export-contacts-API.ht...

 

Also, as you were using a .NET based code for your V1 integration, this code from our .NET wrapper for V2 may be of use to you.

ExportContacts Object: https://github.com/constantcontact/.net-sdk/blob/master/CTCTWrapper/Components/Activities/ExportCont...

function to create an ExportContacts activity on your account: https://github.com/constantcontact/.net-sdk/blob/master/CTCTWrapper/ConstantContact.cs#L581

 

If you do have any more questions, please reply here and we will be happy to help!

 

Sincerely,

Elijah G.

API Support Specialist

Elijah G.
API Support Engineer

View solution in original post

4 REPLIES 4
Highlighted
Honored Contributor

Re: Retrieve Do Not Mail List?

Hello Dave,

 

After spending some time double-checking my information, I found that the system lists such as removed/opted-out are only available in V2 through the bulk activities API. However, you can also filter the contacts collection based on the status of a contact. While the effectively achieves the same result, it's a bit of a different process. An exmaple of a request URI would be: https://api.constantcontact.com/v2/contacts?status=OPTOUT

 

For information on this, look at the status parameter on this page: http://developer.constantcontact.com/docs/contacts-api/contacts-collection.html

 

Also, you can find more information about the API for exporting lists of contacts via bullk activities here:

http://developer.constantcontact.com/docs/bulk_activities_api/bulk-activities-export-contacts-API.ht...

 

Also, as you were using a .NET based code for your V1 integration, this code from our .NET wrapper for V2 may be of use to you.

ExportContacts Object: https://github.com/constantcontact/.net-sdk/blob/master/CTCTWrapper/Components/Activities/ExportCont...

function to create an ExportContacts activity on your account: https://github.com/constantcontact/.net-sdk/blob/master/CTCTWrapper/ConstantContact.cs#L581

 

If you do have any more questions, please reply here and we will be happy to help!

 

Sincerely,

Elijah G.

API Support Specialist

Elijah G.
API Support Engineer

View solution in original post

Highlighted
Occasional Advisor

Re: Retrieve Do Not Mail List?

Thank you for your prompt response, Elijah.

 

I have looked at that option and begun an attempt to use it, but I receive the error "Contact List ID Opted-out does not exist." Here is the JSON sent in AddExportContactsActivity:

 

{
   "column_names":[
      "Email Address",
      "First Name",
      "Last Name"
   ],
   "export_added_by":true,
   "export_date_added":true,
   "file_type":"CSV",
   "lists":[
      "Opted-out"
   ],
   "sort_by":"EMAIL_ADDRESS"
}

 The documentation states to specify system-generated lists by name in the lists array, which I have done. Any idea why I receive the error? Thanks!

Highlighted
Moderator

Re: Retrieve Do Not Mail List?

Thanks for pointing this out.  Looks like we have a bug in the /exportcontacts endpoint.  Opted-out is our new name for these types of contacts in our new Contact managment system but we did not correctly map that.  We incorrectly still have it mapping to do-not-mail to export the system list.  We're going to look at this and get it fixed as quickly as we can. 

 

Unfortunately, the only workaround in the meantime is to use do-not-mail as the list ID until we fix this, at which point that will likely no longer work as it was never intended to.  Will update this once we have that bug fix tested and released to production.  We will also investigate the option of continuing to support do-not-mail for anyone using that as an interim workaround so that your code doesn't break, but at this time I can't guarantee that will be the case.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Advisor

Re: Retrieve Do Not Mail List?

Thank you Dave.

 

In the meantime, I have gone ahead and created a class in CTCTWrapper to grab a list of contacts by status as Elijah suggested in his first paragraph. It is working quite well for me.

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