1

Is there a way to upload documents to docusign using the API?

I have a web form with over 150 fields, and users fill everything out on my website. I'd like to avoid creating data fields in a template and passing all the values. I can have the fields recognized in docusign, but the labels for the fields are assigned randomly, and if I were to add or remove a field in the future, I will have to go through every field to make sure the labels didn't get renamed.

I can convert this form into a pdf. So I am wondering if it's possible to upload this pdf as a template using the API.

Thanks.

Trying...
  • 127
  • 9

2 Answers2

1

Yes you can create templates and upload documents into them through the DocuSign REST API. This is detailed in the REST API Guide, see page 187 for details of the POST Template call.

You'll need to make a multipart/form-data request with the document bytes appended to the request body.

Post Template

Saves a template definition using a multipart request.

URL:

/accounts/{accountId}/templates

Formats:

XML, JSON

HTTP Method:

POST


This is actually very similar to the multipart/form-data call for requesting a signature on a document. Check out this DocuSign API Walkthrough for an example of that in 6 different languages. You can probably copy your language of choice and slightly modify the call for your add templates call.

Ergin
  • 9,254
  • 1
  • 19
  • 28
  • Thank you for your answer. I was able to create a template and upload a document. I have one problem, though. How do I set a return url? I used the api walkthrough example. I guess to have a return url, I actually need to post a template? – Trying... Oct 24 '13 at 13:47
  • I needed a return url to check if the user has signed it. I just discovered "eventNotification" attribute. This will take care of my problem, I think – Trying... Oct 24 '13 at 14:13
  • If you want you can embed the signing (or sending) experience in an iFrame on your website where you can easily set the return urls for signing complete, signing declined, window closed, etc. Have a look at the last 3 [Walkthroughs](http://iodocs.docusign.com/APIWalkthroughs). You can see how two of the Embedding walkthroughs set the returnURL, and the last shows you how to open the DocuSign Console. As an FYI you can control the branding around these iFrames as well. Also see [this page](http://www.docusign.com/developer-center/explore/features/embedding-docusign) for Embedding info. – Ergin Oct 25 '13 at 05:50
  • Although as you mention the eventNotification is another way of setting returnUrls. You can read more about them in the [documentation](http://www.docusign.com/developer-center/documentation), just search for eventNotification in the REST or SOAP guide. – Ergin Oct 25 '13 at 05:55
0

What will happen if I have the Form Fields in the pdf and upload it directly on docusign from the API ? I have mentioned all the positions of the form fields in pdf how I can detect the form fields in the pdf from the api and will update the values of the form fields without mentioning the position of the form fields because I have seen all the apis and all are mentioning the position of all the texttabs

Raman verma
  • 73
  • 1
  • 11