The DeletePreference service allows you to delete existing preferences within Flexmail.
SOAP Action: DeletePreference
SOAP Return Object: DeletePreferenceResp
The following table describes the parameters used for calling the DeletePreference service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
preferenceType | Y | PreferenceType | Preference type to delete |
The following table describes the parameters returned from the DeletePreference 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 | Preference ID is mandatory |
230 | Preference module not activated for this account |
226 | Preference does not exist |
This example shows you the deletion of a preference with id 712.
<?php $header->userId = USER_ID; $header->userToken = USER_TOKEN; $deletePreferenceReq->header = $header; $deletePreferenceReq->preferenceType->preferenceId = 712; $deletepreferenceResp = $SoapClient->__soapCall("DeletePreference", array($deletePreferenceReq)); if( $deletePreferenceResp->errorCode == 0 ){ echo "Preference deleted"; } else { echo "Preference deletion failed: " . $deletepreferenceResp->errorMessage; } ?>