public void RequestStatusesExTest() { // Create and send an envelope DocuSignWeb.Envelope envelope1 = HeartbeatTests.CreateBasicEnvelope(_accountId, "request statuses ex test"); envelope1 = HeartbeatTests.CreateEnvelopeWithDocumentAndTabs(envelope1); DocuSignWeb.EnvelopeStatus status1 = _apiClient.CreateAndSendEnvelope(envelope1); envelopeIDs.Add(status1.EnvelopeID); // Create, send and void another envelope DocuSignWeb.Envelope envelope2 = HeartbeatTests.CreateBasicEnvelope(_accountId, "request statuses ex test"); envelope2 = HeartbeatTests.CreateEnvelopeWithDocumentAndTabs(envelope2); DocuSignWeb.EnvelopeStatus status2 = _apiClient.CreateAndSendEnvelope(envelope2); DocuSignWeb.VoidEnvelopeStatus voidStatus = _apiClient.VoidEnvelope(status2.EnvelopeID, "statuses ex testing"); // Create a filter using account ID and today as a start time DocuSignWeb.EnvelopeStatusFilter filter = new DocuSignWeb.EnvelopeStatusFilter(); filter.AccountId = _accountId; DocuSignWeb.EnvelopeStatusFilterBeginDateTime begin = new DocuSignWeb.EnvelopeStatusFilterBeginDateTime(); begin.Value = DateTime.Today; filter.BeginDateTime = begin; // Request all envelopes that match the filter DocuSignWeb.FilteredEnvelopeStatuses statuses = _apiClient.RequestStatusesEx(filter); HeartbeatTests.PurgeEnvelope(status2.EnvelopeID, _apiClient); // Confirm that we got at least two envelope statuses back Assert.GreaterOrEqual(statuses.EnvelopeStatuses.Length, 2); Console.WriteLine("We have {0} statuses that match account ID {1}", statuses.EnvelopeStatuses.Length, statuses.EnvelopeStatusFilter.AccountId); foreach (DocuSignWeb.EnvelopeStatus eStatus in statuses.EnvelopeStatuses) { Console.WriteLine("\tEnvelope with ID {0}", eStatus.EnvelopeID); foreach (DocuSignWeb.DocumentStatus dStatus in eStatus.DocumentStatuses) { Console.WriteLine("\t\tDocument with ID {0} has name {1}", dStatus.ID, dStatus.Name); } } }
public void RequestStatusCodesTest() { // Create the status change filter to specify the scope of your search // Here, we are limiting the search to envelopes changed today // You can also limit by user and status DocuSignWeb.EnvelopeStatusFilter filter = new DocuSignWeb.EnvelopeStatusFilter(); filter.AccountId = _accountId; DocuSignWeb.EnvelopeStatusFilterBeginDateTime begin = new DocuSignWeb.EnvelopeStatusFilterBeginDateTime(); begin.Value = DateTime.Today; filter.BeginDateTime = begin; // Now, make the call with the filter we created DocuSignWeb.FilteredEnvelopeStatusChanges codes = _apiClient.RequestStatusCodes(filter); // This test isn't pass fail, because your filter may not match // anything if (codes.ResultSetSize > 0) { Assert.Greater(codes.ResultSetSize, 0); // Loop through and print out some information about the results Console.WriteLine("Changes since today are:"); foreach (DocuSignWeb.EnvelopeStatusChange code in codes.EnvelopeStatusChanges) { Console.WriteLine("\tEnvelope {0} has status: {1}\n", code.EnvelopeID, code.Status); } } // If we didn't get anything, it isn't necessarily indicative of failure else { Assert.Inconclusive(); } }