Getting Merged documents using CONNECT API - docusignapi

Currently I am using CONNECT API configured with my system.
Whenever DocuSign Envelope moves to Completed status, a POST request is generated to my system which contains:
DocuSign Envelope information
DocuSign PDF bytes ( Seperate PDF documents )
DocuSign certificate
I selected the option [X] Include Documents in Connect API and I am able to receive the PDF bytes.
Currently I am using PDFTK to merge all the documents into one.
But is there a way using Connect API to get all the Documents merged together as a one Single PDF document ?
Parallely while reading through the DocuSign REST API guide I came across /envelope/id?merge=true which would give me the required single PDF. But while digging deeper I came to know there is a concept called Integrator Key for each implementation, which would require a DocuSign Certification.
Inorder to just get a merged document instead of seperate PDF documents should I go through this certification process or is there a simple way to do the same ?
If Certification is Mandatory then what kind of certification would this fall in, because I have no front end application for signing process and I am just consuming the customer generated documents.

Using DocuSign Connect does not require an IntegratorKey or that you go through the DocuSign API Certification process. The Certification Process (https://www.docusign.com/developer-center/go-live/certification) and Integrator Key exist to ensure that DocuSign customers who utilize either the REST API or the SOAP API are not doing anything that could be harmful to the overall DocuSign service -- this is not relevant to DocuSign Connect, since Connect is merely pushing data to your listener when Envelope events occur (i.e., you're not explicitly polling DocuSign for changes, as you might with either the REST API or SOAP API).
I don't believe it's possible to configure Connect such that documents are sent merged together as one file; they're always going to be sent as separate files in the Connect message. It would be feasible to, during your processing of the Connect XML message, make a REST API call to DocuSign to request the Envelope's documents in a single file -- however, doing so would require that you use an Integrator Key, and that you go through the DocuSign API Certification process -- probably not worth the time, expense, and trouble, if there's another way for you to merge the files yourself.

Related

How to find out if a document has been signed

In my returnUrl handler, I am using list documents.
In the returned array, how can I figure out if the document has been signed or not?
Thanks!
Your return url handler will be called with a query parameter event as discussed in Inbar's answer.
But you should not use the query parameter for making business decisions since a bad guy could easily call your return url and simply tack on an event=signing_complete query parameter--spoofing your application.
Instead, when your application needs to know if the envelope has been signed or not, it has two categories of options:
Ask DocuSign
Your app can call the Envelopes::get method to determine the current status of the envelope. Other API methods can also be used for this functionality.
Design your app such that you do not call DocuSign about a particular envelope more often than once every 15 minutes since such behavior is considered polling and is not allowed.
Webhook: DocuSign will call your app
You can set up a webhook with DocuSign so that the eSignature platform will call your application when the envelope is complete (signed by all the signers, etc).
Use the DocuSign webhook HMAC feature to guarantee that the notification message came from DocuSign (was not spoofed) and that it was not altered in transmission.
By using AWS or equivalent, you can easily receive the notification messages behind the firewall, with no firewall changes. And AWS will not charge you for the first million notification messages per month. See the connect-* repos on github.com/docusign
Dashboards
If your app wants to present a dashboard to a business decision maker about the status of your envelopes, then relying on the event query parameter is fine. But before your app does anything that costs real money, eg initiate goods or services to be provided to a customer, make sure that the envelope has been signed by using one of the two techniques above.
The URL you get back from DocuSign has an event parameter and looks like this:
http://www.acme.com?event=signing_complete
signing_complete means it was signed.
https://developers.docusign.com/esign-rest-api/guides/features/embedding has the full list of other events in the "Determining Recipient Action" section of the article.

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

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.

Can we import many documents from DocuSign through the API?

A customer of ours likes using DocuSign's bulk send feature to get a lot of employees to sign documents.
They want the ability to then import these signed documents into our software. We're thinking of creating a GUI in our software that lets them browse the folders in DocuSign, select which envelopes to import and then import them.
A user may want to import 50 envelopes at a time. In this case it would make a few API calls when the user is browsing through their folder, then it will make 50 calls to RequestDocumentPDFsEx to download the documents associated with each envelope. The API calls would probably be done serially unless they're really slow. In that case we may have to use 2 threads or more so that it completes in a decent amount of time.
We only have one customer at this time that is looking at using this feature and it would not be used very often, maybe once a month.
Will we run into a problem with rate limiting or breach any terms if we implement the above described solution?
We already have a certified integrator key for our integration that allows users to upload a handful documents at a time to be signed.
I think you're only options here are:
DocuSign Retrieve - a separate, paid module that DocuSign offers used for bulk downloading
One API call per envelope download
DocuSign Retrieve - "Download envelopes, documents and data from DocuSign for use with external systems. DocuSign Retrieve runs on your system as a one-time request or on a recurring basis. Configure DocuSign Retrieve to specify file type and storage location."
Otherwise as you have suggested you'll need to make one API call per envelope download, either through the SOAP API or through the REST API.

Envelope Signed Notification

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.

Resources