Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Voiding an envelope using the new DocuSign C# Client

Tags:

c#

docusignapi

I am trying to void an existing envelope using the updated version of the DocuSign C# Client (DocuSign.eSign).

The envelope is in the Sent status and has not been completed or voided already.

Currently I have following code:

EnvelopesApi envelopesApi = new EnvelopesApi();

Envelope envelope = envelopesApi.GetEnvelope(accountId, envelopeId);           
envelope.Status = "voided";
envelope.VoidedReason = "This envelope was voided by " + currentUserName;

// create the recipient view (aka signing URL)
var updateSummary = envelopesApi.Update(accountId, envelopeId, envelope);

return updateSummary;

When this code is called, it fails with an ApiException and the following ErrorContent:

{
  "errorCode": "INVALID_REQUEST_PARAMETER",
  "message": "The request contained at least one invalid parameter. Value for 'purgeState' must be 'documents_queued' or 'documents_and_metadata_queued'."
}

The message is "The request contained at least one invalid parameter. Value for 'purgeState' must be 'documents_queued' or 'documents_and_metadata_queued'", but according to the docs, I shouldn't need to supply those parameter if the status is "voided" and I have a voided reason.

Is there a way to void an envelope using the DocuSign C# Client?

like image 603
Blair L. Avatar asked Jul 01 '16 16:07

Blair L.


People also ask

Can you void a completed DocuSign envelope?

You can only Correct or Void envelopes in an In-process state: Created, Sent and Delivered. Once an envelope is in a terminal state: Completed (signed), Declined and Voided it can no longer be Corrected or Voided. You will need to contact the sender to negotiate with the sender to delete the document.

How do you void an envelope?

To void an envelope is to "cancel" the email, any signing links sent out will be cancelled, and any signatories who have already signed the document will need to sign again. The document will then go back to its original state and will be able to be amended if required, and sent again.

Can you void a DocuSign without notification?

When you void an envelope, all recipients who have either finished signing or whose turn it is to sign receive an email telling them that the envelope was voided. If there are recipients further down the signing order, they do not receive any notification regarding the voided envelope.


1 Answers

The issue appears to be that the envelope.PurgeState was set to "unpurged" when the envelope was loaded and that was passed to the API call. So even though I didn't explicitly set a PurgeState, it thought I was trying to perform the purge action with invalid parameters.

I was able to solve this by explicitly unsetting the envelope.PurgeState:

envelope.Status = "voided";
envelope.VoidedReason = "This envelope was voided by " + currentUserName;
envelope.PurgeState = null;
like image 163
Blair L. Avatar answered Sep 28 '22 10:09

Blair L.