|
| 1 | +# API Authorization Code Grant Examples with Curl |
| 2 | + |
| 3 | +### Github repo: eg-03-curl |
| 4 | +## Introduction |
| 5 | +This repo includes bash scripts that use curl to demonstrate": |
| 6 | + |
| 7 | +1. **Embedded Signing Ceremony.** |
| 8 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg001EmbeddedSigning.js) |
| 9 | + This example sends an envelope, and then uses an embedded signing ceremony for the first signer. |
| 10 | + With embedded signing, the DocuSign signing ceremony is initiated from your website. |
| 11 | +1. **Send an envelope with a remote (email) signer and cc recipient.** |
| 12 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg002SigningViaEmail.js) |
| 13 | + The envelope includes a pdf, Word, and HTML document. |
| 14 | + Anchor text ([AutoPlace](https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience)) is used to position the signing fields in the documents. |
| 15 | +1. **List envelopes in the user's account.** |
| 16 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg003ListEnvelopes.js) |
| 17 | +1. **Get an envelope's basic information.** |
| 18 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg004EnvelopeInfo.js) |
| 19 | + The example lists the basic information about an envelope, including its overall status. |
| 20 | +1. **List an envelope's recipients** |
| 21 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg005EnvelopeRecipients.js) |
| 22 | + Includes current recipient status. |
| 23 | +1. **List an envelope's documents.** |
| 24 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg006EnvelopeDocs.js) |
| 25 | +1. **Download an envelope's documents.** |
| 26 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg007EnvelopeGetDoc.js) |
| 27 | + The example can download individual |
| 28 | + documents, the documents concatenated together, or a zip file of the documents. |
| 29 | +1. **Programmatically create a template.** |
| 30 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg008CreateTemplate.js) |
| 31 | +1. **Send an envelope using a template.** |
| 32 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg009UseTemplate.js) |
| 33 | +1. **Send an envelope and upload its documents with multpart binary transfer.** |
| 34 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg010SendBinaryDocs.js) |
| 35 | + Binary transfer is 33% more efficient than using Base64 encoding. |
| 36 | +1. **Embedded sending.** |
| 37 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg011EmbeddedSending.js) |
| 38 | + Embeds the DocuSign web tool (NDSE) in your web app to finalize or update |
| 39 | + the envelope and documents before they are sent. |
| 40 | +1. **Embedded DocuSign web tool (NDSE).** |
| 41 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg012EmbeddedConsole.js) |
| 42 | +1. **Embedded Signing Ceremony from a template with an added document.** |
| 43 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg013AddDocToTemplate.js) |
| 44 | + This example sends an envelope based on a template. |
| 45 | + In addition to the template's document(s), the example adds an |
| 46 | + additional document to the envelope by using the |
| 47 | + [Composite Templates](https://developers.docusign.com/esign-rest-api/guides/features/templates#composite-templates) |
| 48 | + feature. |
| 49 | +1. **Payments example: an order form, with online payment by credit card.** |
| 50 | + [Source.](https://github.com/docusign/eg-03-node-auth-code-grant/blob/master/lib/examples/eg014CollectPayment.js) |
| 51 | + |
| 52 | +## Installation |
| 53 | + |
| 54 | +Download or clone this repository to your workstation |
| 55 | + |
| 56 | +### Configure the examples' settings |
| 57 | +Each code example is a standalone file. You will configure |
| 58 | +each of the example files by setting the variables at the top of each |
| 59 | +file: |
| 60 | + |
| 61 | + * **Access token:** Use the [OAuth Token Generator](https://developers.docusign.com/oauth-token-generator). |
| 62 | + To use the token generator, you'll need a |
| 63 | + [free DocuSign Developer's account.](https://go.docusign.com/o/sandbox/) |
| 64 | + |
| 65 | + Each access token lasts 8 hours, you will need to repeat this process |
| 66 | + when the token expires. You can use the same access token for |
| 67 | + multiple examples. |
| 68 | + |
| 69 | + * **Account Id:** After logging into the [DocuSign Sandbox system](https://demo.docusign.net), |
| 70 | + you can copy your Account Id from the dropdown menu by your name. See the figure: |
| 71 | + |
| 72 | +  |
| 73 | + * **Signer name and email:** Remember to try the DocuSign signing ceremony using both a mobile phone and a regular |
| 74 | + email client. |
| 75 | + |
| 76 | +## Run the examples |
| 77 | + |
| 78 | +Use the bash shell to run the examples. |
| 79 | + |
| 80 | +The examples have been tested on |
| 81 | +Windows using the **Git-Bash** software included with the |
| 82 | +[git for Windows](https://gitforwindows.org/) open source application. |
| 83 | + |
| 84 | +The scripts can also be used with MacOS and Linux systems. |
| 85 | + |
| 86 | +The examples are in the `/examples` directory. |
| 87 | + |
| 88 | +``` |
| 89 | +bash eg001EmbeddedSigning.sh |
| 90 | +bash eg002SigningViaEmail.sh |
| 91 | +bash eg003ListEnvelopes.sh |
| 92 | +bash eg004EnvelopeInfo.sh |
| 93 | +bash eg005EnvelopeRecipients.sh |
| 94 | +bash eg006EnvelopeDocs.sh |
| 95 | +bash eg007EnvelopeGetDoc.sh |
| 96 | +bash eg008CreateTemplate.sh |
| 97 | +bash eg009UseTemplate.sh |
| 98 | +bash eg010SendBinaryDocs.sh |
| 99 | +bash eg011EmbeddedSending.sh |
| 100 | +bash eg012EmbeddedConsole.sh |
| 101 | +bash eg013AddDocToTemplate.sh |
| 102 | +
|
| 103 | +# Note: to use example 14 you must also configure a |
| 104 | +# payment gateway for your account. |
| 105 | +bash eg014CollectPayment.sh |
| 106 | +``` |
| 107 | + |
| 108 | +## License and additional information |
| 109 | + |
| 110 | +### License |
| 111 | +This repository uses the MIT License. See the LICENSE file for more information. |
| 112 | + |
| 113 | +### Pull Requests |
| 114 | +Pull requests are welcomed. Pull requests will only be considered if their content |
| 115 | +uses the MIT License. |
0 commit comments