Service: DeletePreferenceSubscription

The DeletePreferenceSubscription service allows you to delete existing preference subscription within Flexmail and remove email addresses from preferences.

Service Details

SOAP Action: DeletePreferenceSubscription
SOAP Return Object: DeletePreferenceSubscriptionResp

Input

The following table describes the parameters used for calling the DeletePreferenceSubscription service.

Table: instance of DeletePreferenceSubscriptionReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
preferenceSubscriptionType Y PreferenceSubscriptionType Contains preference and email address information

Output

The following table describes the parameters returned from the DeletePreferenceSubscription service.

Table: instance of DeletePreferenceSubscriptionResp

Parameter Mandatory Type Description
header / APIResponseHeader Header containing authentication information
errorCode / Integer Numerical value of the error
errorMessage / String Short literal description of the error

Table: response codes of DeletePreferenceSubscriptionResp.

0 No error
220 Authentication error, see header object for detailed information
221 Invalid flexmail id
222 Preference subscription not found
223 Internal error

Example

This example shows you the deletion of preference with id 33 for email address with id 257.

<?php
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

$deletePreferenceSubscriptionReq->header = $header;
$deletePreferenceSubscriptionReq->preferenceSubscriptionType->preferenceId = 33; 
$deletePreferenceSubscriptionReq->preferenceSubscriptionType->emailAddressFlexmailId = 257;

$deletePreferenceSubscriptionResp = $SoapClient->__soapCall("DeletePreferenceSubscription", array($deletePreferenceSubscriptionReq));

if ($deletePreferenceSubscriptionResp->errorCode == 0) {
	echo "Preference subscription deleted";
} else {
	echo "Preference subscription deletion failed: " . $deletePreferenceSubscriptionResp->errorMessage;
}
?>