Is it possible to delete a completed envelope via c# sdk? My business logic need something like this.
I've tried to void it, but unsuccessfully, It appears that only in-progress envelopes can be voided.
CodePudding user response:
// Delete an envelope
ApiClient apiClient = new ApiClient(basePath);
// You will need to obtain an access token using your chosen authentication method
apiClient.Configuration.DefaultHeader.Add("Authorization", "Bearer " accessToken);
FoldersApi foldersApi = new FoldersApi(apiClient);
string envelopeId = "9e2b1deb-xxxx-xxxx-xxxx-2540322a31c4";
FoldersRequest folderRequest = new FoldersRequest();
folderRequest.EnvelopeIds = new List<string>();
folderRequest.EnvelopeIds.Add(envelopeId);
foldersApi.MoveEnvelopes(accountId, "recyclebin", folderRequest);
More information https://www.docusign.com/blog/developers/common-api-tasks-delete-and-undelete-envelope