Creating an Docusign envelope from an external file with Rest API - docusignapi

I want to create a envelope in Docusign from an external source. I am having the external file URL (a PDF or DOC). So does the API support like I will give an external URL and it will upload it to docusign by creating a new envelope.

In order to add a file to a DocuSign Envelope, you need to specify the document bytes in the API request. It's not possible to simply specify the URL in the request and have DocuSign read the file automatically using the URL.
Using the REST API, there are a couple of ways to supply the document bytes in the Create Envelope API request -- the simpliest way is to include the base64-encoded byte stream in the documentBase64 property under the document object. See the REST API Guide for further details (https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/rest-api-guide-v2.pdf).

Related

Is there an API that can directly handle the files I need to sign

Is there an API that can directly handle the files I need to sign.
For example, I set the location and name I need to sign on a document, and then call an API to return to the document that I have signed.
The DocuSign eSignature API doesn't support robo-signing.
If you need to automatically apply signatures to files automatically, you'll want to look in to the DocuSign Signature Appliance: https://www.docusign.com/products/hybrid-cloud-appliances

How to get a document's custom fields through DocuSign API?

I am trying to access the custom field values for documents that I download. I am able to list the completed envelopes and download the documents, but the custom fields are showing up as empty?
var docFields = envelopeApi.ListDocumentFields(AccountID, envelopeId, docId);
Console.WriteLine(docFields.DocumentFields.Count);
Count is always zero even though the custom fields have been filled in by the user?
The endpoint which you calling is to download the document custom fields which is added by the sender as the metadata of the document. It will not help you in downloading the form data entered by the signer on the document. To download form data via API, you can use GET /v2/accounts/{accountId}/envelopes/{envelopeId}/form_data, more details available at getFormData DS Docs. You can also use to download tab details for the recipients using GET /v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/tabs, more details available at Download Recipient tab data
Most recommended way is to setup DS Connect so that you do not have to poll DS API to get envelope status or form data etc, instead host a webservice on your side and configure the same in DocuSign so that DocuSign can push the required data to your webservice in an XML format.

Pre-signed url to upload file on DocuSign

I'm trying to integrate #docusignapi into my website and was looking for a pre-signed upload mechanism. But their API don't talk about that (at least I haven't seen it anywhere).
Did anyone successfully managed to do that?
If you are not familiar with pre-signed upload, here's a blogpost from Dropbox about how they propose that.
DocuSign does not offer a pre-signed upload feature at this time.
You can upload documents via the Envelope::create API call in the body of the JSON object after being Base64 encoded.
You can see this via scenario 2 in the example launchers (see below).
You can also upload document(s) in binary mode via a multi-part mime transaction. See scenario 10 in the example launchers.
Documents can also be uploaded in separate transactions if the envelope is first created in draft mode.
The example launchers are listed below. Each includes 14 or more scenarios.
C# -- https://github.com/docusign/eg-03-csharp-auth-code-grant-core
PHP – https://github.com/docusign/eg-03-php-auth-code-grant
Java – https://github.com/docusign/eg-03-java-auth-code-grant
Node.js – https://github.com/docusign/eg-03-node-auth-code-grant
Python – https://github.com/docusign/eg-03-python-auth-code-grant
Ruby – https://github.com/docusign/eg-03-ruby-auth-code-grant
Curl (direct API) – https://github.com/docusign/eg-03-curl
If you want UI to upload documents to the envelope before Sending the envelope for ESigning, the you can use Sender View for Draft envelope, with this soln. your customers need to come to your App, and then App can call this ESign APIs to generate one time URL, and load that URL in the browser to ask your users to upload the document on the Envelope.
Update:
There is one more option which can be used, but this will be only used if the recipient of the envelope has a DS Account, then you can add them as an Editor (Allow to Edit) recipient type in the workflow. When they will get email from DocuSign then they will login with their DS Credentials and can modify the envelope in same way as Sender of the envelope, with Editor Recipient Type, they can add/update Documents, add/update Recipients and their Tabs.

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.

Upload and save pdf as template using docusign API

Is it possible to upload and create a Template using Docusign api. I tried sending post request in {vx}/accounts/{accountid}/templates.
Yes, it's possible to create a Template by using the DocuSign API. For details, see this DocuSign API documentation.

Resources