How can I setup a web hook to check on DocuSign En

2019-06-08 05:19发布

I have the code written which is using envelopes to request a signature from the client like in this tutorial:

https://www.docusign.com/developer-center/recipes/request-a-signature-via-email-using-a-template

My question is, how can I define a web hook URL which can be used to update the envelope's status? I would like to be notified and to be able to update the envelope status in my database once the client signs the documents. Is this possible?

Does EnvelopeDefinition class expose some property which allows me to define the web hook's url?

标签: docusignapi
3条回答
可以哭但决不认输i
2楼-- · 2019-06-08 05:28

There are two possible ways to do this.

One is to set up an account wide Connect Configuration within the DS WebApp, this will send the requested event notifications on every envelope sent/completed to the URL: https://www.docusign.com.au/sites/default/files/connect-guide_0.pdf#page=5

You can also define this per envelope with the eventNotification parameter. However, the parameter is not baked into the provided recipes. EDIT: I stand corrected, see Larry's response below https://www.docusign.com.au/p/RESTAPIGuide/Content/REST%20API%20References/Send%20an%20Envelope.htm

查看更多
你好瞎i
3楼-- · 2019-06-08 05:28

Another way to test your "Listener" is to get the DocuSign XML response using

https://webhook.site

From there you will see the POST request with the complete XML body for your envelope.

TEST THE CREATE ENVELOPE FIRST

Before I would test my Listener, I wanted to confirm that my C# code would trigger the WebHook (via EnvelopeDefinition.EventNotification) in the DocuSign Envelope.

EnvelopeDefinition.EventNotification sets 2 lists of objects for EnvelopeEvent & RecipientEvents. Properly configuring these will fire the trigger in DocuSign Connect (Webhook).

All that was needed was to set the EventNotification.Url = the custom URL created for me on https://webhook.site

I locally ran my C# API code to create a DocuSign Envelope that would trigger the Webhook. Then I used the the DocuSign email (received moments after creating the envelope) to sign the document - which again fired the Webhook to my test listener.

GET THE XML My properly configured code fired the DocuSign Connect (Webhook) POST event. I can see the POST request (and its XML body) on my custom URL at https://webhook.site

RESEND THE XML Finally, copy the POST request XML sent from DocuSign and paste that XML in PostMan. Then I can locally use PostMan to "resend" that POST request (and XML body) to test my local Listener API that I am developing.

查看更多
Emotional °昔
4楼-- · 2019-06-08 05:37

The webhook recipe shows how to include the eventNotification object within the envelope creation request.

Added

The format of the webhook XML messages is documented.

Note The Connect guide (March, 2016 date on page 2) is old, and is incorrect in many cases. A new guide is in production. This guide is useful for the XML format information.

WSDL file, including the notification messages format is available.

To see the XML messages that are returned, there are samples of notifications for sent and delivered statuses.

And, finally, the recipe can be run, for free, on Heroku.

(You will need a developer's account and integration key, all free, from DocuSign.)

When you run it on Heroku, you can see the incoming notification messages.

查看更多
登录 后发表回答