This repo includes bash scripts that use curl to demonstrate:
- Embedded Signing Ceremony. Source. This example sends an envelope, and then uses an embedded signing ceremony for the first signer. With embedded signing, the DocuSign signing ceremony is initiated from your website.
- Send an envelope with a remote (email) signer and cc recipient. Source. The envelope includes a pdf, Word, and HTML document. Anchor text (AutoPlace) is used to position the signing fields in the documents.
- List envelopes in the user's account. Source.
- Get an envelope's basic information. Source. The example lists the basic information about an envelope, including its overall status.
- List an envelope's recipients Source. Includes current recipient status.
- List an envelope's documents. Source.
- Download an envelope's documents. Source. The example can download individual documents, the documents concatenated together, or a zip file of the documents.
- Programmatically create a template. Source.
- Send an envelope using a template. Source.
- Send an envelope and upload its documents with multipart binary transfer. Source. Binary transfer is 33% more efficient than using Base64 encoding.
- Embedded sending. Source. Embeds the DocuSign web tool (NDSE) in your web app to finalize or update the envelope and documents before they are sent.
- Embedded DocuSign web tool (NDSE). Source.
- Embedded Signing Ceremony from a template with an added document. Source. This example sends an envelope based on a template. In addition to the template's document(s), the example adds an additional document to the envelope by using the Composite Templates feature.
- Payments Example. Source. An order form, with online payment by credit card.
- Get the envelope tab data. Retrieve the tab (field) values for all of the envelope's recipients. Source.
- Set envelope tab values. The example creates an envelope and sets the initial values for its tabs (fields). Some of the tabs are set to be read-only, others can be updated by the recipient. The example also stores metadata with the envelope. Source.
- Set template tab values. The example creates an envelope using a template and sets the initial values for its tabs (fields). The example also stores metadata with the envelope. Source.
- Get the envelope custom field data (metadata). The example retrieves the custom metadata (custom data fields) stored with the envelope. Source.
- Send an envelope with a remote (email) signer using Access Code authentication. Source. This example sends an envelope using remote (email) signing requiring the recipient to enter an access code.
- Send an envelope with a remote (email) signer using SMS authentication. Source. This example sends an envelope using remote (email) signing requiring the recipient to supply a verification code sent to them via SMS.
- Send an envelope with a remote (email) signer using Phone authentication. Source. This example sends an envelope using remote (email) signing requiring the recipient to supply a verification code sent to them via a phone call.
- Send an envelope with a remote (email) signer using Knowledge-Based authentication. Source. This example sends an envelope using remote (email) signing requiring the recipient to validate their identity via Knowledge-Based authentication.
Download or clone this repository to your workstation
Each code example is a standalone file. You will configure each of the example files by setting the variables at the top of each file:
-
Access token: Use the OAuth Token Generator. To use the token generator, you'll need a free DocuSign Developer's account.
Each access token lasts 8 hours, you will need to repeat this process when the token expires. You can use the same access token for multiple examples.
-
Account Id: After logging into the DocuSign Sandbox system, you can copy your Account Id from the dropdown menu by your name. See the figure:
-
Signer name and email: Remember to try the DocuSign signing ceremony using both a mobile phone and a regular email client.
To use the payments code example, first create a test payments gatway in your account. Follow the instructions in the PAYMENTS_INSTALLATION.md file.
Then add the payment gateway id to the code example file.
Use the bash shell to run the examples.
The examples have been tested on Windows using the Git-Bash software included with the git for Windows open source application.
The scripts can also be used with MacOS and Linux systems.
The examples are in the /examples directory.
bash eg001EmbeddedSigning.sh
bash eg002SigningViaEmail.sh
bash eg003ListEnvelopes.sh
bash eg004EnvelopeInfo.sh
bash eg005EnvelopeRecipients.sh
bash eg006EnvelopeDocs.sh
bash eg007EnvelopeGetDoc.sh
bash eg008CreateTemplate.sh
bash eg009UseTemplate.sh
bash eg010SendBinaryDocs.sh
bash eg011EmbeddedSending.sh
bash eg012EmbeddedConsole.sh
bash eg013AddDocToTemplate.sh
bash eg014CollectPayment.sh
bash eg015GetEnvelopeTabData.sh
bash eg016SetEnvelopeTabValues.sh
bash eg017SetTemplateTabValues.sh
bash eg018GetEnvelopeCustomFieldData.sh
bash eg019SigningViaEmailWithAccessCode.sh
bash eg020SigningViaEmailWithSmsAuthentication.sh
bash eg021SigningViaEmailWithPhoneAuthentication.sh
bash eg022SigningViaEmailWithKnoweldgeBasedAuthentication.sh
# Note: to use example 14 you must also configure a
# payment gateway for your account.
bash eg014CollectPayment.sh
This repository uses the MIT License. See the LICENSE file for more information.
Pull requests are welcomed. Pull requests will only be considered if their content uses the MIT License.
