366 Degrees

366 Web API

Authorize

Description:This will allow you to get Authentication Token for Open drip campaigns in 366 Degrees.
Method: Authenticate
URL:https://api.366.io/DripCampaignApis/api/Authorize2
 

Try it out

Authorize Information

 
App Key AppSecret Token
 

Sample Code

MVC Code

[HttpPost]
public ActionResult DetailsById(Campaign cam)
{
var result = string.Empty;
var finalresult = string.Empty;
dynamic json;
try
{
var postReq = (HttpWebRequest)WebRequest.Create(ConfigurationManager.AppSettings["Authorize"].ToString());
postReq.Method = "POST";
postReq.ContentType = "application/x-www-form-urlencoded";
postReq.Headers.Add("UserName", cam.UserName);
postReq.Headers.Add("Password", cam.Password);
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 = JsonConvert.SerializeObject(result);
}
dataStream?.Close();
response.Close();
json = JsonConvert.DeserializeObject(finalresult);
}
catch (Exception ex)
{
throw ex;
}
return Json(json, JsonRequestBehavior.AllowGet);
}

JQuery Code

$('#Dripsubmit').click(function ()
{
var cam = {
Key: $("#UserName").val(),
Secret: $("#Password").val(),
};
$.ajax({
url: "/OpenDripCampaign/Authorize",
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 Sample

{
AppKey:"1C9725BD-2159-47E0-B11B-C4EAA09E1CB3",
SecretKey:"D32EDBA4-C703-4680-8F74-2DB26930767B",
Token : "Y2xpZW50SWQ9MTMyMSxwYXJ0bmVySWQ9MSxkYXRhc291cmNlPU5pbWJsZQ==",
}