Campaign.Create
Creates a campaign for an existing client. This campaign will be imported and ready to send to the subscribers in the specified lists and segments. Please note: Since this method uses an array for the subscriber lists and segments it can only be accessed via SOAP, and not HTTP-GET/POST.
The campaign must have both HTML and plain text content, imported from the internet. Styling for the HTML content will be automatically brought inline.
Parameters and required information
Here’s a list of all the parameters you’ll need to pass to the Campaign.Create method. All of the parameters are required unless otherwise noted.
ApiKey
Your API application key. See here for more details.
ClientID
Your API application key. See here for more details.
Campaign Name
The name of the new campaign. This must be unique across all draft campaigns for the client.
Campaign Subject
The subject of the new campaign.
From Name
The name to appear in the From field in the recipients email client when they receive the new campaign.
From Email Address
The email address that the new campaign will come from.
Reply To Email Address
The email address that any replies to the new campaign will be sent to.
HTML Content URL
The URL of the HTML content for the new campaign. If no unsubscribe link is found then one will be added automatically. Styling in the campaign will be automatically brought inline. If your URL has querystring values, you will need to encode them.
Text Content URL
The URL of the Text content for the new campaign. If no unsubscribe link is found then one will be added automatically.
Subscriber Lists
An array of lists to send the campaign to. See here for more details.
Subscriber List Segments
An array of Segment Names and their appropriate List ID’s to send the campaign to.
Return Codes
Success
Upon a successful call, this method will return a string containing the CampaignID of the newly created campaign.
Error
Any error condition will return a Result object, containing a Code and a Message.
100: Invalid API Key
The API key pass was not valid or has expired.
102: Invalid ClientID
The ListID value passed in was not valid.
303: Duplicate Campaign Name
The campaign name passed in already exists for this client.
304: Campaign Subject Required
A campaign subject must be provided.
305: From Name Required
The From name field is required and must be provided.
307: Invalid From Email Address
The From Email Address must be a valid email address.
308: Reply to Address Required
The Reply-To Address is a required field and must be provided.
309: Invalid Reply-To Address
The Reply-To Address must be a valid email address.
310: HTML Content URL Required
You must provide a URL of the HTML content for your campaign.
311: Invalid HTML Content
Your content contains JavaScript or Flash which cannot be sent to email clients.
312: Text Content URL Required
You must provide a URL of the Text content for your campaign.
313: Invalid ListID’s
The List ID’s you supplied are invalid.
314: Invalid Segments
The Segments you supplied are invalid.
315: Lists or Segments Required
You must provide either List ID’s or Segments to send to.
316: Problems Importing Links
There was a problem parsing and importing your links.
317: Link Too Long
At least one of your links was too long to import.
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.Create"
<?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.Create xmlns="http://api.createsend.com/api/">
<ApiKey>string</ApiKey>
<ClientID>string</ClientID>
<CampaignName>string</CampaignName>
<CampaignSubject>string</CampaignSubject>
<FromName>string</FromName>
<FromEmail>string</FromEmail>
<ReplyTo>string</ReplyTo>
<HtmlUrl>string</HtmlUrl>
<TextUrl>string</TextUrl>
<SubscriberListIDs>
<string>string</string>
<string>string</string>
</SubscriberListIDs>
<ListSegments>
<List>
<ListID>string</ListID>
<Name>string</Name>
</List>
<List>
<ListID>string</ListID>
<Name>string</Name>
</List>
</ListSegments>
</Campaign.Create>
</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.CreateResponse xmlns="http://api.createsend.com/api/">
<Campaign.CreateResult>
<Code>int</Code>
<Message>string</Message>
</Campaign.CreateResult>
</Campaign.CreateResponse>
</soap:Body>
</soap:Envelope>