Unsubscribes contact from a given address book
This method unsubscribes a contact from a specified address book.
SOAP action: http://apiconnector.com/v2/ApiService/UnsubscribeContactFromAddressBook
Input and output parameters
Input parameters
_AddressBook ID - _required; integer*
- Email - required; string
Output parameters
- UnsubscribeContactFromAddressBookResult
- SuppressedContact
- Id - integer
- Email - string
- OptInType - string ('Unknown', 'Single', 'Double', 'VerifiedDouble')
- EmailType - string ('PlainText', 'Html')
- DataFields - optional; array of ContactData
- ContactData
- Key - string
- Value - anyType
- Status - string ('Subscribed', 'Unsubscribed', 'SoftBounced', 'HardBounced', 'IspComplained', 'MailBlocked', 'PendingOptIn', 'DirectComplaint', 'Deleted', 'SharedSuppression', 'Suppressed', 'NotAllowed', 'DomainSuppression', 'NoMxRecord')
- DateRemoved - dateTime
- Reason - *string ('Subscribed', 'Unsubscribed', 'SoftBounced', 'HardBounced', 'IspComplained', 'MailBlocked', 'PendingOptIn', 'DirectComplaint', 'Deleted', 'SharedSuppression', 'Suppressed', 'NotAllowed', 'DomainSuppression', 'NoMxRecord')
Example
using (var client = new ApiServiceClient())
{
client.ClientCredentials.UserName.UserName = "username";
client.ClientCredentials.UserName.Password = "password";
var contactEmail = "[email protected]";
var addressBookId = 1;
var contact = client.GetContactByEmail(contactEmail);
var suppression = client.UnsubscribeContactFromAddressBook(addressBookId, contact);
}