private string BuildCompletionReportUrl(Silanis.ESL.SDK.DocumentPackageStatus packageStatus, DateTime from, DateTime to) { string toDate = DateHelper.dateToIsoUtcFormat(to); string fromDate = DateHelper.dateToIsoUtcFormat(from); return(template.UrlFor(UrlTemplate.COMPLETION_REPORT_FOR_ALL_SENDERS_PATH) .Replace("{from}", fromDate) .Replace("{to}", toDate) .Replace("{status}", new PackageStatusConverter(packageStatus).ToAPIPackageStatus()) .Build()); }
private string BuildCompletionReportUrl(Silanis.ESL.SDK.DocumentPackageStatus packageStatus, String senderId, DateTime from, DateTime to) { string toDate = DateHelper.dateToIsoUtcFormat(to); string fromDate = DateHelper.dateToIsoUtcFormat(from); return(template.UrlFor(UrlTemplate.COMPLETION_REPORT_PATH) .Replace("{from}", fromDate) .Replace("{to}", toDate) .Replace("{status}", packageStatus.ToString()) .Replace("{senderId}", senderId) .Build()); }
public string DownloadCompletionReportAsCSV(Silanis.ESL.SDK.DocumentPackageStatus packageStatus, String senderId, DateTime from, DateTime to) { try { string path = BuildCompletionReportUrl(packageStatus, senderId, from, to); string response = restClient.Get(path, "text/csv"); return(response); } catch (EslServerException e) { throw new EslServerException("Could not download the completion report in csv." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not download the completion report in csv." + " Exception: " + e.Message, e); } }
public Silanis.ESL.SDK.CompletionReport DownloadCompletionReport(Silanis.ESL.SDK.DocumentPackageStatus packageStatus, String senderId, DateTime from, DateTime to) { try { string path = BuildCompletionReportUrl(packageStatus, senderId, from, to); string response = restClient.Get(path); Silanis.ESL.API.CompletionReport apiCompletionReport = JsonConvert.DeserializeObject <Silanis.ESL.API.CompletionReport>(response, settings); return(new CompletionReportConverter(apiCompletionReport).ToSDKCompletionReport()); } catch (EslServerException e) { throw new EslServerException("Could not download the completion report." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new EslException("Could not download the completion report." + " Exception: " + e.Message, e); } }
/// <summary> /// Construct with SDK PackageStatus object involved in conversion. /// </summary> /// <param name="sdkPackageStatus">SDK package status.</param> public PackageStatusConverter(Silanis.ESL.SDK.DocumentPackageStatus sdkPackageStatus) { this.sdkPackageStatus = sdkPackageStatus; }