Skip to content

Commit 7481dc2

Browse files
committed
Update Examples/eg001EmbeddedSigning.sh
1 parent 899eab4 commit 7481dc2

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

Examples/eg001EmbeddedSigning.sh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ source ../Env.txt
1010
#
1111
# Step 1. Create the envelope.
1212
# The signer recipient includes a clientUserId setting
13-
# Step 2. Create a recipient view (a signing ceremony view)
14-
# that the signer will directly open in their browser to sign.
15-
16-
# Step 1...
1713
#
1814
# document 1 (pdf) has tag /sn1/
1915
# The envelope has two recipients.
@@ -90,8 +86,35 @@ echo "Response:"
9086
cat $response
9187

9288
# pull out the envelopeId
93-
ENVELOPE_ID=`sed 's/{\"access_token\":\"//' $response |
94-
sed 's/\",\"token_type\":\"Bearer\"\,\"refresh_token\":\".*\",\"expires_in\":.*}//'`
89+
ENVELOPE_ID=`cat $response | grep envelopeId | sed 's/.*\"envelopeId\": \"//' | sed 's/\",//'`
90+
echo "EnvelopeId: |${ENVELOPE_ID}|"
91+
92+
93+
# Step 2. Create a recipient view (a signing ceremony view)
94+
# that the signer will directly open in their browser to sign.
95+
#
96+
# The returnUrl is normally your own web app. DocuSign will redirect
97+
# the signer to returnUrl when the signing ceremony completes.
98+
# For this example, we'll use http://httpbin.org/get to show the
99+
# query parameters passed back from DocuSign
100+
101+
curl --header "Authorization: Bearer {ACCESS_TOKEN}" \
102+
--header "Content-Type: application/json" \
103+
--data-binary '
104+
{
105+
"returnUrl": "http://httpbin.org/get",
106+
"authenticationMethod": "none",
107+
"email": "{USER_EMAIL}",
108+
"userName": "{USER_FULLNAME}",
109+
"clientUserId": 1000,
110+
}' \
111+
--request POST https://demo.docusign.net/restapi/v2/accounts/{ACCOUNT_ID}/envelopes/${ENVELOPE_ID}/views/recipient \
112+
--output ${response}
113+
114+
echo ""
115+
echo "Get recipient view response:"
116+
cat $response
117+
95118

96119

97120
#echo ""

0 commit comments

Comments
 (0)