C# Code
public Contact GetContactById(string App_Key, string App_Secret, string Contact_Email)
{
var request = new RestRequest("/api/Contact/GetContactByEmailId", Method.GET) { RequestFormat = DataFormat.Json };
request.AddHeader("Contact_Email", Contact_Email);
request.AddHeader("App_Key", App_Key);
request.AddHeader("App_Secret", App_Secret);
var response = client.Execute
(request);
return response.Data;
}
JQuery Code
function getContactByEmailId()
{
jQuery.support.cors = true;
var emailid = $('#txtContactEmail').val();
var appkey = $('#txtAppKey').val();
var appsecret = $('#txtAppSecret').val();
$.ajax({
url: 'http://366.io/366ContactLeadAPI/api/Contact/GetContactByEmailId',
type: 'GET',
contentType: "application/json; charset=utf-8",
headers: { 'App_Key': appkey, 'App_Secret': appsecret, 'Contact_Email': emailid },
success: function (data) {
//Success Data
},
error: function () {
alert('error');
}
});
}