Example #1
0
        public OneSpanSign.API.Result <OneSpanSign.API.Sender> GetSenders(Direction direction, PageRequest request)
        {
            string path = template.UrlFor(UrlTemplate.ACCOUNT_MEMBER_LIST_PATH)
                          .Replace("{dir}", DirectionUtility.getDirection(direction))
                          .Replace("{from}", request.From.ToString())
                          .Replace("{to}", request.To.ToString())
                          .Build();

            try
            {
                string response = restClient.Get(path);
                OneSpanSign.API.Result <OneSpanSign.API.Sender> apiResponse =
                    JsonConvert.DeserializeObject <OneSpanSign.API.Result <OneSpanSign.API.Sender> >(response,
                                                                                                     jsonSettings);

                return(apiResponse);
            }
            catch (OssServerException e)
            {
                throw new OssServerException("Failed to retrieve Account Members List.\t" + " Exception: " + e.Message,
                                             e.ServerError, e);
            }
            catch (Exception e)
            {
                throw new OssException("Failed to retrieve Account Members List.\t" + " Exception: " + e.Message, e);
            }
        }
Example #2
0
        public IList <OneSpanSign.API.CustomField> GetCustomFields(Direction direction, PageRequest request)
        {
            string path = template.UrlFor(UrlTemplate.ACCOUNT_CUSTOMFIELD_LIST_PATH)
                          .Replace("{dir}", DirectionUtility.getDirection(direction))
                          .Replace("{from}", request.From.ToString())
                          .Replace("{to}", request.To.ToString())
                          .Build();

            try
            {
                string response = client.Get(path);
                return(JsonConvert.DeserializeObject <IList <OneSpanSign.API.CustomField> > (response, settings));
            }
            catch (OssServerException e)
            {
                throw new OssServerException("Could not get the list of custom fields from account." + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e)
            {
                throw new OssException("Could not get the list of custom fields from account." + " Exception: " + e.Message, e);
            }
        }
Example #3
0
        public Result <Package> GetLayouts(Direction direction, PageRequest request)
        {
            string path = template.UrlFor(UrlTemplate.LAYOUT_LIST_PATH)
                          .Replace("{dir}", DirectionUtility.getDirection(direction))
                          .Replace("{from}", request.From.ToString())
                          .Replace("{to}", request.To.ToString())
                          .Build();

            try
            {
                string response = restClient.Get(path);
                return(JsonConvert.DeserializeObject <Result <OneSpanSign.API.Package> >(response, settings));
            }
            catch (OssServerException e)
            {
                throw new OssServerException("Could not get list of layouts." + " Exception: " + e.Message, e.ServerError, e);
            }
            catch (Exception e)
            {
                throw new OssException("Could not get list of layouts." + " Exception: " + e.Message, e);
            }
        }