The SendCampaign service allows you to launch or plan the launch of a campaign within Flexmail
SOAP Action: SendCampaign
SOAP Return Object: SendCampaignResp
The following table describes the parameters used for calling the SendCampaign service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
campaignId | Y | Integer | Id of the campaign to send |
campaignSendTimestamp | / | String | Timestamp when you want to launch the campaign. Timestamp format : YYYY-mm-ddTHH:mm:ss where YYYY-mm-dd is date format T is fixed character T HH:mm:ss is time format |
The following table describes the parameters returned from the SendCampaign 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 | Invalid timestamp |
224 | Insufficient credits |
225 | Subscription plan limit reached |
240 | Invalid sender address |
This example shows the launch of a Campaign with id ‘1’.
<?php $header->userId = USER_ID; $header->userToken = USER_TOKEN; $sendCampaignReq->header = $header; $sendCampaignReq->campaignId = 1; $sendCampaignResp = $SoapClient->__soapCall("SendCampaign", array($sendCampaignReq)); if ($sendCampaignResp->errorCode == 0) { echo "Campaign launched"; } else { echo "Campaign launch failed: " . $sendCampaignResp->errorMessage; } ?>