Easiest way to unsubscribe someone

Highlighted
Occasional Participant

Easiest way to unsubscribe someone

I had a look at the API and saw that the Delete method required knowledge of the contact id. Is that the email address? 


I've got an ERP system that doesn't necessarily know what the constant contact ID is for a client, but it does know the email address. Does that mean that I need to first look up the ID and then delete it? 

9 REPLIES 9
Highlighted
Occasional Advisor

Hello, You are correct. To

Hello,


You are correct. To delete a contact, you can search for the email address, retrieve the contact ID, then perform a delete to opt the subscriber out, and move it to Do Not Mail.

Andrew T

Support Engineer, Constant Contact

Highlighted
Occasional Participant

better idea

Andrew,


I sure with this API was much simpler. All I need are two methods:


Add(firstName,lastName,email)


Delete(email)


It seems that this is 100x as complicated as it needs to be.


John 

Highlighted
CTCT Employee

Re:better idea

Adding the first name, last name, and email can be completed by making an http post to the contacts collection (https://api.constantcontact.com/ws/customers/{user-name}/contacts). You can find more information and details on the request here.


 


As for removing the contact, our primary key is not the email address as we certainly want to give subscribers the ability to change their address.  Instead we use the contact id which is unique and never changes - and this is what needs to be referenced in order to delete the contact. This can be retrieved by performing a search for the email address or by obtaining the contact's information, which involves performing a get on the same address you would need to perform a delete on to remove the contact.


 


We do have sample forms available in C#, PHP and ColdFusion which have all of this functionality built in that may be helpful.


 


I apologize for any inconvenience that this has caused. If you have any other questions regarding this, please let us know.

David J

Highlighted
Occasional Participant

 David, I get the idea about

 David,


I get the idea about the primary key. It makes sense to architect the system in that manner to allow change in the future. But it still doesn't make much sense to the end user who wants to get something simple done quickly. 


Why not create an overload that does the lookup for the end user? The external method could have a signature like delete(emailAddress), which would then lead to some internal code that does the lookup and deletes the address. It would eliminate a second WAN call.


John

Highlighted
Anonymous
Not applicable

Hi John, One of the reasons

Hi John,


One of the reasons is that our APIs are not based on method calls.  Our APIs are based on REST protocol, which are based on HTTP methods on top of resources and collections.  According to the REST standard, DELETE HTTP method has to be called on a resource, which in this case is a single contact, and that's why the ID has to be part of the URL as the ID is how we represent contact resources in our APIs.


Of course, this doesn't mean that we will let the "standard" prevent us from providing our developers with better experience, but I just wanted to provide you with the background information as to why our API works the way it does.


 


 

Highlighted
Occasional Participant

Chang, Is there any thought

Chang,


Is there any thought of a SOAP WSDL interface in addition to REST? Visual Studio has nice tool to build a proxy class out of a WSDL that really cuts down on client development time, but it only works with traditional web services as far as I know. Using REST in .net is a lot more work.


John

Highlighted
Moderator

Possible SOAP Interface

Hi John,


 


At this time we do not have any plans to implement a SOAP version of the API.  We have offered a .NET wrapper sample that does provide most of the features you are talking about and can be very easily augmented to have that type of wrapped Delete feature without you having to worry about any of the actual XML or details.  Have you looked at our samples


 


 

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

 Dave, I did have a look at

 Dave,


I did have a look at the .net samples. They are quite extensive, but unfortunately quite verbose and complex. With a SOAP solution I'd be able to get this coded up in just a few lines of code in an hour or two.  The current system is much more complex and time consuming. 


I hate to say it, but I'm leaning toward your competitors because they do offer a SOAP API. I've got dozens of development projects to work on, so I'd like to do things like this in the quickest possible manner.


John

Highlighted
Moderator

 We'll put the feedback on

 We'll put the feedback on SOAP in for you and keep that in mind going forward.  Sorry again that this is causing you delays in your development.  Our goal with our API was to make it as feature rich as possible and provide access to all of our data in a simple manner.  For some purposes, such as sign up forms, it can often seam overkill.  

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page

Constant Contact Would Like To Hear From You!

We want to hear from customers like you about your favorite features and how they have helped your business or organization. Tell us by answering a few questions in...

Read More
Featured