Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

create an unsubscribe link

MikeM10
Rookie
0 Votes
first of all, I'm a developer . i want to create an unsubscribe link . something like this. `https://visitor.constantcontact.com/do?p=un&m=---%3D&ch=47a528e0-c1e4-11ee----&ca=ba8fb40a-b377-4c96...` but I don't know which parameter is what for example `m`, `ch`, or `ca`. is there any documentation to do that? this link is going to be used on a custom email, not the CC email
1 REPLY 1
John__B
Employee
0 Votes

Hello MikeM10,

 

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.

 

I apologize for the difficulty that you’ve experienced in regards to finding a functionality similar to the Unsubscribe link or “Update Profile” tool for use within the bodies of your emails, and can see the value in offering that type of feature. I know it can be frustrating to run into product limitations, especially when it’s in regards to meeting the needs of your clients/organization.

 

I have tracked the feature request “Ability to Insert Unsubscribe link in email body in all versions of the editor” with your account and have also added your feedback to the ticket to ensure visibility for our engineering team. While this feature request is still under review and consideration, it looks like there is no ETA on if/when this functionality will be considered for further development at this time.

 

While Constant Contact doesn’t offer any services as far as assistance with building custom integrations, and our expertise is with our API itself as opposed to its implementation within any particular programming language, we are happy to answer any questions pertaining to Constant Contact’s API endpoints, functionality, and documentation.

 

However, if you feel that this functionality is essential for your organization, your best option is going to be to build your own integration (or have a developer build it for you) using our V3 API, though you’d have to develop/host the application yourself.

 

Based on your use case, you would want to develop a web application, which you would also need to host (and then could link to directly within your email bodies). While our API does use JSON payloads, you can make the actual requests to our API using whichever programming language you prefer.

 

Typically, we don’t recommend using a public-facing form/integration which is capable of allowing contacts to be removed from lists or unsubscribed because of the possibility that a 3rd party could potentially manage their permissions if the proper security measures aren’t taken.

 

For instance, if the website where you are hosting this functionality allows users to log into your website using secure credentials, the contacts’ identities would be verified during the secure login process.

 

However, in the event that users do not use a secure login to access your website or you want a public-facing option, an extra step would be required where users can enter their email address to update their preferences (or it’s pre-populated via the link), and then have a verification email deployed to that address with a unique link that securely redirects to the update form (similar to how our Update Profile tool works).

 

This way you can ensure that unauthorized users are not able to access the form and tamper with other contacts subscriptions, and also ensure that the contact is permission-based to meet all applicable laws and regulations, as well as our terms of service.

 

In both instances, you’ll need the email address field pre-populated and non-editable. This ensures that unauthorized users are not able to tamper with other contact’s subscriptions, and also ensures that the contact is permission-based to meet all applicable laws and regulations, as well as our terms of service.

 

Constant Contact's email permission policy

https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5305-constant-contact-s-email-permi...

 

Understanding implied and express permission for CASL and GDPR

https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5924-implied-and-express-permission...

 

If you decide to move forward with building/programming your own application using our API, below is one example of some of the endpoints and methods you might use to build this type of application:

 

So, once a verified user/recipient is securely redirected to the page where you want them to be able to change their subscription, you’d want the process to start by running GET Contacts Collection using the email query parameter to search for a contact using a specific email address to get their existing contact info and Contact ID.

 

To ensure security, your program should pre-populate the user’s email for this variable, rather than them entering it, and the contact should not be able to edit that field. Make sure to specify which contact sub-resources to include in the response. Use a comma to separate multiple sub-resources. Valid values: custom_fields, list_memberships, phone_numbers, street_addresses, notes, and taggings. We need to get all the contact data, because when we later use PUT to resubmit it, all existing values will be overwritten. This allows you to both add and remove list selections with a single call. https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

Next, if they are updating their list memberships, you’ll want those to appear as pre-populated selections depending on which lists they want to be added to or removed from, and you’ll want to also have their current list selections displayed. You can get the list IDs before setting up the form by using GET Lists Collection: https://v3.developer.constantcontact.com/api_reference/index.html#!/Contact_Lists/getLists

 

For submitting updated data, including new list memberships, or completely unsubscribing, you’ll make a PUT call to the Contacts endpoint. You’ll need to use the "permission_to_send" parameter if they want to unsubscribe fully, otherwise, you’ll just append the new data to the data we got from the GET call. When updating any resource using PUT, all properties are updated, overwriting all previous values. Any properties left blank or not included in the request are overwritten with null value - however this does not apply to contact subresources. Add or change any of the subresources by including them in the PUT request payload. Omitted subresources are not overwritten with null. If the contact being updated was previously deleted from the account, the contact will be revived: https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

*If you are using Confirmed Opt-In with your account, the methods in this example may not work with all contacts. If you feel that this limitation applies to your account, please feel free to email us at webservices@constantcontact.com to discuss whether other endpoint options may be available based on how you use your account.

 

Please have a look and let us know if you have any other questions regarding Constant Contact’s API endpoints, functionality, or documentation. Otherwise, if you have additional questions but they do not fit our team’s scope of support, we are happy to redirect you to the appropriate resource!

 

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

 

Regards,


John B.
API Support Specialist
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