-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSignatureRequestBulkSendWithTemplateExample.php
More file actions
89 lines (69 loc) · 2.49 KB
/
Copy pathSignatureRequestBulkSendWithTemplateExample.php
File metadata and controls
89 lines (69 loc) · 2.49 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?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");
$signer_list_2_custom_fields_1 = (new Dropbox\Sign\Model\SubBulkSignerListCustomField())
->setName("company")
->setValue("123 LLC");
$signer_list_2_custom_fields = [
$signer_list_2_custom_fields_1,
];
$signer_list_2_signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner())
->setRole("Client")
->setName("Mary")
->setEmailAddress("mary@example.com")
->setPin("gd9as5b");
$signer_list_2_signers = [
$signer_list_2_signers_1,
];
$signer_list_1_custom_fields_1 = (new Dropbox\Sign\Model\SubBulkSignerListCustomField())
->setName("company")
->setValue("ABC Corp");
$signer_list_1_custom_fields = [
$signer_list_1_custom_fields_1,
];
$signer_list_1_signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner())
->setRole("Client")
->setName("George")
->setEmailAddress("george@example.com")
->setPin("d79a3td");
$signer_list_1_signers = [
$signer_list_1_signers_1,
];
$signer_list_1 = (new Dropbox\Sign\Model\SubBulkSignerList())
->setCustomFields($signer_list_1_custom_fields)
->setSigners($signer_list_1_signers);
$signer_list_2 = (new Dropbox\Sign\Model\SubBulkSignerList())
->setCustomFields($signer_list_2_custom_fields)
->setSigners($signer_list_2_signers);
$signer_list = [
$signer_list_1,
$signer_list_2,
];
$ccs_1 = (new Dropbox\Sign\Model\SubCC())
->setRole("Accounting")
->setEmailAddress("accounting@example.com");
$ccs = [
$ccs_1,
];
$signature_request_bulk_send_with_template_request = (new Dropbox\Sign\Model\SignatureRequestBulkSendWithTemplateRequest())
->setTemplateIds([
"c26b8a16784a872da37ea946b9ddec7c1e11dff6",
])
->setMessage("Glad we could come to an agreement.")
->setSubject("Purchase Order")
->setTestMode(true)
->setSignerList($signer_list)
->setCcs($ccs);
try {
$response = (new Dropbox\Sign\Api\SignatureRequestApi(config: $config))->signatureRequestBulkSendWithTemplate(
signature_request_bulk_send_with_template_request: $signature_request_bulk_send_with_template_request,
);
print_r($response);
} catch (Dropbox\Sign\ApiException $e) {
echo "Exception when calling SignatureRequestApi#signatureRequestBulkSendWithTemplate: {$e->getMessage()}";
}