-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_signer-external.php
40 lines (35 loc) · 1.21 KB
/
add_signer-external.php
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
<?php
require_once __DIR__ . '/config/config.php';
require_once __DIR__ . '/config/lib.php';
//Token of the Signing that will be shared.
$signingToken = $argv[1];
// Add as many signers as you need.
$signers = [
[
// Unique signer identifier from your system.
'external_id' => '13579',
'name' => 'Test',
'surname' => 'Signer',
// Signer's email for sending signing invitation email. Required if phone is not set.
'email' => 'test+share@dokobit.com',
// Role can be signer or viewer.
'role' => 'signer',
// Optional parameters.
'company' => 'Example Company',
'position' => 'Employee'
]
];
$action = 'signing-external/' . $signingToken . '/signers/add';
$createResponse = request(getApiUrlByAction($action), [
'signers' => $signers,
'comment' => "This is a message that signer will get"
], REQUEST_POST);
if ($createResponse['status'] != 'ok') {
print_r($createResponse);
echo "Signing could not be shared." . PHP_EOL;
exit;
}
print_r($createResponse);
//Output URL to check signing status.
print("Signing status can be checked here \n");
print(getApiUrlByAction('signing-external/' . $signingToken . '/status')) . PHP_EOL;