CreateCampaign
Creation of the campaign.
URL | https://api.enginemailer.com/restapi/Campaign/EMCampaign/CreateCampaign |
Method | HTTP POST |
Note: The user can only create campaign with the maximum number of 200. If intend to create more campaign, you are required to delete older campaigns.
Table: Parameter
Parameter name | Description | Column Type |
---|---|---|
Data | A list of data to create the campaign. | JSON String |
Table: Data Definition for JSON
Parameter name | Description | Column Type | Maximum Length | Required? |
---|---|---|---|---|
CampaignName | List of sub categories id of the subscriber. It is pre-defined in the portal and it can be retrieved by invoking getSubCategory method. | JArray (Int) |
128 | Yes |
SenderName | The custom field value of the subscriber. All the custom field value must be in correct format based on their field type. | Jarray (JObject) |
128 | Yes |
SenderEmail | Email of the sender. The email domain must be verified in the account. | String |
128 | Yes |
Subject | Subject | String |
256 | Yes |
Content | HTML content of the Campaign | String |
256(KB) | Yes |
Request Example
Header
<APIKEY> - Value
Body
{
"CampaignName": "hello world",
"SenderName": "support",
"SenderEmail": "support@enginemailer.com",
"Subject": "Promotion 1",
"Content": "This is my content"
}
Response
Success Response
{
"Result":{
"Status":"OK",
"StatusCode":"200",
"CampaignID": "2200"
}
}
Failed Response
{
"Result":{
"StatusCode":"500",
"Status":"InternalServerError",
"ErrorMessage":"Authentication Failed!"
}
}
Code Example (.NET)
Using REST SHARP library , please download from Nuget Package
JObject jb = new JObject();
jb.Add("campaignname", "camp name");
jb.Add("sendername", "sender");
jb.Add("senderemail", "sender@enginemailer.com");
jb.Add("subject", "subject");
jb.Add("Content", "content");
var client = new RestClient("https://api.enginemailer.com/restapi/Campaign/EMCampaign/CreateCampaign");
var request = new RestRequest(Method.POST);
request.AddHeader("APIKey", "YOUR API KEY");
request.AddParameter("email", jb.ToString(), ParameterType.RequestBody);
var response = client.Execute(request).Content;