I want to remove a contact from a list - even if it's the last list, but I don't want to opt-out the contact. This comes from someone hitting a newsletter "unsubscribe" button on the website.
So the documentation says:
ContactListelements from the
ContactListselement, and issue the PUT method on the contact resource:
Removing a contact does not mean that the contact has unsubscribed or opted out of receiving emails. It means the contact simply does not belong to any particular contact list, and can be added back to a list by the account owner. However, this API should not be used if the contact has unsubscribed from receiving all emails. Instead, you must opt-out the contact.
Which looks straightforward. My xml POST request contains:
<link href="/ws/customers/*obfuscated*/contacts/*obfuscated*" rel="edit"/>
<title type="text">Contact: firstname.lastname@example.org</title>
<Contact xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/*obfuscated*/contacts/*obfuscated*">
<title type="text">Contacts for Customer: *obfuscated*</title>
<link href="contacts" rel="self"/>
which gets the following response:
Error 400: The new contact must contain at least on valid ContactList
Something which would seem to go against the documentation. What am I missing here? Is there a way to remove the last list without opt-out?
I took a look at your XML and I was not able to recreate the error that you are having. When I take that XML and do a PUT call to my contacts ID, it updates the contact to the removed folder.
Can you verify that you are doing a PUT call and not a POST call? The error you are getting is the exact error you would get if you were trying to do a POST with that XML to the contacts URI.
If you are still having this issue and you have verified its a PUT call, can you send us the code to the Webservices Support team, so that we can take a look at what might be going on?
I, too, ran into this error and couldn't figure out what the problem was. It turned out that I needed to set my OptInSource when doing the PUT to ACTION_BY_CUSTOMER when
Hope this helps somebody!