public WebhookAuditResult GetTaskHistory(Guid taskId, string token = null)
{
WebhookAuditResult historyResult;
string historyUrl = SchedulerConstants.TaskRelativePath + taskId.ToString() + SchedulerConstants.HistoryRelativePath;
var historyWebRequest = CreateWebApiRequest(historyUrl);
historyWebRequest.Method = HttpMethod.Get.Method;
try
{
var historyWebResponse = (HttpWebResponse)historyWebRequest.GetResponse();
using (var sr = new StreamReader(historyWebResponse.GetResponseStream()))
{
var jsonResponse = sr.ReadToEnd();
historyResult = JsonConvert.DeserializeObject<WebhookAuditResult>(jsonResponse);
}
}
catch (WebException webExp)
{
throw CreateSchedulerException(webExp);
}
return historyResult;
}