REST API Recipe: Signing from Your App


This recipe enables your app’s user to sign a specific envelope’s document(s) from within your app.

Use this technique when your app has authenticated the user and wants him or her to sign immediately from within your app.

Getting ready

You’ll need a DocuSign account email and password. You’ll also need an integration key. See Generate Your Integrator Key.

How to do it

Step 1: use the login_information API end point to obtain the base URL for use in subsequent API calls, and the user’s account ID. See the recipe Request a Signature via Email for an example of this step.

Step 2: We need an envelope to be signed, and its ID. In this recipe, we’ll create the envelope from scratch. We’ll set the signer to be the first person to sign. To enable embedded signing from your app, the signer’s recipient object must have the clientUserId set. The same clientUserId is used again in step 3.



Step 3: We use the EnvelopeViews::createRecipient method to retrieve the “signing ceremony” UX URL. Then we re-direct the user’s browser to the URL. After the user is done signing, their browser will be re-directed back to our app.


Source files

The recipe source files are available on Github: Java, C#, Objective-C, Python, PHP, and Node-JS

How it works

This recipe enables your app to authenticate the signer and then present the signing ceremony.

When you re-direct the user’s browser to DocuSign to sign the envelope’s documents, do not use an iFrame if any of your signers may be using a mobile device. The extra “chrome” of your app will materially degrade the user experience. Instead of an iFrame, use a regular re-direct. Remember that you can brand the DocuSign signing experience to use your organization’s logo, color palette, etc.

For mobile native applications, please do not frame or embed the DocuSign UX within your app’s chrome. Instead, provide the entire screen to the DocuSign UX to prevent a degradation of the sender’s user experience.

There’s more

Since your app is assuming responsibility for authenticating the signer, you should create a specific audit chain to enable your authentication process to be audited and to withstand potential challenges. Use the clientUserId and additional fields in the EnvelopeViews::createRecipient method to record how you authenticated the signer and any locator or record numbers that may be needed later to respond to an audit request. For example, you can record the signer’s username within your app as the clientUserId. Some of the fields that you provide will be included in the signed document’s certificate of completion.