The TruncateMailingList service allows you to remove all contacts from a mailing lists within Flexmail.
The following table describes the parameters used for calling the TruncateMailingList service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
mailingListId | Y | Integer | Id of the mailing list to truncate |
The following table describes the parameters returned from the TruncateMailingList 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 | Mailing list id is mandatory |
222 | Mailing list id is invalid |
223 | Internal error |
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; } ?>