The UpdateCampaign service allows you to update existing campaigns within Flexmail.
SOAP Action: UpdateCampaign
SOAP Return Object: UpdateCampaignResp
The following table describes the parameters used for calling the UpdateCampaign service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
campaignType | Y | CampaignType | Campaign type to update |
The following table describes the parameters returned from the UpdateCampaign 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 | Campaign id is mandatory |
222 | Invalid campaign id |
223 | Campaign already exists |
224 | Invalid message id |
225 | No update detected |
226 | campaignMailingIds needs to be an array |
227 | Invalid mailing list id |
228 | campaignGroupIds needs to be an array |
229 | Invalid group id |
230 | campaignPreferenceIds needs to be an array |
231 | Invalid preference id |
240 | Invalid sender address |
241 | Invalid language |
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; } ?>