-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathSignatureRequestCreateEmbeddedWithTemplateExample.php
More file actions
53 lines (42 loc) · 1.77 KB
/
SignatureRequestCreateEmbeddedWithTemplateExample.php
File metadata and controls
53 lines (42 loc) · 1.77 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
<?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);
$signer_experience = (new Dropbox\Sign\Model\SubSignerExperience())
->setFormView(Dropbox\Sign\Model\SubSignerExperience::FORM_VIEW_DISABLED);
$signers_1 = (new Dropbox\Sign\Model\SubSignatureRequestTemplateSigner())
->setRole("Client")
->setName("George")
->setEmailAddress("george@example.com");
$signers = [
$signers_1,
];
$signature_request_create_embedded_with_template_request = (new Dropbox\Sign\Model\SignatureRequestCreateEmbeddedWithTemplateRequest())
->setClientId("b6b8e7deaf8f0b95c029dca049356d4a2cf9710a")
->setTemplateIds([
"c26b8a16784a872da37ea946b9ddec7c1e11dff6",
])
->setMessage("Glad we could come to an agreement.")
->setSubject("Purchase Order")
->setTestMode(true)
->setSigningOptions($signing_options)
->setSignerExperience($signer_experience)
->setSigners($signers);
try {
$response = (new Dropbox\Sign\Api\SignatureRequestApi(config: $config))->signatureRequestCreateEmbeddedWithTemplate(
signature_request_create_embedded_with_template_request: $signature_request_create_embedded_with_template_request,
);
print_r($response);
} catch (Dropbox\Sign\ApiException $e) {
echo "Exception when calling SignatureRequestApi#signatureRequestCreateEmbeddedWithTemplate: {$e->getMessage()}";
}