Envelope Signed Notification - docusignapi

I create a pdf on our system and then pass that to docusign for the user to sign. I want to automatically download and save the signed envelopes in our system. Is there a way for docusign to send a post request after the document is signed?
Right now, I randomly (every other hour) connect to docusign and check if the envelope is signed using the docusign api, but this is really not optimal. There are a lot of users who view the pdf in docusign and decide they don't want to sign the document.

The "DocuSign Connect" feature is designed to do exactly that -- send a POST to an endpoint you specify, in real-time, as specified Envelope events occur. Basically it works like this: you build a "listener" app (i.e., a web page that will receive POSTs from Connect), you configure Connect (within your DocuSign account (Preferences >> Connect) to specify the endpoint of your "listener" and select which Envelope events you want your listener to receive notifications for, etc., and once that Connect configuration is enabled, DocuSign will send a POST to your listener endpoint whenever the specified Envelope event(s) occur.
The DocuSign Connect Service Guide (https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/connect-guide.pdf) describes Connect and how to configure/use it -- I'd suggest that you start by reviewing the guide, and post any additional questions here on SO if you run into any issues implementing Connect.

Related

What is the situation we have to use docusing brand destination url and docusing webhook?

My application wants to send an email to signer for signing DocuSign (remote signing using DocuSign rest api) and after completing signing, the website should get the update that the envelope is signed and update the database.
So can I set the brand destination URL, so that the website will get the envelope Id in the merge field and we can update the database?
In this scenario do we need to use a webbook or set a brand destination URL as I said earlier?
after completing signing, the website should get the update that the envelope is signed and update the database.
Best way to handle this is to use a DocuSign webhook. You have two options:
Use the Connect Webhook feature for an account-level webhook. This will send a notification to your server (your "listener") anytime any application in the account, for any user, sends an envelope. You can set which users will trigger a notification and which events (eg envelope_sent, envelope_completed) etc.
The webhook configuration is defined for the account using the eSign settings application or via the API.
Use the eventNotification attribute of the Envelopes:create API call. You get basically the same options as the account-level webhook, but for just one envelope. You define the webhook's settings when you make the API call to send the envelope.
Here's a live example via the API Request Builder. You can configure the example with a webhook listener URL from webhook.site or from similar services.

Triggers available in Docusign on document completion

I have a web application integrated with DocuSign API, to pass in recipient details to a DocuSign template and initiate signing process. The template has tags for each recipient to enter relevant information and sign.
Once the document is completed/signed by all recipients, the information available in the document needs to be passed on to another web application bound to a DB. What are the options available in DocuSign to trigger document data(e.g. recipient1 signed date) transferred to a DB/other systems on document completion? Any advice on this is appreciated.
You probably need to provide more specific information but generally, you can use DocuSign Connect and configure your API source to integrate the data. After that, you will be able to use webhooks (or Connect) to send tabs data and signing statuses to your 'other systems'.
Once you get your Connect figured out, you can then have GET request using this
{{baseUrl}}/envelopes/{{envelopeId}}/recipients?include_tabs=true
and then have a wrapper class to export desired tabs (ex. Date Signed or other Text Tabs)
OR you can configure a webhook to sync your data between DocuSign and other systems:
Code Example: Using a Webhook to Track Envelope Status

How to get auto response for any envelop completed document sign?

I am using DocuSign api for my client website portal as customer documents digital process. Everything works great except one feature needed.
I am creating dynamic document (with php) and sending to customer via DocuSign api to sign (using DocuSign digital signature setup).
And i have added 'check status' button in my website to check that specific document/envelope (by forwarding envelope unique id to DocuSign api get envelope status) and updating in my database and also downloading that signed document from docUsign.
Now i need the above process to be done automatically which means when the customer signs, a callback should trigger to my website url (like some webhook i need setup) and then i will check that envelop status and update my database.
Can any one give some suggestions or code snippet where i can keep that webhook url option to get auto response from DocuSign (just like paypal IPN)
Thanks in Advance
You can use DocuSign Connect to do exactly what you've described. Using DocuSign Connect, you can configure DocuSign to automatically push Envelope status and documents to an endpoint you specify when the Envelope event(s) you specify occur (for example, Recipient completes/submits an Envelope, or Envelope reaches status = completed, etc.).
DocuSign has published several code samples that show how to use DocuSign Connect. For example:
PHP and Python webhook sample
C# webhook sample
Node webhook sample
Java webhook sample
These samples (and others) can be found in the DocuSign GitHub org.

Resend Webhook Notification on Docusign

Is it possible to request from the API to resend a webhook?
From here i can see this is possible from the Admin Panel
https://www.docusign.com/blog/dsdev-adding-webhooks-application/
When a webhook request fails, the Failures screen also enables you to
resend the notification. This can be very helpful when debugging your
listener software.
I want to do the same but from the API.
Thanks!
You can use the ConnectEvents Api's.
Specifically the following api's
retryForEnvelope
Republishes Connect information for the specified envelope.
retryForEnvelopes
Republishes Connect information for the specified set of envelopes. The primary use is to republish Connect post failures by including envelope IDs for the envelopes that failed to post in the request. The list of envelope IDs that failed to post correctly can be retrieved by calling to [ML:GetConnectLog] retrieve the failure log.

DocumentPDFs elements not consistently returned from DocuSign Connect

I have successfully implemented a system that creates documents to be signed via a template using the .NET API, and then has a DocuSign Connect listener that gets called upon the envelope being signed (right now only have Connect reporting on envelope signatures and declines). I have the option set to "Include Documents" on my DocuSign Connect settings. When I create the envelope for signature programmatically with one signer it all works - my Connect listener gets called, the /DocuSignEnvelopeInformation/DocumentPDF/PDFBytes element has Base64 data in it, and I have successfully decoded that and stored it in our doc management system. Cool. Demos well, management loves it.
However, I have noticed at least two scenarios where the /DocuSignEnvelopeInformation/DocumentPDF section isn't being returned at all:
When there are multiple signers.
When the envelope is created manually, even if it uses the same template.
I can still use the Connect response to get the /DocuSignEnvelopeInformation/EnvelopeStatus/DocumentStatuses and extract the document IDs from the DocumentStatus child elements, and then go retrieve those programmatically using the .NET API. But I am wondering why the PDF bytes aren't being consistently returned all the time? Is the above expected behavior? Am I missing something?
I would prefer to save "round trips" and just have Connect deliver all the signed PDFs to me when it calls (and yes, I have read the Recommendations for Receiving Documents section of the DocuSign Connect Guide and understand the trade-offs. Just wondering if I need to code around this issue, or what I am missing?
Hmmm. Envelopes don't get "signed," they get "sent" and "completed." See the envelopeEvents vs the recipientEvents lists in the Connect::Create call.
Currently, there is an existing issue which is that the connect daemon can miss an event if it is quickly superseded by another event. This might be what is happening when you have multiple signers for an envelope. The safest thing to do is to subscribe to all events and then ignore the notifications that are not of interest to you.
The terminal event of an envelope being "completed" will always be sent if you've subscribed to it.
Also, to make your app more bulletproof, I suggest subscribing to the Connect events via the API call (link is above) rather than depending on the human to setup up the subscription correctly. Since an account can easily have more than one connect subscription, you can track which one is your app's by using a specific name for the subscription.
Added
Just now, I created a Connect subscription for just the Envelope Completed event, for all users in my account on demo.docusign.net. As the subscription (listener) url, I used a free account from requestb.in
Using the web user interface (not the API), I created an envelope with two signers. After I completed the envelope, the requestb.in received the notification, it included:
<DocumentPDFs>
<DocumentPDF>
<Name>House architectural overview.pdf</Name>
<PDFBytes>....
as expected. So I'm unable to reproduce your problem. I suggest that you use requestb.in to double-check exactly what is being sent in the notification messages.

Resources