-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSignatureRequestSendExample.ts
More file actions
67 lines (59 loc) · 1.65 KB
/
SignatureRequestSendExample.ts
File metadata and controls
67 lines (59 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import * as fs from 'fs';
import api from "@dropbox/sign"
import models from "@dropbox/sign"
const apiCaller = new api.SignatureRequestApi();
apiCaller.username = "YOUR_API_KEY";
// apiCaller.accessToken = "YOUR_ACCESS_TOKEN";
const fieldOptions: models.SubFieldOptions = {
dateFormat: models.SubFieldOptions.DateFormatEnum.DdMmYyyy,
};
const signingOptions: models.SubSigningOptions = {
defaultType: models.SubSigningOptions.DefaultTypeEnum.Draw,
draw: true,
phone: false,
type: true,
upload: true,
force_advanced_signature_details: false,
};
const signers1: models.SubSignatureRequestSigner = {
name: "Jack",
emailAddress: "jack@example.com",
order: 0,
};
const signers2: models.SubSignatureRequestSigner = {
name: "Jill",
emailAddress: "jill@example.com",
order: 1,
};
const signers = [
signers1,
signers2,
];
const signatureRequestSendRequest: models.SignatureRequestSendRequest = {
message: "Please sign this NDA and then we can discuss more. Let me know if you\nhave any questions.",
subject: "The NDA we talked about",
testMode: true,
title: "NDA with Acme Co.",
ccEmailAddresses: [
"lawyer1@dropboxsign.com",
"lawyer2@dropboxsign.com",
],
files: [
fs.createReadStream("./example_signature_request.pdf"),
],
metadata: {
"custom_id": 1234,
"custom_text": "NDA #9"
},
fieldOptions: fieldOptions,
signingOptions: signingOptions,
signers: signers,
};
apiCaller.signatureRequestSend(
signatureRequestSendRequest,
).then(response => {
console.log(response.body);
}).catch(error => {
console.log("Exception when calling SignatureRequestApi#signatureRequestSend:");
console.log(error.body);
});