Emil Sedgh
Emil Sedgh

Reputation: 33

Webhook not called on a voided/discarded draft envelope

If I create an envelope the status will be "created" aka draft.

I find 2 holes right now:

  1. If I "void" the envelope (through the API), the webhook is never called.

It seems that webhook gets called only if the voided envelope is "Sent".

  1. If the user's "discards" the draft envelope, there's no webhook called, as the status has not changed and "discarding" is not within any of the envelope events or envelope recipient events.

Is there any way to circumvent these issues?

Upvotes: 0

Views: 128

Answers (1)

Larry K
Larry K

Reputation: 49114

You're correct, envelopes in Draft state don't trigger Connect events if they're discarded or voided. There is a feature enhancement request to add the capability. You can ask your DocuSign contacts to add your information to the internal CONNECT-811 issue.

In the meantime, two ways to manage the issue:

Track unsent envelopes

After your app creates the envelope in draft status, save the envelopeId in your database along with the create time. Also create a Connect event for Recipient Create. That way you'll be notified as soon as the envelope is sent.

When you receive a connect notification about any envelope, first delete the envelopeId from your database (if it is still there).

Then have a batch job that periodically checks the database and the envelopes' create time vs the current time. If there's enough of a time difference then you know that the envelope send process was abandoned or the envelope was specifically abandoned. (You could also check the envelope's status at this point.)

Avoid using sender view: instead, enhance your application

Some apps create the envelope in draft state and then ask the sender to complete the sending process via the sender's view.

But this is not the best experience for the sender and also has the notification issues that you've experienced.

A better UX for the sender is for your application to complete/send the envelope.

If your senders are using the Sender View to add recipients, enable them to add the recipients via your app instead. If the senders are using the Sender View to tag the documents, then a better UX is for your application to tag the documents for them. Etc.

Upvotes: 1

Related Questions