Aditi.Scheduler.ScheduledTasks.GetTaskHistory C# (CSharp) Method

GetTaskHistory() public method

public GetTaskHistory ( System.Guid taskId, string token = null ) : WebhookAuditResult
taskId System.Guid
token string
return Aditi.Scheduler.Models.WebhookAuditResult
        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;
        }