366 Degrees

366 Web API

Save Activity

Add Activity To Activity Stream

Description: This will allow you to add an activity event to the 366 Degrees Activity Stream for a particular contact record.
Method: Post
URL: https://api.366.io/Activitiesapi/api/ActivityStream/Post
 

Try it out

Sample Code

C# Code

public void PostActivity(ActivityStream actstream)
{
var request = new RestRequest("/api/ActivityStream/Post", Method.POST) { RequestFormat = DataFormat.Json };
request.AddHeader("App_Key", actstream.App_Key);
request.AddHeader("App_Secret", actstream.App_Secret);
request.AddHeader("Activity_Name", actstream.Activity_Name);
request.AddHeader("Activity_Description", actstream.Activity_Description);
request.AddHeader("Activity_Date", actstream.Activity_Date);
request.AddHeader("Activity_Type", actstream.Activity_Type);
request.AddHeader("Activity_Status", actstream.Activity_Status);
request.AddHeader("Asset_Type", actstream.Asset_Type);
request.AddHeader("Asset_Id", actstream.Asset_Id.ToString());
request.AddHeader("eMail_Status", actstream.eMail_Status);
request.AddHeader("CampaignSchedule_Id", actstream.CampaignSchedule_Id);
var response = client.Execute(request);
}

JQuery Code

function saveActivity() {
jQuery.support.cors = true;
var appkey = $('#txtAppKey').val();
var appsecret = $('#txtAppSecret').val();
var actName = $('#txtActivityName').val();
var actDesc = $('#txtActivityDescription').val();
var actDate = $('#txtActivityDate').val();
if (appkey == '' & appsecret == '' & actName == '' & actDesc == '' & actDate == '') {
alert("Please provide the values for 'App_Key','App_Secret', 'Activity_Name', 'Activity_Description', 'Activity_Date'");
return false;
}
else {
$.ajax({
url: 'http://api.366.io/Activitiesapi/api/ActivityStream/Post',
type: 'GET',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(obj),
headers:
{
'App_Key': $('#txtAppKey').val(),
'App_Secret': $('#txtAppSecret').val(),
'Activity_Name': $('#txtActivityName').val(),
'Activity_Description': $('#txtActivityDescription').val(),
'Activity_Date': $('#txtActivityDate').val(),
'Activity_Type': $('#txtActivityType').val(),
'Activity_Status': $('#txtActivityStatus').val(),
'Asset_Type': $('#txtAssetType').val(),
'Asset_Id': $('#txtAssetId').val(),
'eMail_Status': $('#txteMailStatus').val(),
'CampaignSchedule_Id': $('#txtCampaignScheduleId').val()
},
success: function (data) {
alert(data);
},
error: function () {
alert('error');
}
});
}
}

Json Output

{
"Contact Created Successfully"
}