Getting started with the Docusign API - docusignapi

I want to make sure I am on the right track as I have been having some problems getting started with the API. I am looking to maintain a list of product application PDFs as templates on docusign. When a customer comes to our site and wants a particular product they need to fill out an application form. All the data would be collected on our site. I would then want to:
Create an envolope with the customer (and potentially other parties) that need to sign the document
Fill in the form fields from data collected on our site
Send the envelope out for signature and monitor the progress.
So in doing this I am trying to build this up a piece at a time and first task is to make sure that I can provide form data to docusign. I create a template with the docusign web user interface and all of the form fields seem to be preserved. However when I try and retrieve the template with API
https://demo.docusign.net/restapi/v2/accounts/xxxx/templates/yyyy
I see a very short response with an envelopeTemplateDefinition showing the correct name for the template but no documents object and no custom fields object. I have also tried this by creating an envelope with the document (in draft) but with similar results.
My apologies in advance for this newbie question.

I've repro'd the issue you describe -- i.e., the Response I get from a GET Template request contains only very limited information and is thereby not consistent with the expected Response as documented on pages 194-196 of the DocuSign REST API guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf). Not sure if this is a bug with the GET Template operation or with the Documentation -- someone at DocuSign will need to confirm (#Ergin).
In light of this limitation with the GET Template operation, you can alternatively retrieve the recipient information (including tabs) and document information about a Template by using the GET Envelope Recipients and GET Envelope Documents operations -- just specify the TEMPLATE Id in place of the Envelope Id, as shown here:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/documents
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/recipients?include_tabs=true

Related

get tabs from all documents in templates DocuSign

Docusign Provides a way to get tabs data for a single document in a template by specifying documentId. I could not find a way to get tabs data for all documents included in a template.
There's no data in templates, templates are not sent, or acted upon.
Only envelopes have data, and you mentioned you can get data from envelopes.
Now, maybe you meant how can I aggregate ALL the DATA from ALL envelopes created from a template.
If that's what you meant, then you may have to first find all these envelopes.
To do this, include some meta-data in your envelopes using custom fields. These will be used to later find them first, so that then you can get all the data from them using the search envelope endpoint (that can also return data).
If you're looking to see which tabs are placed on a template, you can do so by making a Templates::Get call with ?include=recipients,tabs.
As Inbar states, this won't get you any tab values (except one that are pre-populated by the template creator), as the template itself isn't what a signer interacts with - an envelope is sent that references the template. So if you're trying to collect data from your signers, you would need to be pulling tab data from an envelope instead.

What is the best way to get all the envelopes for a template?

I have the template id and I want to fetch all the envelopes for this template. What is the right and the best way to get this information?
So, if your integration/app sent these envelopes and you put some code that will allow you to do in the future - you can do that.
However, if you have envelopes sent from a template without anything in there to indicate where they came from - there's no way to do that.
The system considers the envelope and template independent objects and there's no correlation (no FKs in the database). When you ask for an envelope to be created from a template, the template is simply copied into a fresh new envelope with everything in it. That's it.
So, for example, if you have unique documents, recipients, fields, etc. etc. you can use them to ascertain the template, but there's nothing directly tying the templateId.
Blog post that covers this topic -
https://www.docusign.com/blog/developers/the-trenches-track-your-templates-envelope-custom-fields

Handling a Docusign Rest api exception?

I want to know if this is possible: I would like to have a custom text field on an envelope that I set and if the envelope fails for some reason, like there are missing tabs or email address is bad, I want to be able to look at the exception and see the custom field that I set. Would this info be in the raw data? It is as important to us to know which envelopes failed as to know why they failed. I saved the custom field in a database before sending out the envelope. When it fails, I can look up that custom field and discover which envelope didn't make it and to take some action, like correcting and resending.
If the envelope is created incorrectly (i.e: specifying a conditional parent tab which does not exist, syntax error, etc), then you will know at the time you attempt to create the envelope w/the API. The reason will be included in an error code the API returns
If an envelope was sent to an email address which does not exist/bounces, that information can be discovered using the DS API to see a recipient/envelope status of 'autoresponded', or if you are using DS Connect you can receive a push notification.
Is there additional rationale why you want to use a custom field? Per the above, I do not believe it is necessary or applicable.
With the RestSharp api, I was able to get the Request body. The Request body has a collection of Parameters, and one of those items is the RequestBody.

Docusign document retrieve using Docusign-connect

I am using the Docusign-Connet to get the notifications form docusign. In docusign api there is a line
"It can also be used to transport the completed documents back to your app or website and to retrieve any form field data entered by your recipients"
but in payload I am getting only document names?.
If you want the connect messages to include the envelopes' documents or fields, check the boxes in the Connection Subscription screen (shown below from the New DocuSign Experience Admin tool).
Or set the fields includeDocumentFields and/or includeDocuments to true in your call to ConnectConfigurations: create
What i've done in the past is, get the document statuses from DocuSignConnect when things change. Then call EnvelopesApi.GetDocument endpoint with DocumentStatuses.DocumentStatus.ID and the envelope ID to retrieve the document.
In my implementation, we only download the document if the entire envelope is complete. This way, the DocuSignConnect payload is not big as well.
Btw, my implementation is in .net using their 2.1.9.0 library.
Good luck!

scoping out docusign for a client

I just wanted to understand certain terms such as
1) what is a template in context of docusign
2) What is an envelope an when do we use it ?
3) What is embedding signature ?
Basically my client wants to populate a pdf contract form with certain data got from a form. Would liek to send the pdf form to get it signed by the client...
Although the form maybe same the data fields in it may change ..
so what approach should be taken
a) template or b) embedded ?
assuming a blank form needs ot be sent for signing how does that work ? does the form goto the client phsycially ? or do they come on your site to sign it ...
i am sorry if i am all over i just wanted to understand the process frolm a developers stand point.
I suggest you read up on the DocuSign Developer Center. In particular the Explore -> Features section has pages dedicated to Templates and Embedding (among other topics) that have much of this info.
what is a template in context of docusign
Templates help streamline the sending process by allowing you to - at design-time - save document(s), recipients (or placeholder roles for recipients), tab locations and types for those recipients, routing and workflow, and more. Then at real-time when you want to request a signature you simply match a recipient to a role on your template and they automatically inherit all that previously configured workflow. The data they enter into their fields will still be specific to them, but things like the location of the signature tabs you've placed for them will always be the same, any conditional or dynamic workflows will be the same, etc. Templates are very flexible and have many features and options so I suggest you read up on them both through the Features -> Templates page but also through the API docs.
An alternative to requesting a signature from a Template is to request a signature on a Document. This is a similar call except that you need to define the tab locations, recipients, routing, etc every time before sending. With a template you just define all of that stuff once, at design time.
What is an envelope an when do we use it?
Definition from Explore page overview: "An envelope is basically a "container" used to send documents to recipients. The envelope carries information about the sender and timestamps to indicate the progress of the delivery procedure. It can contain collections of Documents, Tabs and Recipients and is analogous to a physical envelope you would send through the mail".
An envelope can have as many documents as you want in it (I think there's a total size limitation but that it's set high) and can be addressed to 1 or more recipients (actually up to 1,000 if using Bulk Send feature). And once the last person is done signing the docs in the envelope a Certificate of Completion (CoC) PDF doc is automatically generated and placed inside the envelope as part of an audit trail for your review.
What is embedding signature ?
Embedding allows you Embed the signing workflow directly into your website or app or whatever you are building. The signing still takes place through a DocuSign endpoint but you can generate the unique signing URLs yourself and open in an iFrame or Webview. You can control the branding around the signing experience and you also have control over where the user is re-directed to after they sign. See the Features -> Embedding page.
Regarding your questions about form fields, yes DocuSign also supports that- you want to use Data Fields (called textFields in the API), see the Features -> Stick-eTabs page.
Lastly, in terms of what approach should be taken (Template or Embedded) - hopefully my first answer cleared this up but those are not mutually exclusive. You can create an envelope from a Template or from a Local Document(s), and you can either Embed the signing experience or have it remote (i.e. recipient receives an email to start signing). To make a recipient an Embedded one, you have to set their clientUserId property. See the links I've referenced.
DocuSign also has sample code in 6 different languages for 9 common API scenarios, including Embedding, Requesting a signature from a Template, on a Document, and more. See the API Walkthroughs:
http://iodocs.docusign.com/apiwalkthroughs
DocuSign has free code samples in 6 different languages

Resources