Service: DeleteCampaign

The DeleteCampaign service allows you to delete existing campaigns within Flexmail

Service Details

SOAP Action: DeleteCampaign
SOAP Return Object: DeleteCampaignResp

Input

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

Table: instance of DeleteCampaignReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
campaignType Y CampaignType Campaign type to delete

Output

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

Table: instance of DeleteCampaignResp

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

0 No error
220 Authentication error, see header object for detailed information
221 Campaign id is mandatory
222 Invalid campaign id
223 Internal error

Example

This example shows you the deletion of a Campaign width id 24889.

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

$deleteCampaignReq->header = $header;
$deleteCampaignReq->campaignType->campaignId = 24889; 

$deleteCampaignResp = $SoapClient->__soapCall("DeleteCampaign", array($deleteCampaignReq));

if ($deleteCampaignResp->errorCode == 0) {
	echo "Campaign deleted";
} else {
	echo "Campaign deletion failed: " . $deleteCampaignResp->errorMessage;
}
?>