Skip to content

Commit 12818dd

Browse files
committed
eg004EnvelopeInfo
1 parent f82bcc9 commit 12818dd

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

Examples/eg001EmbeddedSigning.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ echo ""
8787
# pull out the envelopeId
8888
ENVELOPE_ID=`cat $response | grep envelopeId | sed 's/.*\"envelopeId\": \"//' | sed 's/\",//' | tr -d '\r'`
8989
echo "EnvelopeId: ${ENVELOPE_ID}"
90-
# Save the envelope id for use by other scripts
91-
echo ${ENVELOPE_ID} > ../ENVELOPE_ID
9290

9391
# Step 2. Create a recipient view (a signing ceremony view)
9492
# that the signer will directly open in their browser to sign.

Examples/eg002SigningViaEmail.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ fi
1616
# After it is signed, a copy is sent to the cc person.
1717

1818
# temp files:
19-
request_data=$(mktemp /tmp/request.XXXXXX)
19+
request_data=$(mktemp /tmp/request-eg-002.XXXXXX)
20+
response=$(mktemp /tmp/response-eg-002.XXXXXX)
2021
doc1_base64=$(mktemp /tmp/eg-002-doc1.XXXXXX)
2122
doc2_base64=$(mktemp /tmp/eg-002-doc2.XXXXXX)
2223
doc3_base64=$(mktemp /tmp/eg-002-doc3.XXXXXX)
@@ -105,10 +106,20 @@ printf \
105106
curl --header "Authorization: Bearer {ACCESS_TOKEN}" \
106107
--header "Content-Type: application/json" \
107108
--data-binary @${request_data} \
108-
--request POST https://demo.docusign.net/restapi/v2/accounts/{ACCOUNT_ID}/envelopes
109+
--request POST https://demo.docusign.net/restapi/v2/accounts/{ACCOUNT_ID}/envelopes \
110+
--output $response
111+
112+
echo ""
113+
cat $response
114+
115+
# pull out the envelopeId
116+
ENVELOPE_ID=`cat $response | grep envelopeId | sed 's/.*\"envelopeId\": \"//' | sed 's/\",//' | tr -d '\r'`
117+
# Save the envelope id for use by other scripts
118+
echo ${ENVELOPE_ID} > ../ENVELOPE_ID
109119

110120
# cleanup
111121
rm "$request_data"
122+
rm "$response"
112123
rm "$doc1_base64"
113124
rm "$doc2_base64"
114125
rm "$doc3_base64"

Examples/eg004EnvelopeInfo.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Get the envelope's details
2+
# This script uses the envelope_id stored in ../ENVELOPE_ID.
3+
# The ENVELOPE_ID file is created by example eg002SigningViaEmail.sh or
4+
# can be manually created.
5+
6+
7+
# Check that we're in a bash shell
8+
if [[ $SHELL != *"bash"* ]]; then
9+
echo "PROBLEM: Run these scripts from within the bash shell."
10+
fi
11+
12+
# Check that we have an envelope id
13+
if [ ! -f ../ENVELOPE_ID ]; then
14+
echo "An envelope id is needed. Execute script eg002SigningViaEmail.sh"
15+
echo ""
16+
exit -1
17+
fi
18+
envelope_id=`cat ../ENVELOPE_ID`
19+
20+
echo ""
21+
echo "Sending the Envelopes::get request to DocuSign..."
22+
echo "Results:"
23+
echo ""
24+
25+
curl --header "Authorization: Bearer {ACCESS_TOKEN}" \
26+
--header "Content-Type: application/json" \
27+
--request GET https://demo.docusign.net/restapi/v2/accounts/{ACCOUNT_ID}/envelopes/${envelope_id}
28+
29+
echo ""
30+
echo ""
31+
echo "Done."
32+
echo ""
33+

0 commit comments

Comments
 (0)