366 Degrees

366 Web API

List of Open Drip Campaigns

Active Open Drip Campaigns

Description: Integrating 366 Open drip campaign functionality to an external page in Third party applications.

URL:https://api.366.io/OpenDripExternal

Querystring Parameters:App Key (Mandatory), App Secret (Mandatory), Data Source (defaulted to 366 Degrees,provide datasource name if not 366) Theme(defaulted to Card,other option is Table),Contact Name(Mandatory),Contact Email(Mandatory) Sender Email (Optional), Sender Name (Optional)

External URL:

Try it out

(Optional)
(Optional)

Active Open Drip Campaigns

Campaign Name Schedule Date Description

Sample Code

C# Code

public ActionResult DetailsById(Campaign cam)
{
var result = string.Empty;
var finalresult = string.Empty;
dynamic json;
try
{
var postReq = (HttpWebRequest)WebRequest.Create(ConfigurationManager.AppSettings["Authenticate"].ToString());
postReq.Method = "POST";
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
postReq.ContentType = "application/x-www-form-urlencoded";
postReq.Headers.Add("appkey", cam.Key);
postReq.Headers.Add("secretkey", cam.Secret);
postReq.Headers.Add("datasource", cam.DataSource);
var dataStream = postReq.GetRequestStream();
dataStream.Close();
var response = postReq.GetResponse();
dataStream = response.GetResponseStream();
if (dataStream != null)
{
var reader = new StreamReader(dataStream);
result = reader.ReadToEnd();
reader.Close();
finalresult = GetOpenDripCampaingns(result);
// Session["RootPath"] = result;
finalresult = JsonConvert.SerializeObject(finalresult);
}
dataStream?.Close();
response.Close();
json = JsonConvert.DeserializeObject(finalresult);
}
catch (Exception ex)
{
throw ex;
}
return Json(json, JsonRequestBehavior.AllowGet);
}

JQuery Code

$('#submitExternalDrip').click(function () {
var form = $("form");
form.validate();
if (form.valid() && !window.isSubmitted) {
window.isSubmitted = true;
var cam = {
Key: $("#Key").val(),
Secret: $("#Secret").val(),
DataSource: $("#DataSource").val() ? $("#DataSource").val() : "366Degrees"
Theme: $("#Theme1").val()
ContactName: $("#ContactName1").val()
ContactEmail: $("#EmailId1").val()
SenderName: $("#SenderName").val()
SenderEmail: $("#SenderEmail").val()
};
$.ajax({
url: "/OpenDripExternal/DetailsById",
type: "POST",
contentType: "application/json;charset=utf-8",
data: JSON.stringify(cam),
dataType: 'json',
timeout: 1200000,
async: true,
success: function (data) {
//Success Data
},
error: function (err) {
alert('Error')
}
});
});

Json Output

{
campaign_Id : "1",
campaignName : "DripCampaign Open",
campaignScheduledDate : "08-03-2018",
}