Skip to content

Commit a8ad9a6

Browse files
authored
Merge pull request #2 from docusign/October_GA_Update_2.1_MattK
Updating for October GA Release
2 parents 9f16012 + f299e25 commit a8ad9a6

11 files changed

+510
-41
lines changed

README.md

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,79 @@
55
This repo includes bash scripts that use curl to demonstrate:
66

77
1. **Embedded Signing Ceremony.**
8-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg001EmbeddedSigning.sh)
8+
[Source.](./examples/eg001EmbeddedSigning.sh)
99
This example sends an envelope, and then uses an embedded signing ceremony for the first signer.
1010
With embedded signing, the DocuSign signing ceremony is initiated from your website.
1111
1. **Send an envelope with a remote (email) signer and cc recipient.**
12-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg002SigningViaEmail.sh)
12+
[Source.](./examples/eg002SigningViaEmail.sh)
1313
The envelope includes a pdf, Word, and HTML document.
1414
Anchor text ([AutoPlace](https://support.docusign.com/en/guides/AutoPlace-New-DocuSign-Experience)) is used to position the signing fields in the documents.
1515
1. **List envelopes in the user's account.**
16-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg003ListEnvelopes.sh)
16+
[Source.](./examples/eg003ListEnvelopes.sh)
1717
1. **Get an envelope's basic information.**
18-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg004EnvelopeInfo.sh)
18+
[Source.](./examples/eg004EnvelopeInfo.sh)
1919
The example lists the basic information about an envelope, including its overall status.
2020
1. **List an envelope's recipients**
21-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg005EnvelopeRecipients.sh)
21+
[Source.](./examples/eg005EnvelopeRecipients.sh)
2222
Includes current recipient status.
2323
1. **List an envelope's documents.**
24-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg006EnvelopeDocs.sh)
24+
[Source.](./examples/eg006EnvelopeDocs.sh)
2525
1. **Download an envelope's documents.**
26-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg007EnvelopeGetDoc.sh)
26+
[Source.](./examples/eg007EnvelopeGetDoc.sh)
2727
The example can download individual
2828
documents, the documents concatenated together, or a zip file of the documents.
2929
1. **Programmatically create a template.**
30-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg008CreateTemplate.sh)
30+
[Source.](./examples/eg008CreateTemplate.sh)
3131
1. **Send an envelope using a template.**
32-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg009UseTemplate.sh)
32+
[Source.](./examples/eg009UseTemplate.sh)
3333
1. **Send an envelope and upload its documents with multipart binary transfer.**
34-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg010SendBinaryDocs.sh)
34+
[Source.](./examples/eg010SendBinaryDocs.sh)
3535
Binary transfer is 33% more efficient than using Base64 encoding.
3636
1. **Embedded sending.**
37-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg011EmbeddedSending.sh)
37+
[Source.](./examples/eg011EmbeddedSending.sh)
3838
Embeds the DocuSign web tool (NDSE) in your web app to finalize or update
3939
the envelope and documents before they are sent.
4040
1. **Embedded DocuSign web tool (NDSE).**
41-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg012EmbeddedConsole.sh)
41+
[Source.](./examples/eg012EmbeddedConsole.sh)
4242
1. **Embedded Signing Ceremony from a template with an added document.**
43-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg013AddDocToTemplate.sh)
43+
[Source.](./examples/eg013AddDocToTemplate.sh)
4444
This example sends an envelope based on a template.
4545
In addition to the template's document(s), the example adds an
4646
additional document to the envelope by using the
4747
[Composite Templates](https://developers.docusign.com/esign-rest-api/guides/features/templates#composite-templates)
4848
feature.
4949
1. **Payments Example.**
50-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg014CollectPayment.sh)
50+
[Source.](./examples/eg014CollectPayment.sh)
5151
An order form, with online payment by credit card.
52-
1. **Get the envelope tab data.** (Coming Soon...)
53-
1. **Set envelope tab values.** (Coming Soon...)
54-
1. **Set template tab values.** (Coming Soon...)
55-
1. **Get the envelope custom field data (metadata).** (Coming Soon...)
56-
1. **Send an envelope with a remote (email) signer using Access Code authentication.**
57-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg019SigningViaEmailWithAccessCode.sh)
52+
1. **Get the envelope tab data.**
53+
Retrieve the tab (field) values for all of the envelope's recipients.
54+
[Source.](./examples/eg015EnvelopeTabData.sh)
55+
1. **Set envelope tab values.**
56+
The example creates an envelope and sets the initial values for its tabs (fields). Some of the tabs
57+
are set to be read-only, others can be updated by the recipient. The example also stores
58+
metadata with the envelope.
59+
[Source.](./examples/eg016SetTabValues.sh)
60+
1. **Set template tab values.**
61+
The example creates an envelope using a template and sets the initial values for its tabs (fields).
62+
The example also stores metadata with the envelope.
63+
[Source.](./examples/eg017SetTemplateTabValues.sh)
64+
1. **Get the envelope custom field data (metadata).**
65+
The example retrieves the custom metadata (custom data fields) stored with the envelope.
66+
[Source.](./examples/eg018EnvelopeCustomFieldData.sh)
67+
1. **Requiring an Access Code for a Recipient**
68+
[Source.](./examples/eg019SigningViaEmailWithAccessCode.sh)
5869
This example sends an envelope using remote (email) signing requiring the recipient to enter an access code.
5970
1. **Send an envelope with a remote (email) signer using SMS authentication.**
60-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg020SigningViaEmailWithSmsAuthentication.sh)
71+
[Source.](./examples/eg020SigningViaEmailWithSmsAuthentication.sh)
6172
This example sends an envelope using remote (email) signing requiring the recipient to supply a verification code sent to them via SMS.
6273
1. **Send an envelope with a remote (email) signer using Phone authentication.**
63-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg021SigningViaEmailWithPhoneAuthentication.sh)
74+
[Source.](./examples/eg021SigningViaEmailWithPhoneAuthentication.sh)
6475
This example sends an envelope using remote (email) signing requiring the recipient to supply a verification code sent to them via a phone call.
6576
1. **Send an envelope with a remote (email) signer using Knowledge-Based authentication.**
66-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg022SigningViaEmailWithKnoweldgeBasedAuthentication.sh)
77+
[Source.](./examples/eg022SigningViaEmailWithKnoweldgeBasedAuthentication.sh)
6778
This example sends an envelope using remote (email) signing requiring the recipient to validate their identity via Knowledge-Based authentication.
6879
1. **Send an envelope with a remote (email) signer using Identity Verification.**
69-
[Source.](https://github.com/docusign/eg-03-curl/blob/master/examples/eg023SigningViaEmailWithIDVAuthentication.sh)
80+
[Source.](./examples/eg023SigningViaEmailWithIDVAuthentication.sh)
7081
This example sends an envelope using remote (email) signing requiring the recipient to validate their identity via a government issued ID.
7182

7283
## Installation
@@ -128,10 +139,10 @@ bash eg011EmbeddedSending.sh
128139
bash eg012EmbeddedConsole.sh
129140
bash eg013AddDocToTemplate.sh
130141
base eg014CollectPayment.sh
131-
bash eg015GetEnvelopeTabData.sh (Coming Soon...)
132-
bash eg016SetEnvelopeTabValues.sh (Coming Soon...)
133-
bash eg017SetTemplateTabValues.sh (Coming Soon...)
134-
bash eg018GetEnvelopeCustomFieldData.sh (Coming Soon...)
142+
bash eg015GetEnvelopeTabData.sh
143+
bash eg016SetEnvelopeTabValues.sh
144+
bash eg017SetTemplateTabValues.sh
145+
bash eg018GetEnvelopeCustomFieldData.sh
135146
bash eg019SigningViaEmailWithAccessCode.sh
136147
bash eg020SigningViaEmailWithSmsAuthentication.sh
137148
bash eg021SigningViaEmailWithPhoneAuthentication.sh
29.2 KB
Binary file not shown.

examples/eg001EmbeddedSigning.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ signing_ceremony_url=`cat $response | grep url | sed 's/.*\"url\": \"//' | sed '
131131
# ***DS.snippet.0.end
132132
echo ""
133133
printf "The signing ceremony URL is ${signing_ceremony_url}\n"
134-
printf "It is only valid for a couple of minutes. Attempting to automatically open your browser...\n"
134+
printf "It is only valid for five minutes. Attempting to automatically open your browser...\n"
135135
if which xdg-open &> /dev/null ; then
136136
xdg-open "$signing_ceremony_url"
137137
elif which open &> /dev/null ; then

examples/eg008CreateTemplate.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# If one of the templates is named "Example Signer and CC template"
33
# then the template will not be created.
44

5-
# Configuration
6-
# 1. Obtain an OAuth access token from
7-
# https://developers.docusign.com/oauth-token-generator
8-
access_token='{ACCESS_TOKEN}'
9-
# 2. Obtain your accountId from demo.docusign.com -- the account id is shown in
10-
# the drop down on the upper right corner of the screen by your picture or
11-
# the default picture.
12-
account_id='{ACCOUNT_ID}'
5+
6+
# Step 1: Obtain your OAuth token
7+
# Note: Substitute these values with your own
8+
access_token="{ACCESS_TOKEN}"
9+
10+
# Set up variables for full code example
11+
# Note: Substitute these values with your own
12+
account_id="{ACCOUNT_ID}"
1313

1414
# Check that we're in a bash shell
1515
if [[ $SHELL != *"bash"* ]]; then
@@ -32,7 +32,8 @@ curl --header "Authorization: Bearer ${access_token}" \
3232
--output $response
3333

3434
# pull out the templateId if it was returned
35-
TEMPLATE_ID=`cat $response | grep templateId | sed 's/.*\"templateId\": \"//' | sed 's/\",.*//'`
35+
TEMPLATE_ID=`cat $response | grep templateId | sed 's/.*\"templateId\":\"//' | sed 's/\",.*//'`
36+
3637
if [ "${TEMPLATE_ID}" != "" ]; then
3738
echo ""
3839
echo "Your account already includes the '${template_name}' template."

examples/eg011EmbeddedSending.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fi
166166

167167
echo ""
168168
printf "The sending ceremony URL is ${sending_ceremony_url}\n"
169-
printf "It is only valid for a couple of minutes. Attempting to automatically open your browser...\n"
169+
printf "It is only valid for five minutes. Attempting to automatically open your browser...\n"
170170
if which xdg-open &> /dev/null ; then
171171
xdg-open "$sending_ceremony_url"
172172
elif which open &> /dev/null ; then

examples/eg012EmbeddedConsole.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ console_url=`cat $response | grep url | sed 's/.*\"url\": \"//' | sed 's/\".*//'
6868
# ***DS.snippet.0.end
6969
echo ""
7070
printf "The console URL is ${console_url}\n"
71-
printf "It is only valid for a couple of minutes. Attempting to automatically open your browser...\n"
71+
printf "It is only valid for five minutes. Attempting to automatically open your browser...\n"
7272
if which xdg-open &> /dev/null ; then
7373
xdg-open "$console_url"
7474
elif which open &> /dev/null ; then

examples/eg013AddDocToTemplate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ signing_ceremony_url=`cat $response | grep url | sed 's/.*\"url\": \"//' | sed '
173173
# ***DS.snippet.0.end
174174
echo ""
175175
printf "The signing ceremony URL is ${signing_ceremony_url}\n"
176-
printf "It is only valid for a couple of minutes. Attempting to automatically open your browser...\n"
176+
printf "It is only valid for five minutes. Attempting to automatically open your browser...\n"
177177
if which xdg-open &> /dev/null ; then
178178
xdg-open "$signing_ceremony_url"
179179
elif which open &> /dev/null ; then

examples/eg015EnvelopeTabData.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Retreive Envelope Tab Data
2+
3+
# Step 1: Obtain your OAuth token
4+
# Note: Substitute these values with your own
5+
oAuthAccessToken="{ACCESS_TOKEN}"
6+
7+
# Set up variables for full code example
8+
# Note: Substitute these values with your own
9+
APIAccountId="{ACCOUNT_ID}"
10+
11+
# Check that we're in a bash shell
12+
if [[ $SHELL != *"bash"* ]]; then
13+
echo "PROBLEM: Run these scripts from within the bash shell."
14+
fi
15+
base_path="https://demo.docusign.net/restapi"
16+
17+
# Check that we have an envelope ID
18+
if [ ! -f ../ENVELOPE_ID ]; then
19+
echo ""
20+
echo "PROBLEM: An envelope id is needed. Fix: execute script eg001EmbeddedSigning.sh"
21+
echo ""
22+
exit -1
23+
fi
24+
envelope_id=`cat ../ENVELOPE_ID`
25+
26+
#Step 2: Create your authorization headers
27+
28+
declare -a Headers=('--header' "Authorization: Bearer ${oAuthAccessToken}" \
29+
'--header' "Accept: application/json" \
30+
'--header' "Content-Type: application/json")
31+
32+
# Step 3: a) Make a GET call to the form_data endpoint to retrieve your envelope tab values
33+
# b) Display the JSON response
34+
35+
response=$(mktemp /tmp/response-rst.XXXXXX)
36+
37+
Status=$(curl -w '%{http_code}' -i --request GET https://demo.docusign.net/restapi/v2.1/accounts/${APIAccountId}/envelopes/${envelopeId}/form_data \
38+
"${Headers[@]}" \
39+
--output ${response})
40+
41+
if [[ "$Status" -gt "201" ]] ; then
42+
echo ""
43+
echo "Retrieving envelope form data has failed."
44+
echo ""
45+
cat $response
46+
exit 1
47+
fi
48+
49+
echo ""
50+
echo "Response:"
51+
cat $response
52+
echo ""
53+
54+
# Remove the temporary files
55+
rm "$response"

0 commit comments

Comments
 (0)