Service: SendCampaign

The SendCampaign service allows you to launch or plan the launch of a campaign within Flexmail

Service Details

SOAP Action: SendCampaign
SOAP Return Object: SendCampaignResp

Input

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

Table: instance of SendCampaignReq

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

Output

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

Table: instance of SendCampaignResp

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

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

Example

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;
}
?>