Campaign.Send
Schedules an existing campaign for sending.
The campaign must be imported with defined recipients. For campaigns with more than 5 recipients the user must have sufficient credits or their credit card details saved within the application for the campaign to be sent via the API. For campaigns with 5 recipients or less the user must have enough test campaigns remaining in their API account.
Parameters and required information
Here’s a list of all the parameters you’ll need to pass to the Campaign.Send method. All of the parameters are required unless otherwise noted.
ApiKey
Your API application key. See here for more details.
CampaignID
The ID of the campaign to send. This ID is returned by the Campaign.Create method.
Confirmation Email Address
The email address that the confirmation email that the campaign has been sent will go to.
Delivery Date
The date the campaign should be scheduled to be sent. To send a campaign immediately pass in “Immediately”. This date should be in the users timezone and formatted as YYYY-MM-DD HH:MM:SS.
Return Codes
Success
Upon a successful call, this method will return a Result object with the newly create Campaign’s ID as the Code.
Error
5: Invalid Date
The Send Date provided was invalid.
100: Invalid API Key
The API key pass was not valid or has expired.
301: Invalid CampaignID
The Campaign ID value passed in was not valid.
331: Campaign has already been sent
The campaign has already been sent.
332: No Recipients Added
There are no recipient lists or segments added to this campaign.
333: No Test Campaigns Available
Each customer can send a limited number of test campaigns (of less than 6 recipients). Contact support.
334: Campaign Pending Approval
This client doesn’t have approval to send to a list of recipients of this size.
335: Payment Details Required
The payment details for this client are required.
336: Campaign Payment Failed
Payment for this campaign failed. Either there weren’t sufficient credits or the payment details were rejected.
337: Delivery Date Cannot be in the Past
The delivery date was set to a date in the past.
338: Confirm Email Required
The email address for campaign sent confirmation cannot be empty.
339: Confirm Email Invalid
The email address for campaign sent confirmation is invalid.
340: Recipient Lists Empty
The selected subscriber lists and/or segments contain no subscribers
SOAP 1.1
The following is a sample SOAP request and response. The placeholders shown need to be replaced with actual values.
POST /api/api.asmx HTTP/1.1
Host: api.createsend.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://api.createsend.com/api/Campaign.Send"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Campaign.Send xmlns="http://api.createsend.com/api/">
<ApiKey>string</ApiKey>
<CampaignID>string</CampaignID>
<ConfirmationEmail>string</ConfirmationEmail>
<SendDate>string</SendDate>
</Campaign.Send>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Campaign.SendResponse xmlns="http://api.createsend.com/api/">
<Campaign.SendResult>
<Code>int</Code>
<Message>string</Message>
</Campaign.SendResult>
</Campaign.SendResponse>
</soap:Body>
</soap:Envelope>
HTTP GET
The following is a sample HTTP GET request and response. The placeholders shown need to be replaced with actual values.
GET /api/api.asmx/Campaign.Send?ApiKey=string&CampaignID=string&ConfirmationEmail=string&SendDate=string HTTP/1.1
Host: api.createsend.com
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<Result xmlns="http://api.createsend.com/api/">
<Code>int</Code>
<Message>string</Message>
</Result>
HTTP POST
The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.
POST /api/api.asmx/Campaign.Send HTTP/1.1
Host: api.createsend.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length
ApiKey=string&CampaignID=string&ConfirmationEmail=string&SendDate=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<Result xmlns="http://api.createsend.com/api/">
<Code>int</Code>
<Message>string</Message>
</Result>