private string BuildCompletionReportUrl(OneSpanSign.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()); }
public string DownloadCompletionReportAsCSV(OneSpanSign.Sdk.DocumentPackageStatus packageStatus, DateTime from, DateTime to) { try { string path = BuildCompletionReportUrl(packageStatus, from, to); string response = restClient.Get(path, "text/csv"); return(response); } catch (OssServerException e) { throw new OssServerException("Could not download the completion report in csv." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new OssException("Could not download the completion report in csv." + " Exception: " + e.Message, e); } }
public OneSpanSign.Sdk.CompletionReport DownloadCompletionReport(OneSpanSign.Sdk.DocumentPackageStatus packageStatus, String senderId, DateTime from, DateTime to) { try { string path = BuildCompletionReportUrl(packageStatus, senderId, from, to); string response = restClient.Get(path); OneSpanSign.API.CompletionReport apiCompletionReport = JsonConvert.DeserializeObject <OneSpanSign.API.CompletionReport>(response, settings); return(new CompletionReportConverter(apiCompletionReport).ToSDKCompletionReport()); } catch (OssServerException e) { throw new OssServerException("Could not download the completion report." + " Exception: " + e.Message, e.ServerError, e); } catch (Exception e) { throw new OssException("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(OneSpanSign.Sdk.DocumentPackageStatus sdkPackageStatus) { this.sdkPackageStatus = sdkPackageStatus; }