The DeletePreferenceSubscription service allows you to delete existing preference subscription within Flexmail and remove email addresses from preferences.
SOAP Action: DeletePreferenceSubscription
SOAP Return Object: DeletePreferenceSubscriptionResp
The following table describes the parameters used for calling the DeletePreferenceSubscription service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
preferenceSubscriptionType | Y | PreferenceSubscriptionType | Contains preference and email address information |
The following table describes the parameters returned from the DeletePreferenceSubscription service.
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 |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
221 | Invalid flexmail id |
222 | Preference subscription not found |
223 | Internal error |
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; } ?>