Service: DeletePreference

The DeletePreference service allows you to delete existing preferences within Flexmail.

Service Details

SOAP Action: DeletePreference
SOAP Return Object: DeletePreferenceResp

Input

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

Table: instance of DeletePreferenceReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
preferenceType Y PreferenceType Preference type to delete

Output

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

Table: instance of DeletePreferenceResp

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 DeletePreferenceResp.

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

Example

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;
}
?>