-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSignatureRequestSendWithTemplateExample.php
More file actions
69 lines (55 loc) · 1.9 KB
/
SignatureRequestSendWithTemplateExample.php
File metadata and controls
69 lines (55 loc) · 1.9 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
68
69
<?php
namespace Dropbox\SignSandbox;
require_once __DIR__ . '/../vendor/autoload.php';
use SplFileObject;
use Dropbox;
$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername("YOUR_API_KEY");
// $config->setAccessToken("YOUR_ACCESS_TOKEN");
$signing_options = (new Dropbox\Sign\Model\SubSigningOptions())
->setDefaultType(Dropbox\Sign\Model\SubSigningOptions::DEFAULT_TYPE_DRAW)
->setDraw(true)
->setPhone(false)
->setType(true)
->setUpload(true)
->setForceAdvancedSignatureDetails(false);
$signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner())
->setRole("Client")
->setName("George")
->setEmailAddress("george@example.com");
$signers = [
$signers_1,
];
$ccs_1 = (new Dropbox\Sign\Model\SubCC())
->setRole("Accounting")
->setEmailAddress("accounting@example.com");
$ccs = [
$ccs_1,
];
$custom_fields_1 = (new Dropbox\Sign\Model\SubCustomField())
->setName("Cost")
->setEditor("Client")
->setRequired(true)
->setValue("\$20,000");
$custom_fields = [
$custom_fields_1,
];
$signature_request_send_with_template_request = (new Dropbox\Sign\Model\SignatureRequestSendWithTemplateRequest())
->setTemplateIds([
"61a832ff0d8423f91d503e76bfbcc750f7417c78",
])
->setMessage("Glad we could come to an agreement.")
->setSubject("Purchase Order")
->setTestMode(true)
->setSigningOptions($signing_options)
->setSigners($signers)
->setCcs($ccs)
->setCustomFields($custom_fields);
try {
$response = (new Dropbox\Sign\Api\SignatureRequestApi(config: $config))->signatureRequestSendWithTemplate(
signature_request_send_with_template_request: $signature_request_send_with_template_request,
);
print_r($response);
} catch (Dropbox\Sign\ApiException $e) {
echo "Exception when calling SignatureRequestApi#signatureRequestSendWithTemplate: {$e->getMessage()}";
}