How to request a signature by SMS or WhatsApp delivery
This topic demonstrates how to send a signature request via an SMS or WhatsApp message. Recipients receive a notification from SMS or WhatsApp with a signing link that they can use to open and electronically sign a document using the Docusign mobile app or the Docusign website.
Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.
Required data
Running the code in this how-to requires this data:
Step 1. Obtain your OAuth token
To make the API call shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different recommended OAuth grant types: Public Authorization Code Grant, Confidential Authorization Code Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.
See Confidential Authorization Code Grant for guidance on your options to get an Confidential Authorization Code Grant OAuth token.
Step 2. Create the envelope definition
To request a signature, you need to create a new envelope definition. The accompanying code shows how to create an individual envelope by defining a method named makeEnvelope that creates the envelope definition. The makeEnvelope method:
- Creates and attaches multiple documents to the envelope.
- Sets signer and CC recipient data.
- Creates a routing order for the documents.
- Creates and assigns signable fields to specific signers within the documents.To send an SMS or WhatsApp notification, you need to edit the signer’s
phnoneNumberfield to include values fornumberandcountryCode. You also have to set thedeliveryMethodfield to either “SMS"or"WhatsApp". You should make these changes for each recipient you want to notify via SMS or WhatsApp. The accompanying code also demonstrates how to notify a carbon copy recipient via SMS or WhatsApp by editing the same fields in thecarbonCopyobject.
Step 3. Create and send the envelope
With the envelope definition and the attributes defined for the signer, document, and custom fields, you can now use the Envelopes:create API method to create an envelope and send it, adding your access token and base path to the request header.
Expected response
If you run this code example from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.
In addition, the signer receives an SMS or WhatsApp message containing a signing link that they can use to open and electronically sign a document using the Docusign mobile app or the Docusign website. After signing is complete, the recipient receives a carbon copy (CC) of the email that includes all of the completed and signed documents.
Next steps
- Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.
- Learn more about SMS delivery or WhatsApp.
- Find out How to request a signature by email.
- Learn How to request a signature through your app.
- See how to Go-Live with a completed app and find the base path for API calls in the production environment.