Skip to content

Commit 0714b3b

Browse files
committed
more eg
1 parent 11a824a commit 0714b3b

File tree

5 files changed

+397
-182
lines changed

5 files changed

+397
-182
lines changed

demo_documents/added_document.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
</head>
6+
<body style="font-family:sans-serif;margin-left:2em;">
7+
<h1 style="font-family: 'Trebuchet MS', Helvetica, sans-serif;
8+
color: darkblue;margin-bottom: 0;">World Wide Corp</h1>
9+
<h2 style="font-family: 'Trebuchet MS', Helvetica, sans-serif;
10+
margin-top: 0px;margin-bottom: 3.5em;font-size: 1em;
11+
color: darkblue;">Order Processing Division</h2>
12+
<p style="margin-top:3em; margin-bottom:0em;">Item: <b>Oranges</b>, quantity: <b>20 gross</b> at market price.</p>
13+
<p style="margin-top:3em;">
14+
Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice cream gummies cheesecake.
15+
</p>
16+
<!-- Note the anchor tag for the signature field is in white. -->
17+
<h3 style="margin-top:3em;">Agreed: <span style="color:white;">**signature_1**</span></h3>
18+
</body>
19+
</html>

demo_documents/order_form.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
</head>
6+
<body style="font-family:sans-serif;margin:2em;line-height:1.5;">
7+
<h1 style="font-family: 'Trebuchet MS', Helvetica, sans-serif;
8+
color: darkblue;margin-bottom: 0;">World Wide Corp</h1>
9+
<h2 style="font-family: 'Trebuchet MS', Helvetica, sans-serif;
10+
margin-top: 0px;margin-bottom: 3.5em;font-size: 1em;
11+
color: darkblue;">Order Processing Division</h2>
12+
<p style="margin-top:3em;">
13+
Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice cream gummies cheesecake.
14+
</p>
15+
16+
<table style="font-family:sans-serif;text-align:left;border-spacing:2px;border-color:grey;line-height:1.5;">
17+
<thead style="vertical-align: middle;">
18+
<tr>
19+
<th scope="col" style="padding: 9px 20px 0;font-size:1.1em;border-bottom: 2px solid #6678b1;">Item</th>
20+
<th scope="col" style="padding: 9px 20px 0;font-size:1.1em;border-bottom: 2px solid #6678b1;">Quantity</th>
21+
<th scope="col" style="padding: 9px 8px 0;font-size:1.1em;border-bottom: 2px solid #6678b1;">Each</th>
22+
<th scope="col" style="padding: 9px 50px 0;font-size:1.1em;border-bottom: 2px solid #6678b1;">Extended</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<tr>
27+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">Harmonica</td>
28+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
29+
<span style="color:white;">/l1q/</span>
30+
</td>
31+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">$5</td>
32+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
33+
$<span style="color:white;">/l1e/</span>
34+
</td>
35+
</tr>
36+
<tr>
37+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">Xylophone</td>
38+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
39+
<span style="color:white;">/l2q/</span>
40+
</td>
41+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">$150</td>
42+
<td style="padding: 9px 8px 0;border-bottom: 1px solid #667;">
43+
$<span style="color:white;">/l2e/</span>
44+
</td>
45+
</tr>
46+
<tr>
47+
<td colspan="3"
48+
style="font-weight: bold;font-size:1.1em;text-align: right;padding: 9px 8px 0;border-bottom: 5px solid #667;">Total:</td>
49+
<td style="font-weight: bold;font-size:1.1em;padding: 9px 8px 0;border-bottom: 5px solid #667;">
50+
$<span style="color:white;">/l3t/</span>
51+
</td>
52+
</tr>
53+
</tbody>
54+
</table>
55+
56+
57+
<!-- Note the anchor tag for the signature field is in white. -->
58+
<h3 style="margin-top:3em;">Agreed: <span style="color:white;">/sn1/</span></h3>
59+
</body>
60+
</html>

examples/eg012EmbeddedConsole.sh

Lines changed: 62 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
# List envelopes and their status
2-
# List changes for the last 10 days
3-
4-
# Check that we're in a bash shell
5-
if [[ $SHELL != *"bash"* ]]; then
6-
echo "PROBLEM: Run these scripts from within the bash shell."
7-
fi
8-
base_path="https://demo.docusign.net/restapi"
1+
# Redirect to the DocuSign console web tool
92

103
# Configuration
114
# 1. Obtain an OAuth access token from
@@ -16,30 +9,74 @@ access_token='{ACCESS_TOKEN}'
169
# the default picture.
1710
account_id='{ACCOUNT_ID}'
1811

19-
echo ""
20-
echo "Sending the list envelope status request to DocuSign..."
21-
echo "Results:"
22-
echo ""
12+
# Check that we're in a bash shell
13+
if [[ $SHELL != *"bash"* ]]; then
14+
echo "PROBLEM: Run these scripts from within the bash shell."
15+
fi
16+
base_path="https://demo.docusign.net/restapi"
2317

24-
# Calculate the from_date query parameter and use the ISO 8601 format.
25-
# Example:
26-
# from_date=2018-09-30T07:43:12+03:00
27-
# For a Mac, 10 days in the past:
28-
if date -v -10d &> /dev/null ; then
29-
# Mac
30-
from_date=`date -v -10d '+%Y-%m-%dT%H:%M:%S%z'`
31-
else
32-
# Not a Mac
33-
from_date=`date --date='-10 days' '+%Y-%m-%dT%H:%M:%S%z'`
18+
# Check that we have an envelope id
19+
if [ ! -f ../ENVELOPE_ID ]; then
20+
echo ""
21+
echo "PROBLEM: An envelope id is needed. Fix: execute script eg002SigningViaEmail.sh"
22+
echo ""
23+
exit -1
3424
fi
25+
envelope_id=`cat ../ENVELOPE_ID`
26+
27+
# The returnUrl is normally your own web app. DocuSign will redirect
28+
# the signer to returnUrl when the signing ceremony completes.
29+
# For this example, we'll use http://httpbin.org/get to show the
30+
# query parameters passed back from DocuSign
31+
32+
# The web tool console can be opened in either of two views:
33+
echo ""
34+
PS3='Select the console view: '
35+
options=("Front page" "Envelope view")
36+
select opt in "${options[@]}"
37+
do
38+
case $opt in
39+
"Front page")
40+
json='{"returnUrl": "http://httpbin.org/get"}'
41+
break
42+
;;
43+
"Envelope view")
44+
json="{\"returnUrl\": \"http://httpbin.org/get\",
45+
\"envelopeId\": \"${envelope_id}\"}"
46+
break
47+
;;
48+
esac
49+
done
50+
51+
echo ""
52+
echo "Requesting the console view url"
53+
echo ""
3554

55+
response=$(mktemp /tmp/response-eg-012.XXXXXX)
3656
curl --header "Authorization: Bearer ${access_token}" \
3757
--header "Content-Type: application/json" \
38-
--get \
39-
--data-urlencode "from_date=${from_date}" \
40-
--request GET ${base_path}/v2/accounts/${account_id}/envelopes
58+
--data-binary "${json}" \
59+
--request POST ${base_path}/v2/accounts/${account_id}/views/console
4160

4261
echo ""
62+
echo "Results:"
63+
echo ""
64+
cat $response
65+
console_url=`cat $response | grep url | sed 's/.*\"url\": \"//' | sed 's/\".*//'`
66+
echo ""
67+
printf "The console URL is ${console_url}\n"
68+
printf "It is only valid for a couple of minutes. Attempting to automatically open your browser...\n"
69+
if which xdg-open &> /dev/null ; then
70+
xdg-open "$console_url"
71+
elif which open &> /dev/null ; then
72+
open "$console_url"
73+
elif which start &> /dev/null ; then
74+
start "$console_url"
75+
fi
76+
77+
# cleanup
78+
rm "$response"
79+
4380
echo ""
4481
echo "Done."
4582
echo ""

0 commit comments

Comments
 (0)