DELETE Contact with API and add it again.

Occasional Participant

DELETE Contact with API and add it again.

hi

 

when delete the contact (email address) with api (PHP)  you cannot add it again to constant contact. any solutions?

 

2 REPLIES 2
Member

Hello,

 

When you use the delete contact method in the PHP SDK, that is equivalent to an Unsubscribe action for the contact(s) specified. If a contact has been unsubscribed, they can only be added back to the account by using the updateContact method with the action_by_visitor parameter set as true. For example:

$ctct = new ConstantContact(APIKEY);
$ctct->updateContact(ACCESSTOKEN, $contact, true)

It is important to note that re-adding a contact in this manner indicates that the contact has requested to be subscribed and WILL send the contact a welcome email.

 

If you simply wish to remove a contact from a list, there are two methods available:

  1. You can modify the lists array on the contact so that it contains no values. If you then use the updateContact method with this data it will remove them from all lists.
  2. You can create a remove contacts activity by using the addRemoveContactsFromListsActivity method. This requires an array of email addresses and an array of list IDs.

If there is any additional information that I can provide, please let me know!

 

Sincerely,

Elijah G.
API Support Engineer
Occasional Participant

hi elijah

 

thanks for your answer

 

 

i m using

DELETE: https://api.constantcontact.com/v2/contacts/{contactId}

 

to delete the contact so when i delete it with this method i cannot add the email address again.

Developer Portal

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

Visit Page