Service: UpdateCampaign

The UpdateCampaign service allows you to update existing campaigns within Flexmail.

Service Details

SOAP Action: UpdateCampaign
SOAP Return Object: UpdateCampaignResp

Input

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

Table: instance of UpdateCampaignReq

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

Output

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

Table: instance of UpdateCampaignResp

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

0 No error
220 Authentication error, see header object for detailed information
221 Campaign id is mandatory
222 Invalid campaign id
223 Campaign already exists
224 Invalid message id
225 No update detected

Example

This example shows the update of a Campaign with id ‘24889’. We are updating the name of the Campaign.

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

$updateCampaignReq->header = $header;
$updateCampaignReq->campaignType->campaignId = 24889;
$updateCampaignReq->campaignType->campaignName = "my updated campaign";
$createCampaignResp = $SoapClient->__soapCall("UpdateCampaign",array($updateCampaignReq));

if ($updateCampaignResp->errorCode == 0) {
	echo "Campaign updatded";
} else {
	echo "Campaign update failed: " . $updateCampaignResp->errorMessage;
}
?>