Service: TruncateMailingList

The TruncateMailingList service allows you to remove all contacts from a mailing lists within Flexmail.

Service Details

Input

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

Table: instance of TruncateMailingListReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
mailingListId Y Integer Id of the mailing list to truncate

Output

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

Table: instance of TruncateMailingListResp

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

0 No error
220 Authentication error, see header object for detailed information
221 Mailing list id is mandatory
222 Mailing list id is invalid
223 Internal error

Example

This example truncates of a mailing list width id 4563.

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

$truncateMailingListReq->header = $header;
$truncateMailingListReq->mailingListId = 4563; 
$truncateMailingListResp = $SoapClient->__soapCall("TruncateMailingList",array($truncateMailingListReq));

if ($truncateMailingListResp->errorCode == 0) {
	echo "Mailing list truncated";
} else {
	echo "Mailing list truncate failed: " . $truncateMailingListResp->errorMessage;
}
?>