1

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:

  1. Create an envolope with the customer (and potentially other parties) that need to sign the document
  2. Fill in the form fields from data collected on our site
  3. 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.

Sam
  • 134
  • 1
  • 5

1 Answers1

1

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
Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • Thanks that is helpful and got me to where I was when I tried this exercise adding a document to an envelope. I still can't retrieve the fields, however using GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/documents/1/fields. I get documentFields: Array[0]. Should I not be retrieving all of the form fields that the user could potentially fill in? – Sam Oct 21 '13 at 18:01
  • In the REST API, the fields (aka "tabs") that belong to each recipient are returned via a "GET Recipients" call: GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{templateId}/recipients?include_tabs=true. Each recipient object in the Response will contain a "tabs" object that, in turn, contains information about the various fields/tabs that belong to the recipient. – Kim Brandl Oct 21 '13 at 18:14
  • I don't really understand your need to programmatically determine the field names within a Template. If you're creating DocuSign templates (via the web UI), then presumably the fields on those templates will be fairly static, so I'd expect that you wouldn't need to programmatically retrieve the field names each time you want to create an envelope (via API) using a Template. Instead, I'd expect that you should be able to hardcode (or if you want to make it more easily updatable, store in a database or config file) the field names to use for the Create Envelope API call. – Kim Brandl Oct 21 '13 at 18:18
  • Thanks so much. I am starting to make sense of this and now I see all the form fields via the tabs for the recipient. @Kim - you are right I would only need to retrieve the field names when a new document was added to the "library" and then treat them as meta-data for use in the tabs parameter when creating the envelope. – Sam Oct 21 '13 at 18:45