Reply
Occasional Participant
adamisland
Posts: 5
Registered: ‎05-21-2009

is there a simple example on how to remove a contact?

i want to remove a contact from an unsubscribe form. is there a simple example of how to do this, something like "AddAContact.php", but for deletion.

thanks,

adam
Occasional Participant
mikespev
Posts: 6
Registered: ‎05-22-2009

is there a simple example on how to remove a contact?

I have similar question:
Currently I'm using Contact Lists Collection API to add new users.
I'm wondering if someone could give an example on how to remove specific user by email address

Also, the example project contains reference to SV_RMV (SiteVisitor Remove Subscriber) Activity Type.
When I try to use it, I'm getting 'bad request' error

Thanks,
mike
CTCT Employee
CC_TomM
Posts: 184
Registered: ‎03-07-2008

re: Remove a contact

Hi Mike,

To remove a set of contacts, you should use the Activities resource. This sounds like what you are trying to do. The correct value for activityType, documented here, is REMOVE_CONTACTS_FROM_LISTS.

To remove an individual contact from one or more lists, use the Contacts resource, documented here.

Thanks,
Tom M
Group Product Manager – Content Editing
Constant Contact
Occasional Participant
adamisland
Posts: 5
Registered: ‎05-21-2009

is there a simple example on how to remove a contact?

again, my original question.

i want to remove a contact from an unsubscribe form. is there a simple example of how to do this, something like "AddAContact.php", but for deletion.

thanks,

adam
ady
New Member
ady
Posts: 2
Registered: ‎05-28-2009

is there a simple example on how to remove a contact?

Documentation is not clear enough on this point
Please show XML command for deletion
Thanks!
DaveBerard
Posts: 1,632
Topics: 7
Kudos: 61
Solutions: 57
Registered: ‎06-19-2008

If you are doing a delete to

If you are doing a delete to a specific contact to move them to Do Not Mail, there is no XML required. All you need to do is send a DELETE to the URL of the contact, ie http://api.constantcontact.com/ws/customers/username/contacts/20689.

If you are removing them from all lists, you will need to post to the contact URL XML with an empty list node. Here is sample XML for that:

<entry xmlns="http://www.w3.org/2005/Atom">
<id>http://api.constantcontact.com/ws/customers/joesflowers/contacts/101</id>
<title type="text">Contact: u86597@example.com</title>
<updated>2008-04-25T19:29:06.096Z</updated>
<author> </author>
<content type="application/vnd.ctct+xml">
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/joesflowers/contacts/101">
<EmailAddress>u86597@example.com</EmailAddress>
<OptInSource>ACTION_BY_CUSTOMER</OptInSource>
<ContactLists>
</ContactLists>
</Contact>
</content>
</entry>
Dave Berard
Senior Product Manager, Constant Contact
ady
New Member
ady
Posts: 2
Registered: ‎05-28-2009

>>If you are doing a delete

>>If you are doing a delete to a specific contact to move them to Do Not Mail, there is no XML required. All you need to do is send a DELETE to the URL of the contact.

How can i "send DELETE to the URL" ? In case this is an POST request, what are the $key->$value items ? Could you please provide an sample of the request ?
Thanks.
DaveBerard
Posts: 1,632
Topics: 7
Kudos: 61
Solutions: 57
Registered: ‎06-19-2008

I think there is some

I think there is some confusion on what a DELETE is. There are different types of HTTP requests. GET, POST, PUT and DELETE are the 4 most common types. If you use the DELETE type, it will move a contact to Do Not Mail without any XML needed (just like a GET request needs no XML).
Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant
arundas_newage
Posts: 3
Registered: ‎06-30-2009

Put not working

Hi,


 I use the put method is to update emails from the list, it is updated, i also need to delete the email from a particular list. I ddnt use the list that the contact is deleted in the contactlist, but it is not deleted from the list. Can you give me a solution

New Member
jbarnum
Posts: 2
Registered: ‎07-12-2009

How do I get the URI of the contact?

I understand how to do a deletion, but I don't know where I should get the URI for the contact to delete. Because I'm dealing with more than 25 contacts, I'm using the bulk operations, and those do not (as far as I can tell) return the URI for each contact, so I don't have the contact URI in my database.