Creating a new campaign

The controller can be used to create, check and send campaigns.

Call: POST /rest/campaigns/create

Data in POST:

name Required Campaign name
url Optional Address of HTML page
html Required* HTML content in email (required if there is no text content)
text Required* Text content in email (required if there is no HTML content)
subject Optional The subject of the email to be sent through the system. If there is no subject then the name of the campaign will be used.
from_address Optional The “from” field - if left empty, the sender address from the system will be used by default.
from_name Optional The “sender” field - if left empty, the sender name from the system will be used by default.
reply_to Optional The “reply to” field - if left empty, the sender address from the system will be used by default.
list Required * Hash subscription lists that campaign should be sent to. Lists can be in table form if campaign is for multiple lists.
group Required * Hash groups that campaign should be sent to. Groups can be in table form if campaign is for multiple groups.
resignlink Optional URL address to which subscribers who want to resign are directed to.

 

Returned data:

hash A properly created campaign will be assigned a hash.

 

Error codes:

1701 No campaign name
1702 No content
1703 Error in URL address
1704 Client error (internal)
1705 No parameters (internal)
1706 Error in sender address (from_address)
1707 Error in “reply to” address
1708 No subscribers lists or groups
1709 At least one hash has an error
1710 At least one hash group has an error
1711 Nothing found for hash given
1712 No group found for hash given
1713 Resignation link not in proper URL format.