public void OnGet() { // List the user's envelopes created in the last 10 days // 1. Create request options // 2. Use the SDK to list the envelopes // 1. Create request options ListStatusChangesOptions options = new ListStatusChangesOptions(); DateTime date = DateTime.Now.AddDays(envelopesAgeDays); options.fromDate = date.ToString("yyyy/MM/dd"); // 2. Use the SDK to list the envelopes ApiClient apiClient = new ApiClient(basePath); apiClient.Configuration.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(apiClient.Configuration); EnvelopesInformation results = envelopesApi.ListStatusChanges(accountId, options); // Prettyprint the results string json = JsonConvert.SerializeObject(results); string jsonFormatted = JValue.Parse(json).ToString(Formatting.Indented); ViewData["results"] = jsonFormatted; return; }
public void OnGet([FromQuery(Name = "page")] string page) { // Constants need to be set: string accessToken = config.Value.AccessToken; string accountId = config.Value.AccountId; // List the user's envelopes created in the last 10 days // 1. Create request options // 2. Use the SDK to list the envelopes // 1. Create request options ListStatusChangesOptions options = new ListStatusChangesOptions(); DateTime date = DateTime.Now.AddDays(envelopesAgeDays); options.fromDate = date.ToString("yyyy/MM/dd"); // 2. Use the SDK to list the envelopes ApiClient apiClient = new ApiClient(basePath); apiClient.Configuration.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(apiClient.Configuration); //EnvelopesInformation results = envelopesApi.ListStatusChanges(accountId, options); string EnvelopeId = page; if (string.IsNullOrEmpty(page)) { return; } var resultsEnvelope = envelopesApi.GetEnvelope(accountId, EnvelopeId); // Prettyprint the results string json = JsonConvert.SerializeObject(resultsEnvelope); string jsonFormatted = JValue.Parse(json).ToString(Formatting.Indented); ViewData["results"] = jsonFormatted; var resultsRecipents = envelopesApi.ListRecipients(accountId, EnvelopeId); // Prettyprint the results json = JsonConvert.SerializeObject(resultsRecipents); jsonFormatted = JValue.Parse(json).ToString(Formatting.Indented); ViewData["resultsRecipents"] = jsonFormatted; var resultsDocuments = envelopesApi.ListDocuments(accountId, EnvelopeId); // Prettyprint the results json = JsonConvert.SerializeObject(resultsDocuments); jsonFormatted = JValue.Parse(json).ToString(Formatting.Indented); ViewData["resultsDocuments"] = jsonFormatted; return; }
public EnvelopesInformation ListChanges(int envelopeLifetimeInDays) { var envelopeApi = PrepareApi(); var options = new ListStatusChangesOptions(); var date = DateTime.Now.AddDays(-envelopeLifetimeInDays); options.fromDate = date.ToString("yyyy/MM/dd"); return(envelopeApi.ListStatusChanges(AccountID, options)); }
/// <summary> /// This method get status for one or more envelope(s) in the last 30 days /// </summary> /// <returns>returns envelopes information</returns> internal EnvelopesInformation List() { CheckToken(); EnvelopesApi envelopeApi = new EnvelopesApi(ApiClient.Configuration); ListStatusChangesOptions options = new ListStatusChangesOptions(); DateTime date = DateTime.Now.AddDays(-30); options.fromDate = date.ToString("yyyy/MM/dd"); return(envelopeApi.ListStatusChanges(AccountID, options)); }
// ***DS.snippet.0.start private EnvelopesInformation DoWork(string accessToken, string basePath, string accountId) { // Data for this method // accessToken // basePath // accountId var apiClient = new ApiClient(basePath); apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " + accessToken); var envelopesApi = new EnvelopesApi(apiClient); ListStatusChangesOptions options = new ListStatusChangesOptions(); options.fromDate = DateTime.Now.AddDays(-30).ToString("yyyy/MM/dd"); // Call the API method: EnvelopesInformation results = envelopesApi.ListStatusChanges(accountId, options); return(results); }
/// <summary> /// Returns information about the envelopes in this DocuSign account /// </summary> /// <param name="accessToken">Access Token for API call (OAuth)</param> /// <param name="basePath">BasePath for API calls (URI)</param> /// <param name="accountId">The DocuSign Account ID (GUID or short version) for which the APIs call would be made</param> /// <returns>Object containing envelopes information</returns> public static EnvelopesInformation ListAllEnvelope(string accessToken, string basePath, string accountId) { // Data for this method // accessToken // basePath // accountId var config = new Configuration(new ApiClient(basePath)); config.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(config); ListStatusChangesOptions options = new ListStatusChangesOptions(); options.fromDate = DateTime.Now.AddDays(-30).ToString("yyyy/MM/dd"); // Call the API method: EnvelopesInformation results = envelopesApi.ListStatusChanges(accountId, options); return(results); }
// ***DS.snippet.0.start private EnvelopesInformation DoWork(string accessToken, string basePath, string accountId) { // Data for this method // accessToken // basePath // accountId var config = new Configuration(new ApiClient(basePath)); config.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(config); ListStatusChangesOptions options = new ListStatusChangesOptions(); //options.fromDate = DateTime.Now.AddDays(-30).ToString("yyyy/MM/dd"); /*Para inserir filtro Data*/ //options.fromToStatus = "voided"; /*Para inserir Filtro Status*/ options.envelopeIds = "70e509ed-67bb-4466-ba51-4d75d325abe5"; /*Para inserir Filtro pelo IDenvelope*/ // Call the API method: EnvelopesInformation results = envelopesApi.ListStatusChanges(accountId, options); return(results); }
public IActionResult OnGet() { if (!CheckToken()) { return(Challenge()); } string accessToken = RequestItemsService.User.AccessToken; string basePath = RequestItemsService.Session.BasePath + "/restapi"; string accountId = RequestItemsService.Session.AccountId; var config = new Configuration(new ApiClient(basePath)); config.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(config); ListStatusChangesOptions options = new ListStatusChangesOptions { fromDate = DateTime.Now.AddDays(-30).ToString("yyyy/MM/dd") }; EnvelopesInformation = envelopesApi.ListStatusChanges(accountId, options); ViewBag.EnvelopesInformation = EnvelopesInformation; return(View("EnvelopsList")); }