Embedded Signing UI - docusignapi

I am using the embedded UI for template and document creation. I want to know the data which are being filled in the UI and also have to store them in my DB and then hit to 3rd party tools for signing. Is this flow possible to store the data in my DB?

With the HelloSign API, you have a few options to get information on the template:
The Get Template Endpoint
GET /template/[:template_id]
Gets general template details and includes a list of Accounts that can access it
https://app.hellosign.com/api/reference#get_template
The Get Template Files Endpoint
GET /template/files/[:template_id]
Obtains a copy of a template's original files.
https://app.hellosign.com/api/reference#get_template_files
And lastly, if you want the info that is being entered by the signer, you can poll the API or listen for callbacks that will supply you with said data to store in your DB.
https://app.hellosign.com/api/eventsAndCallbacksWalkthrough (best practice)
The Get Signature Request Endpoint can be used to poll this information
GET /signature_request/[:signature_request_id]
Gets a SignatureRequest that includes the current status for each signer.
https://app.hellosign.com/api/reference#get_signature_request

Related

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

Save Docusign Document as Template through API

The docusign website allows for me to save a document as a template, but I have not been able to find a way to do this programmatically through the API. Is there a simple way to save a document as a template?
Yes, you can create a Template via the API by issuing this request:
POST /v2/accounts/{accountId}/templates
The API documentation contains details about this operation.
UPDATE
Do I understand correctly that your goal is to create a Template that's based upon an existing DocuSign Document, i.e., to mimic the following functionality in the DocuSign web UI?
If that's the case, then I'm not aware of any single API call that can do this. Instead, I believe you'll need to issue a series of API calls, to retrieve info about the existing Document(s) and then create the new Template using that info:
1) Get information about the existing DocuSign Document (envelope): GET /v2/accounts/{accountId}/envelopes/{envelopeId} (docs)
This operation returns recipient info (including tabs for each recipient) as well as envelope data like email subject, email body, reminders, etc. It also returns a documentsUri property that you can use to get the document(s) that belong to the envelope.
2) Get the list of document(s) that the envelope contains by issuing a GET request to the URI specified by the documentsUri from the prior response. (docs)
This operation returns information about each document in the specified envelope, but does not return document contents.
3) For each document listed in the prior API response, issue a GET request to the URI specified by the uri property for the document. (docs)
4) Finally, create a new Template using the data that you received in response to the previous API requests: POST /v2/accounts/{accountId}/templates (docs)
Note: As a final note -- if you're using one of the DocuSign SDKs, it's possible that there might be a function that you can call to implement this scenario, without having to piece together all of these API calls yourself. I'm not familiar enough with the SDKs to say whether or not they provide this type of functionality, but it'd be worth checking for, if you're using an SDK.

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.

Retrieving Power Form URL with API

Currently I'm using a template, creating an Envelope from that template and uploading documents and sending with the Sender View all through the API. What I would like to do is use a power form that when I hit send I can somehow retrieve that url with the API and save it to my DB. How can I get that signing URL with the API ?
That is currently not available through the API, you must use the web UI to perform this action at this time.
This may change at a later date, however I do not have any information on when that may be.
Your best option on getting it in the API is contacting your DocuSign Account Manager to submit an Enhancement Request (DocuSign Customer Support can also help you submit that as well).

Getting Merged documents using CONNECT API

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.

Resources