Campaigns

Last updated: July 27th 2018

Introduction

About Campaigns

A Campaign the mechanism used to send an email or SMS. As part of the campaign process, you create a campaign, create one or more designs, create one or more segments and create one or more broadcasts. This section details the API calls that can be used to create and send campaigns.

AddCampaign

This API call creates a campaign. Login must be executed before any other service is executed. This establishes your identification for subsequent requests. The session will time out if the token is not used.

Authentication Endpoint
Method: POST
https://apinie.sensorpro.net/api/campaign/AddCampaign/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Request Body


    {
    "ExtLinkId": "",
    "Title": "",
    "Manager": "",
    "EndDate": "2018-07-26T09:19:59.666986+01:00",
    "GoogleAnalytics": false,
    "DoNotTrackLinkss": false,
    "Categories": false,
    "ServiceMessage": false,
    "CampaignType": 0,
    "EmailResultsAfter": 0,
    "EmailResultsMinSize": 0,
    "EmailResultsTo": ""
    }

Input Parameters

    • Required
    • Title: campaign title
    • Optional
    • Manager: Name of the Campaign Manager
    • EndDate: Campaign end date format yyyy-mm-dd
    • GoogleAnalytics: (true|false) enable Google Analytics
    • DoNotTrackLinkss: (true|false) do not track links
    • ServiceMessage: This campaign will be used to send service messages, ignoring optout status
    • CampaignType: 0=Standard (Default), Pending = 10, Recurring = 30, Trigger = 40, SMS = 50, SMSRecurring = 60, SMSTrigger = 70
    • EmailResultsAfter: Number of days after broadcast which results will be emailed
    • EmailResultsMinSize: Only email results for broadcasts greater than x size. This prevents results being emailed for tests.
    • EmailResultsTo: Email address to receive results

Response Output


{  
   "CampaignId":12,
   "SegmentId":0,
   "BroadcastId":0,
   "DesignIdHTML":"00000000-0000-0000-0000-000000000000",
   "DesignIdTXT":"00000000-0000-0000-0000-000000000000",
   "Result":{  
      "RequestId":"db013449-b0b3-4d9b-b326-df0fd14ef19e",
      "ErrorMessages":[  

      ],
      "StatusMesssages":[  

      ],
      "TotalStatusMessages":0,
      "TotalErrors":0
   }
}
Response Values:
  • CampaignId - The id for this campaign this will be required as an input for any subsequent calls to AddDesign, AddSegment, AddBroadcast
  • BroadcastId - Broadcast Id, will always be 0 for this API call
  • DesignIdHTML - HTML design id will always be "00000000-0000-0000-0000-000000000000" for this API call
  • DesignIdTXT - Text design id Will always be "00000000-0000-0000-0000-000000000000" for this API call
Sample Code:
                                                
var client = new RestClient("http://localhost:50026/api/campaign/AddCampaign/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\"Title\": \"Test api 1 Summer offers up to 50% off\",\"Manager\": \"\",\"EndDate\": \"2018-07-25\",\"GoogleAnalytics\": false,\"DoNotTrackLinkss\": false,\"Categories\": false,\"ServiceMessage\": false,\"ExtLinkId\": \"\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php
$curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_PORT => "50026",
    CURLOPT_URL => "http://localhost:50026/api/campaign/AddCampaign/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{    \"Title\": \"Test api 1 Summer offers up to 50% off\",    \"Manager\": \"\",    \"EndDate\": \"2018-07-25\",    \"GoogleAnalytics\": false,    \"DoNotTrackLinkss\": false,    \"Categories\": false,    \"ServiceMessage\": false,    \"ExtLinkId\": \"\"}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{    \"Title\": \"Test api 1 Summer offers up to 50% off\",    \"Manager\": \"\",    \"EndDate\": \"2018-07-25\",    \"GoogleAnalytics\": false,    \"DoNotTrackLinkss\": false,    \"Categories\": false,    \"ServiceMessage\": false,    \"ExtLinkId\": \"\"}");
Request request = new Request.Builder()
.url("http://localhost:50026/api/campaign/AddCampaign/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

AddDesignV2

Add a design to a campaign. This add the deisgn in the latest format which is version 2.

Add Design Endpoint
Method: POST
https://apinie.sensorpro.net/api/campaign/AddDesignV2/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request


{
    "CampaignId":2,
    "Name":"APIDesign",
    "Description":"My API test design",
    "ExtLinkId":"",
    "HTMLMessage":"<table class=\"ReadMsgBody\" style=\"background-color: #333333; table-layout: fixed; width: 100%!important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" bgcolor=\"#333333\"> <tbody> <tr> <td style=\"background-color: #333333;\" bgcolor=\"#333333\" width=\"100%\"> <table class=\"wrapper\" style=\"width: 600px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td class=\"webversion\"> <table class=\"responsive-table\" style=\"width: 600px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tbody> <tr> <td style=\"text-align: center;\" valign=\"middle\"> <table class=\"responsive-table\" style=\"width: 100%; background-color: #333333;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\"> <tbody> <tr> <td class=\"webversion-link\" style=\"font-size: 14px; font-family: Arial, sans-serif; color: #cccccc; text-align: center; padding: 10px 10px 10px 10px; background-color: #333333;\" align=\"center\"><a style=\"color: #cccccc;\" href=\"http://willbereplacedatbroadcasttime//run/v3.aspx?m ={smid}\">View this email in your web browser</a></td> </tr> <tr> <td style=\"color: #cccccc; background-color: #333333;\" align=\"center\"><img src=\"http://placehold.it/250x100\" alt=\"Logo\" width=\"250\" height=\"100\" border=\"0\" style=\"display: block;\" /></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <table class=\"ReadMsgBody\" style=\"width: 100% !important; table-layout: fixed; background-color: #333333;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td style=\"padding: 0 15px 50px 15px; background-color: #333333;\" align=\"center\" bgcolor=\"#333333\"> <table class=\"responsive-table\" style=\"width: 600px; background-color: #333333;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td class=\"padding-copy appleBody\" style=\"padding: 20px 0 0 0; background-color: #333333; font-size: 14px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #cccccc;\" align=\"left\"> <p>This email was sent to {personalemail}</p> <p>You can remove yourself from our list by <a style=\"color: #cccccc;\" href=\"http://192.168.1.4/SpinnakerPro//run/OO.aspx?m ={smid}\">clicking here</a>.</p> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table>",
    "TextMessage":"my text version {unsubscribe}",
    "StyleSheet":".test{}"
}

Input Parameters

  • Required
  • CampaignID - the campaign ID which design should be added
  • Name - design name. We recommend making these unique.
  • Description - design description. We recommend making these unique.
  • HTMLMessage - HTML text for message
  • Optional
  • ExtLinkId - link back to your external system. If a design with this external ID already exists the design will not be added.
  • TextMessage - text version of email
  • Stylesheet - the style sheet which goes with the design

Response Output

The key return values are DesignIdHTML and DesignIdTXT. These will be used to create a broadcast in a subsequent API call.


{
    "CampaignId": 2,
    "SegmentId": 0,
    "BroadcastId": 0,
    "DesignIdHTML": "0fb2d826-289f-40d4-a232-6c8557b2a457",
    "DesignIdTXT": "00000000-0000-0000-0000-000000000000",
    "Result": {
        "RequestId": "c1d0d891-fcc1-4b17-b854-d5bd6656f8c9",
        "ErrorMessages": [],
        "StatusMesssages": [],
        "TotalStatusMessages": 0,
        "TotalErrors": 0
    }
}

Response Values:
  • CampaignId - Campaign ID
  • SegmentId - Segment ID will always be 0 for this API call
  • BroadcastId - Broadcast ID will always be 0 for this API call
  • DesignIdHTML - This will be populated with the Design ID. This is required input for AddBroadcat.
  • DesignIdTXT - This will be populated with the Design ID if a HTML design is also created.
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/campaign/AddDesignv2/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{     \"CampaignId\":2,   \"Name\":\"APIDesign\",   \"Description\":\"My API test design\",   \"ExtLinkId\":\"\",   \"HTMLMessage\":\"
View this email in your web browser
\\\"Logo\\\"

This email was sent to {personalemail}

You can remove yourself from our list by clicking here.

\", \"TextMessage\":\"my text version {unsubscribe}\", \"StyleSheet\":\".test{}\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
                                                
<?php

$curl = curl_init();

    curl_setopt_array($curl, array(
    CURLOPT_URL => "https://apinie.sensorpro.net/api/campaign/AddDesignv2[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{  \"CampaignId\":2,\"Name\":\"APIDesign\",\"Description\":\"My API test design\",\"ExtLinkId\":\"\",\"HTMLMessage\":\"
View this email in your web browser
\\\"Logo\\\"

This email was sent to {personalemail}

You can remove yourself from our list by clicking here.

\",\"TextMessage\":\"my text version {unsubscribe}\",\"StyleSheet\":\".test{}\"}", CURLOPT_HTTPHEADER => array( "Content-Type: application/json" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo &quot;cURL Error #:&quot; . $err; } else { echo $response; }
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{     \"CampaignId\":2,   \"Name\":\"APIDesign\",   \"Description\":\"My API test design\",   \"ExtLinkId\":\"\",   \"HTMLMessage\":\"
View this email in your web browser
\\\"Logo\\\"

This email was sent to {personalemail}

You can remove yourself from our list by clicking here.

\", \"TextMessage\":\"my text version {unsubscribe}\", \"StyleSheet\":\".test{}\"}"); Request request = new Request.Builder() .url("https://apinie.sensorpro.net/api/campaign/AddDesignv2[Token]") .post(body) .addHeader("Content-Type", "application/json") .build(); Response response = client.newCall(request).execute();

AddSegment

Add a segment to a campaign.

AddSegment Endpoint
Method: POST
https://apinie.sensorpro.net/api/campaign/AddSegment/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request


{
    "CampaignId":12,
    "SegmentName":"MySeedSegment",
    "SegmentType":20,
    "Description":"API Seed Segment",
    "MultiStep":false,
    "Restricted":false,
    "ActiveOnly":true,
    "CustomRule":[
        {
            "LeftCondition":0,
            "LeftFunction":"",
            "Field":"personalemail",
            "Condition":"=",
            "RightFunction":"",
            "Value":"seed@gmail.com",
            "RightCondition":0,
            "AndOrNext":0
        }
    ],
    "RuleSeedList":"seed1@gmail.com",
    "RuleImportName":"",
    "ExtLinkId":""
    "DupEmailInDays": -1
}


Key Input Parameters

  • Required
  • CampaignId - the campaign id which design should be added
  • SegmentName - Segment name.
  • Segment Type
    • Import=0 (You must set the RuleImportName if targeting a specific import. That is the import name)
    • Seed List=10
    • Everyone=30
    • CustomRule=20
  • Description Segment description
  • Optional
  • MultiStep - Multistep segment
  • Restricted - This forces uniqueness across all segments in the campaign. Segments should be built one at a time.
  • ActiveOnly - Only include active contacts in the segment (NOT opted out and not bounced)
  • DupEmailInDays - Number of days since last broadcast. If someone was broadcast to within x days, exclude them. Default value is -1.
  • CustomRule (this is an array of condition)
    • LeftCondition 0 = None, 1 = Open Bracket, 2 = Close Bracket
    • LeftFunction ABS = Absolute, Floor = Floor, Ceiling = Ceiling, Soundex = Soundex,
    • Field Field name
    • Condition lt;, gt;, NotEqualTo, Like, NotLike, Is Null, Is Not Null
    • RightFunction @Blank, @DiffDays, @DiffWeeks, @DiffMonths, @DiffYears, @Month, @Day, @Year
    • Value The condition value
    • RightCondition 0 = None, 1 = Open Bracket, 2 = Close Bracket
    • AndOrNext AND, OR

Response Output

The key return value is SegmentId - this will be used to create a broadcast in a subsequent API call.

{  
   "CampaignId":12,
   "SegmentId":27,
   "BroadcastId":0,
   "DesignIdHTML":"00000000-0000-0000-0000-000000000000",
   "DesignIdTXT":"00000000-0000-0000-0000-000000000000",
   "Result":{  
      "RequestId":"0ad53069-1a30-43f4-9626-148d112d7451",
      "ErrorMessages":[  
      ],
      "StatusMesssages":[  
      ],
      "TotalStatusMessages":0,
      "TotalErrors":0
   }
}


Response Values:
  • CampaignId - Campaign id.
  • SegmentId - The segment id of the newly created segment.
  • BroadcastId - This will be 0 for this api call.
  • DesignIdHTML - This will not be set for this api call.
  • DesignIdTXT - This will not be set for this api call.
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/campaign/AddSegment/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{  \"CampaignId\":2,\"SegmentName\":\"MySeedSegment\",\"SegmentType\":20,\"Description\":\"API Seed Segment\",\"MultiStep\":false,\"Restricted\":false,\"ActiveOnly\":true,\"CustomRule\":[{   \"LeftCondition\":0,    \"LeftFunction\":\"\",    \"Field\":\"personalemail\",    \"Condition\":\"=\",    \"RightFunction\":\"\",    \"Value\":\"seed@gmail.com\",    \"RightCondition\":0,    \"AndOrNext\":0 }],\"RuleSeedList\":\"seed1@gmail.com\",\"RuleImportName\":\"\",\"ExtLinkId\":\"\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://apinie.sensorpro.net/api/campaign/AddSegment/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{  \"CampaignId\":2,\"SegmentName\":\"MySeedSegment\",\"SegmentType\":20,\"Description\":\"API Seed Segment\",\"MultiStep\":false,\"Restricted\":false,\"ActiveOnly\":true,\"CustomRule\":[{   \"LeftCondition\":0,    \"LeftFunction\":\"\",    \"Field\":\"personalemail\",    \"Condition\":\"=\",    \"RightFunction\":\"\",    \"Value\":\"seed@gmail.com\",    \"RightCondition\":0,    \"AndOrNext\":0 }],\"RuleSeedList\":\"seed1@gmail.com\",\"RuleImportName\":\"\",\"ExtLinkId\":\"\"}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{  \"CampaignId\":2,\"SegmentName\":\"MySeedSegment\",\"SegmentType\":20,\"Description\":\"API Seed Segment\",\"MultiStep\":false,\"Restricted\":false,\"ActiveOnly\":true,\"CustomRule\":[{   \"LeftCondition\":0,    \"LeftFunction\":\"\",    \"Field\":\"personalemail\",    \"Condition\":\"=\",    \"RightFunction\":\"\",    \"Value\":\"seed@gmail.com\",    \"RightCondition\":0,    \"AndOrNext\":0 }],\"RuleSeedList\":\"seed1@gmail.com\",\"RuleImportName\":\"\",\"ExtLinkId\":\"\"}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/campaign/AddSegment/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

AddBroadcast

Add a broadcast to a campaign.

AddBroadcast Endpoint
Method: POST
https://apinie.sensorpro.net/api/campaign/AddBroadcast/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request

{  
   "CampaignId":12,
   "SegmentId":27,
   "DesignHtmlId":"52c78e3c-f7d7-44c4-9a0e-cff00f918d58",
   "DesignTxtId":"00000000-0000-0000-0000-000000000000",
   "ExtLinkId":"",
   "Subject":"Test API Subject 1",
   "MsgType":0,
   "PageId":"00000000-0000-0000-0000-000000000000",
   "PageIdTxt":"00000000-0000-0000-0000-000000000000",
   "FromEmail":"test@sensorpro.net",
   "ReplyTo":"",
   "ReturnPath":"",
   "MailEncoding":"UTF8",
   "ExecuteOnUTCFormat":"2018-03-02T16:37:23.1905397Z",
   "ExecuteBroadcast":true
}

Key Input Parameters

  • Required
  • CampaignID - The campaign ID which design should be added
  • SegmentId - Segment Id
  • DesignHTMLId - Id of the html design
  • Subject - Subject Line
  • MsgType - Set to 0 currently no other option.
  • FromEmail - Set to 0 currently no other option. Example "Sales" <salesemail@mycompany.com>
  • Optional
  • DesignTxtId - Text design Id
  • ReplyTo - Reply to address
  • ReturnPath - Return path address
  • MailEncoding - Encoding "UFT8" is default
  • ExecuteOnUTCFormat - If scheduling set to a future date
  • ExecuteBroadcast - True|False, True execute broadcast now, or schedule for future send.

Response Output

The key return values are BroadcastId - this is the internal ID for that broadcast


{
    "CampaignId": 2,
    "SegmentId": 4,
    "BroadcastId": 1,
    "DesignIdHTML": "0fb2d826-289f-40d4-a232-6c8557b2a457",
    "DesignIdTXT": "00000000-0000-0000-0000-000000000000",
    "Result": {
        "RequestId": "e1422f95-50c3-47be-9a3b-b80578412ebc",
        "ErrorMessages": [],
        "StatusMesssages": [],
        "TotalStatusMessages": 0,
        "TotalErrors": 0
    }
}
Response Values:
  • CampaignId - Campaign id information only.
  • SegmentId - Segment id information only.
  • BroadcastId - Broadcast id information only.
  • DesignIdHTML - HTML Design id information only.
  • DesignIdTXT - TXT Design id information only.
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/campaign/AddBroadcast/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{  \"CampaignId\":2,\"SegmentId\":4,\"DesignHtmlId\":\"0fb2d826-289f-40d4-a232-6c8557b2a457\",\"DesignTxtId\":\"00000000-0000-0000-0000-000000000000\",\"ExtLinkId\":\"\",\"Subject\":\"Test API Subject 1\",\"MsgType\":0,\"PageId\":\"00000000-0000-0000-0000-000000000000\",\"PageIdTxt\":\"00000000-0000-0000-0000-000000000000\",\"FromEmail\":\"test@sensorpro.net\",\"ReplyTo\":\"\",\"ReturnPath\":\"\",\"MailEncoding\":\"UTF8\",\"ExecuteOnUTCFormat\":\"2018-03-02T16:37:23.1905397Z\",\"ExecuteBroadcast\":true}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://apinie.sensorpro.net/api/campaign/AddBroadcast/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{  \"CampaignId\":2,\"SegmentId\":4,\"DesignHtmlId\":\"0fb2d826-289f-40d4-a232-6c8557b2a457\",\"DesignTxtId\":\"00000000-0000-0000-0000-000000000000\",\"ExtLinkId\":\"\",\"Subject\":\"Test API Subject 1\",\"MsgType\":0,\"PageId\":\"00000000-0000-0000-0000-000000000000\",\"PageIdTxt\":\"00000000-0000-0000-0000-000000000000\",\"FromEmail\":\"test@sensorpro.net\",\"ReplyTo\":\"\",\"ReturnPath\":\"\",\"MailEncoding\":\"UTF8\",\"ExecuteOnUTCFormat\":\"2018-03-02T16:37:23.1905397Z\",\"ExecuteBroadcast\":true}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"CampaignId\":2,\"SegmentId\":4,\"DesignHtmlId\":\"0fb2d826-289f-40d4-a232-6c8557b2a457\",\"DesignTxtId\":\"00000000-0000-0000-0000-000000000000\",\"ExtLinkId\":\"\",\"Subject\":\"Test API Subject 1\",\"MsgType\":0,\"PageId\":\"00000000-0000-0000-0000-000000000000\",\"PageIdTxt\":\"00000000-0000-0000-0000-000000000000\",\"FromEmail\":\"test@sensorpro.net\",\"ReplyTo\":\"\",\"ReturnPath\":\"\",\"MailEncoding\":\"UTF8\",\"ExecuteOnUTCFormat\":\"2018-03-02T16:37:23.1905397Z\",\"ExecuteBroadcast\":true}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/campaign/AddBroadcast/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

ExecuteAllInOneCampaign

This call will create and execute an email campaign in one call. You must pass through the following information:

  • Campaign Data - this is the same information passed in the AddCampaign API call, this can be used as an extra reference.
  • Design Data - this is the same information passed in the AddDesign API call, this can be used as an extra reference.
  • Segment Data - this is the same information passed in the AddSegment API call, this can be used as an extra reference.
  • Broadcast Data - this is sthe sam information passed in the AddBroadcast API call, this can be used as an extra reference.
ExecuteAllInOneCampaign Endpoint
Method: POST
https://apinie.sensorpro.net/api/Campaign/ExecuteAllInOneCampaign/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request

{  
      "Campaign":{  
            "ExtLinkId":"",
            "Title":"MyApiCampaign",
            "Manager":"John Smith",
            "EndDate":"2018-04-15T15:54:56.4339611+01:00",
            "GoogleAnalytics":false,
            "DoNotTrackLinkss":false,
            "Categories":false,
            "ServiceMessage":false,
            "CampaignType": 0,
            "EmailResultsAfter": 0,
            "EmailResultsMinSize": 0,
            "EmailResultsTo": ""
   },
      "Design":{  
            "CampaignId":0,
            "Name":"My Design",
            "Description":"",
            "ExtLinkId":"MyDesign20180701",
            "HTMLMessage":"<table class=\"ReadMsgBody\" style=\"background-color: #333333; table-layout: fixed; width: 100%!important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" bgcolor=\"#333333\"> <tbody> <tr> <td style=\"background-color: #333333;\" bgcolor=\"#333333\" width=\"100%\"> <table class=\"wrapper\" style=\"width: 600px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td class=\"webversion\"> <table class=\"responsive-table\" style=\"width: 600px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tbody> <tr> <td style=\"text-align: center;\" valign=\"middle\"> <table class=\"responsive-table\" style=\"width: 100%; background-color: #333333;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"left\"> <tbody> <tr> <td class=\"webversion-link\" style=\"font-size: 14px; font-family: Arial, sans-serif; color: #cccccc; text-align: center; padding: 10px 10px 10px 10px; background-color: #333333;\" align=\"center\"><a style=\"color: #cccccc;\" href=\"http://willbereplacedatbroadcasttime//run/v3.aspx?m={smid}\">View this email in your web browser<\/a><\/td> <\/tr> <tr> <td style=\"color: #cccccc; background-color: #333333;\" align=\"center\"><img src=\"http://placehold.it/250x100\" alt=\"Logo\" width=\"250\" height=\"100\" border=\"0\" style=\"display: block;\" /><\/td> <\/tr> <\/tbody> <\/table> <\/td> <\/tr> <\/tbody> <\/table> <\/td> <\/tr> <\/tbody> <\/table> <\/td> <\/tr> <\/tbody> <\/table> <table class=\"ReadMsgBody\" style=\"width: 100% !important; table-layout: fixed; background-color: #333333;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td style=\"padding: 0 15px 50px 15px; background-color: #333333;\" align=\"center\" bgcolor=\"#333333\"> <table class=\"responsive-table\" style=\"width: 600px; background-color: #333333;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"> <tbody> <tr> <td class=\"padding-copy appleBody\" style=\"padding: 20px 0 0 0; background-color: #333333; font-size: 14px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #cccccc;\" align=\"left\"> <p>This email was sent to {personalemail}<\/p> <p>You can remove yourself from our list by <a style=\"color: #cccccc;\" href=\"http://192.168.1.4/SpinnakerPro//run/OO.aspx?m={smid}\">clicking here<\/a>.<\/p> <\/td> <\/tr> <\/tbody> <\/table> <\/td> <\/tr> <\/tbody> <\/table>",
            "TextMessage":"",
            "StyleSheet":""         
   },
      "Segment":{  
            "CampaignId":0,
            "SegmentName":"Everyone",
            "SegmentType":30,
            "Description":"Everyone All Active Contacts",
            "MultiStep":false,
            "Restricted":false,
            "ActiveOnly":true,
            "CustomRule":[],
            "RuleSeedList":"",
            "RuleImportName":"",
            "ExtLinkId":""         
   },
      "Broadcast":{  
            "CampaignId":0,
            "SegmentId":0,
            "DesignHtmlId":"00000000-0000-0000-0000-000000000000",
            "DesignTxtId":"00000000-0000-0000-0000-000000000000",
            "ExtLinkId":"",
            "Subject":"Test API Subject",
            "MsgType":0,
            "PageId":"00000000-0000-0000-0000-000000000000",
            "PageIdTxt":"00000000-0000-0000-0000-000000000000",
            "FromEmail":"test@sensorpro.net",
            "ReplyTo":"",
            "ReturnPath":"",
            "MailEncoding":"UTF8",
            "ExecuteOnUTCFormat":"2018-03-16T15:54:56.4339611Z",
            "ExecuteBroadcast":true         
   },
      "Options":{"Parameters":{},"Action":""}
}


Key Input Parameters

Campaign (required fields are marked with *)
Type Field Default Description
String ExternalId   External ID link to source system
String *Title   Campaign Title
String *Manager   Campaign Manager
DateTime *EndDate today +30 days Campaign End Date
bool GoogleAnalytics false Enable Google analytic tracking on links
bool DoNotTrackLinks false Disable link tracking
bool Categories false Category campaign
Design (required fields are marked with *)
Type Field Default Description
String *Name   Design Name
String *Description   Description
int *SegmentType   0 = Select Import, 10 = Seed, 20 = Custom Rule, 10 = Everyone (all active contacts),
String *HTMLMessage   HTML Design (html encoded)
string TextMessage   Text version of HTML message (text only)
string ExtLinkID   External Link ID to source system
Segment (required fields are marked with *)
Type Field Default Description
String *SegmentName   Segment Name
String *SegmentType   Segment Type; 0=Import, 10=Seed List, 20=Custom Rule, 30=Everyone
String *Description   Description
bool MultiStep false Multistep segment
bool Restricted false Restricted segment (enforce de-duplication against other segments in the same campaign on segment build).
bool ActiveOnly   Only include active contacts
array of RuleDefinition CustomRule   Required for custom rule targeting
string RuleSeedList comma separated string of emails. Required for seed list segments
string RuleImportName Import name Required for segment types of import
string ExtLinkId   Link to external system
Broadcast (required fields are marked with *)
Type Field Default Description
String ExtLinkId   Link to External System
String *Subject   Subject line
MessageType *MsgType   HTML Or Text only
long SegmentId 0 For the all in one call, this should be 0
Guid PageId 00000000-0000-0000-0000-000000000000 For the all in one call this should be empty GUID
Guid PageIdTxt 00000000-0000-0000-0000-000000000000 For the all in one call this should be empty GUID
string *FromEmail email address From whom the email is sent
string ReplyTo email address Reply to address
string ReturnPath email address Return Path
DateTime *ExecuteOnUTCFormat CurrentDate Time Execute broadcast on this date time. UTC format.
bool *ExecuteBroadcast true Execute broadcast based on "ExecuteonUTCFormat"
string MailEncoding UTF8 Encoding to use for email

Response Output

The key values returned are as follows: CampaignId, DesignIdHTML, DesignIdTxt, SegmentId and BroadcastId.

{  
   "CampaignId":13,
   "SegmentId":30,
   "BroadcastId":1,
   "DesignIdHTML":"52c78e3c-f7d7-44c4-9a0e-cff00f918d58",
   "DesignIdTXT":"00000000-0000-0000-0000-000000000000",
   "Result":{  
      "RequestId":"b0c01cbe-e850-4dca-b338-7a7d199fb13f",
      "ErrorMessages":[  

      ],
      "StatusMesssages":[  

      ],
      "TotalStatusMessages":0,
      "TotalErrors":0
   }
}



Response Values:
  • CampaignId - Campaign ID of newly created campaign.
  • SegmentId - Segment ID of newly created segment.
  • BroadcastId - Broadcast ID of newly broadcast.
  • DesignIdHTML - HTML design ID of newly created html design.
  • DesignIdTXT - TEXT design ID of newly created TXT design if one was passed through.
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/Campaign/ExecuteAllInOneCampaign/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\"Campaign\":{\"ExtLinkId\":\"\",\"Title\":\"MyApiCampaign\",\\"Manager\":\"John Smith\",\\"EndDate\":\"2018-04-15T15:54:56.4339611+01:00\",\\"GoogleAnalytics\":false,\\"DoNotTrackLinkss\":false,\\"Categories\":false,\\"ServiceMessage\":false,\\"CampaignType\": 0,\\"EmailResultsAfter\": 0,\\"EmailResultsMinSize\": 0,\\"EmailResultsTo\": \"\"}, \"Design\":{  \\"CampaignId\":0,\\"Name\":\"My Design\",\\"Description\":\"\",\\"ExtLinkId\":\"MyDesign20180701\",\\"HTMLMessage\":\"<table class=\\\"ReadMsgBody\\\" style=\\\"background-color: #333333; table-layout: fixed; width: 100%!important;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\" bgcolor=\\\"#333333\\\"> <tbody> <tr> <td style=\\\"background-color: #333333;\\\" bgcolor=\\\"#333333\\\" width=\\\"100%\\\"> <table class=\\\"wrapper\\\" style=\\\"width: 600px;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td class=\\\"webversion\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 600px;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\"> <tbody> <tr> <td style=\\\"text-align: center;\\\" valign=\\\"middle\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 100%; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"left\\\"> <tbody> <tr> <td class=\\\"webversion-link\\\" style=\\\"font-size: 14px; font-family: Arial, sans-serif; color: #cccccc; text-align: center; padding: 10px 10px 10px 10px; background-color: #333333;\\\" align=\\\"center\\\"><a style=\\\"color: #cccccc;\\\" href=\\\"http://willbereplacedatbroadcasttime//run/v3.aspx?m={smid}\\\">View this email in your web browser<\\/a><\\/td> <\\/tr> <tr> <td style=\\\"color: #cccccc; background-color: #333333;\\\" align=\\\"center\\\"><img src=\\\"http://placehold.it/250x100\\\" alt=\\\"Logo\\\" width=\\\"250\\\" height=\\\"100\\\" border=\\\"0\\\" style=\\\"display: block;\\\" /><\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <table class=\\\"ReadMsgBody\\\" style=\\\"width: 100% !important; table-layout: fixed; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td style=\\\"padding: 0 15px 50px 15px; background-color: #333333;\\\" align=\\\"center\\\" bgcolor=\\\"#333333\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 600px; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td class=\\\"padding-copy appleBody\\\" style=\\\"padding: 20px 0 0 0; background-color: #333333; font-size: 14px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #cccccc;\\\" align=\\\"left\\\"> <p>This email was sent to {personalemail}<\\/p> <p>You can remove yourself from our list by <a style=\\\"color: #cccccc;\\\" href=\\\"http://192.168.1.4/SpinnakerPro//run/OO.aspx?m={smid}\\\">clicking here<\\/a>.<\\/p> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table>\",\\"TextMessage\":\"\",\\"StyleSheet\":\"\"}, \"Segment\":{  \\"CampaignId\":0,\\"SegmentName\":\"Everyone\",\\"SegmentType\":30,\\"Description\":\"Everyone All Active Contacts\",\\"MultiStep\":false,\\"Restricted\":false,\\"ActiveOnly\":true,\\"CustomRule\":[],\\"RuleSeedList\":\"\",\\"RuleImportName\":\"\",\\"ExtLinkId\":\"\"}, \"Broadcast\":{  \\"CampaignId\":0,\\"SegmentId\":0,\\"DesignHtmlId\":\"00000000-0000-0000-0000-000000000000\",\\"DesignTxtId\":\"00000000-0000-0000-0000-000000000000\",\\"ExtLinkId\":\"\",\\"Subject\":\"Test API Subject\",\\"MsgType\":0,\\"PageId\":\"00000000-0000-0000-0000-000000000000\",\\"PageIdTxt\":\"00000000-0000-0000-0000-000000000000\",\\"FromEmail\":\"test@sensorpro.net\",\\"ReplyTo\":\"\",\\"ReturnPath\":\"\",\\"MailEncoding\":\"UTF8\",\\"ExecuteOnUTCFormat\":\"2018-03-16T15:54:56.4339611Z\",\\"ExecuteBroadcast\":true}, \"Options\":{\"Parameters\":{},\"Action\":\"\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://apinie.sensorpro.net/api/Campaign/ExecuteAllInOneCampaign/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{\"Campaign\":{  \\"ExtLinkId\":\"\",\\"Title\":\"MyApiCampaign\",\\"Manager\":\"John Smith\",\\"EndDate\":\"2018-04-15T15:54:56.4339611+01:00\",\\"GoogleAnalytics\":false,\\"DoNotTrackLinkss\":false,\\"Categories\":false,\\"ServiceMessage\":false,\\"CampaignType\": 0,\\"EmailResultsAfter\": 0,\\"EmailResultsMinSize\": 0,\\"EmailResultsTo\": \"\"}, \"Design\":{  \\"CampaignId\":0,\\"Name\":\"My Design\",\\"Description\":\"\",\\"ExtLinkId\":\"MyDesign20180701\",\\"HTMLMessage\":\"<table class=\\\"ReadMsgBody\\\" style=\\\"background-color: #333333; table-layout: fixed; width: 100%!important;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\" bgcolor=\\\"#333333\\\"> <tbody> <tr> <td style=\\\"background-color: #333333;\\\" bgcolor=\\\"#333333\\\" width=\\\"100%\\\"> <table class=\\\"wrapper\\\" style=\\\"width: 600px;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td class=\\\"webversion\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 600px;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\"> <tbody> <tr> <td style=\\\"text-align: center;\\\" valign=\\\"middle\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 100%; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"left\\\"> <tbody> <tr> <td class=\\\"webversion-link\\\" style=\\\"font-size: 14px; font-family: Arial, sans-serif; color: #cccccc; text-align: center; padding: 10px 10px 10px 10px; background-color: #333333;\\\" align=\\\"center\\\"><a style=\\\"color: #cccccc;\\\" href=\\\"http://willbereplacedatbroadcasttime//run/v3.aspx?m={smid}\\\">View this email in your web browser<\\/a><\\/td> <\\/tr> <tr> <td style=\\\"color: #cccccc; background-color: #333333;\\\" align=\\\"center\\\"><img src=\\\"http://placehold.it/250x100\\\" alt=\\\"Logo\\\" width=\\\"250\\\" height=\\\"100\\\" border=\\\"0\\\" style=\\\"display: block;\\\" /><\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <table class=\\\"ReadMsgBody\\\" style=\\\"width: 100% !important; table-layout: fixed; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td style=\\\"padding: 0 15px 50px 15px; background-color: #333333;\\\" align=\\\"center\\\" bgcolor=\\\"#333333\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 600px; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td class=\\\"padding-copy appleBody\\\" style=\\\"padding: 20px 0 0 0; background-color: #333333; font-size: 14px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #cccccc;\\\" align=\\\"left\\\"> <p>This email was sent to {personalemail}<\\/p> <p>You can remove yourself from our list by <a style=\\\"color: #cccccc;\\\" href=\\\"http://192.168.1.4/SpinnakerPro//run/OO.aspx?m={smid}\\\">clicking here<\\/a>.<\\/p> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table>\",\\"TextMessage\":\"\",\\"StyleSheet\":\"\"}, \"Segment\":{  \\"CampaignId\":0,\\"SegmentName\":\"Everyone\",\\"SegmentType\":30,\\"Description\":\"Everyone All Active Contacts\",\\"MultiStep\":false,\\"Restricted\":false,\\"ActiveOnly\":true,\\"CustomRule\":[],\\"RuleSeedList\":\"\",\\"RuleImportName\":\"\",\\"ExtLinkId\":\"\"}, \"Broadcast\":{  \\"CampaignId\":0,\\"SegmentId\":0,\\"DesignHtmlId\":\"00000000-0000-0000-0000-000000000000\",\\"DesignTxtId\":\"00000000-0000-0000-0000-000000000000\",\\"ExtLinkId\":\"\",\\"Subject\":\"Test API Subject\",\\"MsgType\":0,\\"PageId\":\"00000000-0000-0000-0000-000000000000\",\\"PageIdTxt\":\"00000000-0000-0000-0000-000000000000\",\\"FromEmail\":\"test@sensorpro.net\",\\"ReplyTo\":\"\",\\"ReturnPath\":\"\",\\"MailEncoding\":\"UTF8\",\\"ExecuteOnUTCFormat\":\"2018-03-16T15:54:56.4339611Z\",\\"ExecuteBroadcast\":true}, \"Options\":{\"Parameters\":{},\"Action\":\"\"}}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}


                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"Campaign\":{  \\"ExtLinkId\":\"\",\\"Title\":\"MyApiCampaign\",\\"Manager\":\"John Smith\",\\"EndDate\":\"2018-04-15T15:54:56.4339611+01:00\",\\"GoogleAnalytics\":false,\\"DoNotTrackLinkss\":false,\\"Categories\":false,\\"ServiceMessage\":false,\\"CampaignType\": 0,\\"EmailResultsAfter\": 0,\\"EmailResultsMinSize\": 0,\\"EmailResultsTo\": \"\"}, \"Design\":{  \\"CampaignId\":0,\\"Name\":\"My Design\",\\"Description\":\"\",\\"ExtLinkId\":\"MyDesign20180701\",\\"HTMLMessage\":\"<table class=\\\"ReadMsgBody\\\" style=\\\"background-color: #333333; table-layout: fixed; width: 100%!important;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\" bgcolor=\\\"#333333\\\"> <tbody> <tr> <td style=\\\"background-color: #333333;\\\" bgcolor=\\\"#333333\\\" width=\\\"100%\\\"> <table class=\\\"wrapper\\\" style=\\\"width: 600px;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td class=\\\"webversion\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 600px;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\"> <tbody> <tr> <td style=\\\"text-align: center;\\\" valign=\\\"middle\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 100%; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"left\\\"> <tbody> <tr> <td class=\\\"webversion-link\\\" style=\\\"font-size: 14px; font-family: Arial, sans-serif; color: #cccccc; text-align: center; padding: 10px 10px 10px 10px; background-color: #333333;\\\" align=\\\"center\\\"><a style=\\\"color: #cccccc;\\\" href=\\\"http://willbereplacedatbroadcasttime//run/v3.aspx?m={smid}\\\">View this email in your web browser<\\/a><\\/td> <\\/tr> <tr> <td style=\\\"color: #cccccc; background-color: #333333;\\\" align=\\\"center\\\"><img src=\\\"http://placehold.it/250x100\\\" alt=\\\"Logo\\\" width=\\\"250\\\" height=\\\"100\\\" border=\\\"0\\\" style=\\\"display: block;\\\" /><\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table> <table class=\\\"ReadMsgBody\\\" style=\\\"width: 100% !important; table-layout: fixed; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td style=\\\"padding: 0 15px 50px 15px; background-color: #333333;\\\" align=\\\"center\\\" bgcolor=\\\"#333333\\\"> <table class=\\\"responsive-table\\\" style=\\\"width: 600px; background-color: #333333;\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\" align=\\\"center\\\"> <tbody> <tr> <td class=\\\"padding-copy appleBody\\\" style=\\\"padding: 20px 0 0 0; background-color: #333333; font-size: 14px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #cccccc;\\\" align=\\\"left\\\"> <p>This email was sent to {personalemail}<\\/p> <p>You can remove yourself from our list by <a style=\\\"color: #cccccc;\\\" href=\\\"http://192.168.1.4/SpinnakerPro//run/OO.aspx?m={smid}\\\">clicking here<\\/a>.<\\/p> <\\/td> <\\/tr> <\\/tbody> <\\/table> <\\/td> <\\/tr> <\\/tbody> <\\/table>\",\\"TextMessage\":\"\",\\"StyleSheet\":\"\"}, \"Segment\":{  \\"CampaignId\":0,\\"SegmentName\":\"Everyone\",\\"SegmentType\":30,\\"Description\":\"Everyone All Active Contacts\",\\"MultiStep\":false,\\"Restricted\":false,\\"ActiveOnly\":true,\\"CustomRule\":[],\\"RuleSeedList\":\"\",\\"RuleImportName\":\"\",\\"ExtLinkId\":\"\"}, \"Broadcast\":{  \\"CampaignId\":0,\\"SegmentId\":0,\\"DesignHtmlId\":\"00000000-0000-0000-0000-000000000000\",\\"DesignTxtId\":\"00000000-0000-0000-0000-000000000000\",\\"ExtLinkId\":\"\",\\"Subject\":\"Test API Subject\",\\"MsgType\":0,\\"PageId\":\"00000000-0000-0000-0000-000000000000\",\\"PageIdTxt\":\"00000000-0000-0000-0000-000000000000\",\\"FromEmail\":\"test@sensorpro.net\",\\"ReplyTo\":\"\",\\"ReturnPath\":\"\",\\"MailEncoding\":\"UTF8\",\\"ExecuteOnUTCFormat\":\"2018-03-16T15:54:56.4339611Z\",\\"ExecuteBroadcast\":true}, \"Options\":{\"Parameters\":{},\"Action\":\"\"}}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/Campaign/ExecuteAllInOneCampaign/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

GetBroadcastStatus

This call will return the current results for the selected campaign. These results will correspond to the results on the campaign dashboard.

GetBroadcastStatus Endpoint
Method: POST
https://apinie.sensorpro.net/api/Campaign/GetBroadcastStatus/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.

Simple Sample Request

{  
   "CampaignId":12
}

Input Parameters

  • CampaignID (required): ID of Campaign containing the broadcast you are looking up.

Sample Response Output

{  
   "BroadcastStatusList":[  
      {  
         "LogLink":"http://localhost:50026/Admin/Logmain.aspx?FunctionId=&LogKey1=12&LogKey2=1",
         "Status":-10,
         "Subject":"TEST API SUBJECT 1",
         "BroadcastId":1
      }
   ],
   "Result":{  
      "RequestId":"00000000-0000-0000-0000-000000000000",
      "ErrorMessages":[  

      ],
      "StatusMesssages":[  

      ],
      "TotalStatusMessages":0,
      "TotalErrors":0
   }
}



Response Values:
  • BroadcastStatusList: A collection of broadcast for this campaign and there status
  • LogLink - Link to the broadcast log
  • Status - -10 Error, 2 Queued, 10 Ready To Send, 20 Scheduled, 30 Sending, 40 Finished
  • Subject - Subject line of the broadcast
  • BroadcastId - Broadcast ID
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/Campaign/GetBroadcastStatus/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{  \"CampaignId\":1}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://apinie.sensorpro.net/api/Campaign/GetBroadcastStatus/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{  \"CampaignId\":1}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{  \"CampaignId\":1}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/Campaign/GetBroadcastStatus/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

GetCampaignResults

This call will return the current results for the selected campaign. These results will correspond to the results on the campaign dashboard.

Authentication Endpoint
Method: POST
https://apinie.sensorpro.net/api/campaign/GetCampaignResults/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request


{  
   "CampaignId":12
}


Input Parameters

  • CampaignID (required)

Response Output


{
    "Segments": [
        {
        "CampId": 2,
        "SegmentId": 4,
        "SegmentName": "MySeedSegment",
        "Description": "API Seed Segment",
        "Status": 20,
        "SelectedTot": 0
        },
        {
        "CampId": 2,
        "SegmentId": 5,
        "SegmentName": "dd",
        "Description": "dd",
        "Status": 0,
        "SelectedTot": -1
        },
        {
        "CampId": 2,
        "SegmentId": 8,
        "SegmentName": "MySeedSegment",
        "Description": "API Seed Segment",
        "Status": 0,
        "SelectedTot": -1
        }
    ],
    "Broadcasts": [
        {
        "TriggerStatus": false,
        "TextMessage": "my text version {unsubscribe}",
        "SMSMessage": "",
        "CampId": 2,
        "BroadCastId": 1,
        "Status": -10,
        "Sent": 0,
        "Failed": 0,
        "Subject": "Test API Subject 1",
        "MessageType": 0,
        "BroadCastDate": "2018-03-02T16:37:23.19",
        "SegmentId": 4,
        "PageId": "0fb2d826-289f-40d4-a232-6c8557b2a457",
        "PageIdTxt": "00000000-0000-0000-0000-000000000000",
        "FromEmail": "test@sensorpro.net",
        "EmailEncoding": "UTF8",
        "ReplyTo": ""
        }
    ],
    "LastBroadcast": "2018-07-26T11:38:15.873",
    "CampId": 2,
    "Title": "API test",
    "CampaignOptOut": 0,
    "TotalOpenedEMail": 0,
    "TotalEMailsSent": 0,
    "TotalBounced": 0,
    "TotalImpressions": 0,
    "TotalTAF": 0,
    "TotalUnOpenedEMail": 0,
    "TotalURLUniqueOpens": 0,
    "TotalSpamPerOfSent": 0,
    "TotalOpenedEMailPerOfSent": 0,
    "TotalBouncedPerOfSent": 0,
    "CampaignOptOutPerOfSent": 0,
    "TotalURLUniqueOpensPerOfSent": 0,
    "TotalDelivered": 0,
    "PurgedCampaign": false,
    "Result": {
    "RequestId": "d7720e64-b077-4198-8265-d1cd677ff403",
    "ErrorMessages": [],
    "StatusMesssages": [],
    "TotalStatusMessages": 0,
    "TotalErrors": 0
    }
}

Response Details
Type Field Description
Object Segments List of segments used in the campaign
Object Broadcast List of broadcasts used in the campaign
long CampaignOptOut Optout Count
long TotalOpenedEMail Count of uniquely opened emails
long TotalEMailsSent Count of emails sent
long TotalBounced Count of bounced emails
long TotalImpressions Count of impressions
long TotalTAF Refer a friend count
long TotalUnOpenedEMail Unopened email count
long TotalURLUniqueOpens URL click through count
long TotalSpamReports Spam count
decimal TotalSpamPerOfSent Spam reports as percent of sent
decimal TotalOpenedEMailPerOfSent Opens as percent of sent emails
decimal TotalBouncedPerOfSent Bounced as percent of sent emails
decimal CampaignOptOutPerOfSent Opt outs as percent of sent
decimal TotalURLUniqueOpensPerOfSent Link Clicks as percent of sent
bool TotalSpamPerOfSent Spam reports as percent of sent
decimal PurgedCampaign Is campaign purged
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/campaign/GetCampaignResults/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{  \"CampaignId\":2}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://apinie.sensorpro.net/api/campaign/GetCampaignResults/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{  \"CampaignId\":2}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{  \"CampaignId\":2}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/campaign/GetCampaignResults/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

TriggerEmail

Trigger an email for a contact, the contact will be added if it does not exist. This function requires a triggered email campaign to be setup in advance. This API call is asynchronous and the trigger request is queued thus the API call returns immediately.

TriggerEmail Endpoint
Method: POST
https://apinie.sensorpro.net/api/Campaign/TriggerEmail/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request


{
    "CampId":"9e06ba0c-1ce1-48c9-80a8-154ce9403fd0",
    "BroadcastId":1,
    "APIKey":"bba25fcd-83a0-42a0-8855-f48b0ae92892",
    "Delay":0,
    "ContactData":{
        "Title":"",
        "FirstName":"John",
        "LastName":"Smith",
        "PersonalEMail":"rcoa.dy@gmail.com"
    },
    "NamedPairsParameters":{
        "Invoice":"IV00101120",
        "Body":"Test Content"
    }
}

Key Input Parameters

  • CampId: required, this can be got from the triggered email campaign
  • BroadcastId: required, the broadcast which will be sent
  • ApiKey: required, this can be got from the triggered email campaign
  • Delay: optional, delay in minutes before email is sent
  • ContactData: required, minimum value is “personalemail”
  • NamedParameters: optional, allow you to pass data through to the email design. For example, if you have an invoice number which you want to pass through to the email design, you could create a named pair parameter called “Invoice”. This can be referenced on the email design with {Invoice} - the value will be substituted in as the email is sent out. Note: emails which use named parameters should not include a view in browser link. As the data being passed forward is transient, it will not be available after the email is sent.
  • PhoneMobile: required if sending SMS messages, not required if sending email

Response Output


{
    "Result": {
    "RequestId": "0c5bf11d-2bd5-4afe-8702-ae0ecf5d66ad",
    "ErrorMessages": [],
    "StatusMesssages": [
    {
    "Code": "RequestQueued",
    "Description": "Request queued with request ID 8b2174eb-d191-445c-9738-ac8d14de3b3c",
    "Sequence": 0
    }
    ],
    "TotalStatusMessages": 1,
    "TotalErrors": 0
    }
}


Response Values:
  • RequestId - The request id of the submitted triggered email. This can be checked through the ui menu Admin > Setup > API > API > Triggered Email Queue
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/Campaign/TriggerEmail/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{  \"CampId\":\"9e06ba0c-1ce1-48c9-80a8-154ce9403fd0\",\"BroadcastId\":1,\"APIKey\":\"bba25fcd-83a0-42a0-8855-f48b0ae92892\",\"Delay\":0,\"ContactData\":{\"Title\":\"\", \"FirstName\":\"John\", \"LastName\":\"Smith\", \"PersonalEMail\":\"rcoa.dy@gmail.com\"},\"NamedPairsParameters\":{\"Invoice\":\"IV00101120\", \"Body\":\"Test Content\"}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://apinie.sensorpro.net/api/Campaign/TriggerEmail/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{  \"CampId\":\"9e06ba0c-1ce1-48c9-80a8-154ce9403fd0\",\"BroadcastId\":1,\"APIKey\":\"bba25fcd-83a0-42a0-8855-f48b0ae92892\",\"Delay\":0,\"ContactData\":{\"Title\":\"\", \"FirstName\":\"John\", \"LastName\":\"Smith\", \"PersonalEMail\":\"rcoa.dy@gmail.com\"},\"NamedPairsParameters\":{\"Invoice\":\"IV00101120\", \"Body\":\"Test Content\"}}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                            
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{  \"CampId\":\"9e06ba0c-1ce1-48c9-80a8-154ce9403fd0\",\"BroadcastId\":1,\"APIKey\":\"bba25fcd-83a0-42a0-8855-f48b0ae92892\",\"Delay\":0,\"ContactData\":{\"Title\":\"\", \"FirstName\":\"John\", \"LastName\":\"Smith\", \"PersonalEMail\":\"rcoa.dy@gmail.com\"},\"NamedPairsParameters\":{\"Invoice\":\"IV00101120\", \"Body\":\"Test Content\"}}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/Campaign/TriggerEmail/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

GetMetricsFromQueue

This API will retrieve metrics which have been queued for export. That means that Export integration must be active. When integration is active metric clicks are queued in a file waiting to be picked up by this API call. To enable, select Admin | Setup | System Settings; on "FTP/ODBC" tab select "Integration Active". As metrics come in, records will be written to the export queue.

Authentication Endpoint
Method: POST
https://apinie.sensorpro.net/api/Campaign/GetMetricsFromQueue/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request


{
    "Paging": {
        "Page": 1,
        "PageSize": 1,
        "Options": {
        "Parameters": {},
        "Action": ""
    },
    "Fields": []
    },
    "MetricType": 40
}

Key Input Parameters

  • GetMetrics (Object)
    • Paging: optional ID to link campaign to your system.
      • Page: This api call returns the data a page at a time. This indicates which page to get. If paging through the complete data set increate the page count by one until no more data is returned.
      • PageSize: This indicates how many contacts to return at a time.
      • Fields: This is not applicable for this API call.
    • MetricType:
      • -2 Open email metric
      • 0 Microsite click
      • 60 URL click
      • 40 Unsubscribe and opt back in
      • 70 Bounce emails and un-bounce emails
      • 170 Category unsubscribe and category opt back in
      • 230 SMS unsubscribe and opt back in
{ 
- "MetricResults": [1]
	-0:  {
		-"contactData": { ... }
		"Subject": "Test Subject Line"
		"URL": ""
		"BroadcastId": "na"
		"Date": "2018-04-01"
		"MessageID": "19"
		"MetricType": "OpenEmail"
	}
	- "Result": {
		"RequestID": "9e123654-46f4-232a-441f-f324e3433a9812"
		"ErrorMessages": [0]
		"StatusMesssages": [0]
		"TotalStatusMessages": 0
		"TotalErrors": 0
	}
}

Response Output

  • Array of metric results containing:
    • ContactData: Contains the contact record which the metric applies to. Only the fields will be populated which were passed forward in the request.
    • Subject: Email subject line
    • URL: Will be populated only if metric clicked
    • Date: Date the metric was registered
    • MessageId: Message ID
    • Metric Type: Contains the following:
      • OpenEmail: open email metric
      • UrlClick: URL click
      • OptBackIn: email opt back in
      • OptOut: email opt out
      • Bounced: bounced email
      • Active: email un-bounced
      • CatOptIn: category opt in
      • CatOptOut: category optout
      • SMSOptOut: SMS opt out
      • SMSOptBackIn: SMS opt back in
      • ClickToMicroSite: Click to microsite
Note: Once the export metric is retrieved it cannot be gotten again. It is marked as completed.
Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/Campaign/GetMetricsFromQueue/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{ \"Paging\": {   \"Page\": 1,   \"PageSize\": 1,   \"Options\": {   \"Parameters\": {},   \"Action\": \"\" }, \"Fields\": [] }, \"MetricType\": 40}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://apinie.sensorpro.net/api/Campaign/GetMetricsFromQueue/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{ \"Paging\": {   \"Page\": 1,   \"PageSize\": 1,   \"Options\": {   \"Parameters\": {},   \"Action\": \"\" }, \"Fields\": [] }, \"MetricType\": 40}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \"Paging\": {   \"Page\": 1,   \"PageSize\": 1,   \"Options\": {   \"Parameters\": {},   \"Action\": \"\" }, \"Fields\": [] }, \"MetricType\": 40}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/Campaign/GetMetricsFromQueue/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

GetCampaignByLastBroadcastDate

This API will retrieve a list of campaigns selected by last broadcast date.

Authentication Endpoint
Method: POST
https://apinie.sensorpro.net/api/Campaign/GetCampaignByLastBroadcastDate/[Token]

Copy to Clipboard

  • [Token] replace with the access token returned by the login.
Header Values
Header Example Description
Content-Type application/json  

Simple Sample Request

{
	"FROMDATE":"2018-05-01",
	"TODATE":"2018-07-01",
    "LISTNAME":""
}


Key Input Parameters

  • Required
  • FromDate: The "From" date (required)
  • ToDate: The "To" date (required)
  • Optional
  • ListName: The name of the list (optional).

Response Output

Array of campaigns containing the following structure:

"CAMPAIGNLIST": [
        {
            "CAMPID": 2112,
            "TITLE": "JULY SALE",
            "MANAGER": "RICHARD SMITH",
            "STARTDATE": "2018-05-04T00:00:00",
            "ENDDATE": "2018-07-04T00:00:00",
            "EXTCAMPAIGN": "",
            "TOTALSENT": 4,
            "EXTERNALID": "B41E360B-F042-4CC8-A355-1ABAB8872BA8",
            "FROMEMAIL": {
                "DISPLAYNAME": "MARKETING",
                "USER": "MARKETING",
                "HOST": "SENSORPRO.NET",
                "ADDRESS": "MARKETING@SENSORPRO.NET"
            },
            "REPLYTOEMAIL": NULL,
            "SUBJECT": "UP TO 50% OFF SALE ON SELECTED ITEMS",
            "LASTBROADCAST": "2018-05-08T15:36:23.643",
            "LISTNAME": "2018-05-05T15:36:23.643"
        }
    ],
    "RESULT": {
        "REQUESTID": "B71D3A98-D425-4071-97B6-054D8DFBF930",
        "ERRORMESSAGES": [],
        "STATUSMESSSAGES": [],
        "TOTALSTATUSMESSAGES": 0,
        "TOTALERRORS": 0
    }
}



Sample Code:
                                                
var client = new RestClient("https://apinie.sensorpro.net/api/Campaign/GetCampaignByLastBroadcastDate/[Token]");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\t\"FROMDATE\":\"2018-05-01\",\t\"TODATE\":\"2018-07-01\", \"LISTNAME\":\"\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
                                                
                                                
                                                
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => "https://apinie.sensorpro.net/api/Campaign/GetCampaignByLastBroadcastDate/[Token]",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{\t\"FROMDATE\":\"2018-05-01\",\t\"TODATE\":\"2018-07-01\", \"LISTNAME\":\"\"}",
    CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
    ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
                                                
                                                
                                                
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\t\"FROMDATE\":\"2018-05-01\",\t\"TODATE\":\"2018-07-01\", \"LISTNAME\":\"\"}");
Request request = new Request.Builder()
.url("https://apinie.sensorpro.net/api/Campaign/GetCampaignByLastBroadcastDate/[Token]")
.post(body)
.addHeader("Content-Type", "application/json")
.build();

Response response = client.newCall(request).execute();
                                                
                                                

Developers Love Us - Create Your Account Now!