PHP code example of signaturit / signaturit-sdk

1. Go to this page and download the library: Download signaturit/signaturit-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

signaturit / signaturit-sdk example snippets




$accessToken = 'OTllYjUwM2NhYmNjNmJlYTZlNWEzNWYzYmZjNTRiZWI2YjU0ZjUxNzUwZDRjZjEwZTA0ZTFkZWQwZGExNDM3ZQ';

$client = new Signaturit\Client($accessToken);

$client = new Signaturit\Client($accessToken, true);

$response = $client->countSignatures();

$response = $client->getSignatures();

$response = $client->getSignatures(50);

$response = $client->getSignatures(100, 0, ['crm_id' => 'CUSTOM_ID'])

$response = $client->getSignature('a066298d-2877-11e4-b641-080027ea3a6e');

$filePath   = '/documents/contracts/receipt250.pdf';
$recipients = ['email' => '[email protected]', 'name' => 'John Doe'];
$options    = ['subject' => 'Receipt no. 250', 'body' => 'Please sign the receipt'];

$response = $client->createSignature($filePath, $recipients, $options);

$filePath   = '/documents/contracts/receipt250.pdf';
$recipients = ['email' => '[email protected]', 'name' => 'John Doe'];
$options    = ['subject' => 'Receipt no. 250', 'body' => 'Please sign the receipt', 'data' => ['crm_id' => '45673']];

$response = $client->createSignature($filePath, $recipients, $options);


$recipients = ['email' => '[email protected]', 'name' => 'John Doe'];
$options    = ['subject' => 'Receipt no. 250', 'body' => 'Please sign the receipt', 'templates' => ['template_name'], 'data' => ['widget_id' => 'default value']];

$response = $client->createSignature([], $recipients, $options);

$response = $client->cancelSignature('a066298d-2877-11e4-b641-080027ea3a6e');

$response = $client->sendSignatureReminder('a066298d-2877-11e4-b641-080027ea3a6e');

$response = $client->downloadAuditTrail('a066298d-2877-11e4-b641-080027ea3a6e', 'd474a1eb-2877-11e4-b641-080027ea3a6e');

$response = $client->downloadSignedDocument('a066298d-2877-11e4-b641-080027ea3a6e', 'd474a1eb-2877-11e4-b641-080027ea3a6e');

$response = $client->getBrandings();

$response = $client->getBranding('6472aad7-2877-11e4-b641-080027ea3a6e');

$options = [
    'layout_color'      => '#FFBF00',
    'text_color'        => '#2A1B0A',
    'application_texts' => ['sign_button' => 'Sign!']
];

$response = $client->createBranding($options);

$options = ['application_texts' => ['send_button' => 'Send!']];

$response = $client->updateBranding('6472aad7-2877-11e4-b641-080027ea3a6e', $options);

$response = $client->getTemplates();

response = client->getEmails()

response = client->getEmails(50)

response = client->getEmails(50, 50)

response = client->countEmails()

client->getEmail('EMAIL_ID')

response = client.createEmail(
    ['demo.pdf', 'receipt.pdf'],
    ['email' => '[email protected]', 'name' => 'Mr John'],
    'Php subject',
    'Php body',
    []
)

response = client.downloadEmailAuditTrail('EMAIL_ID','CERTIFICATE_ID')

response = client->getSms()

response = client->countSms()

client->getSms('SMS_ID')

response = client.createSms(
    [],
    ['phone' => '34123456', 'name' => 'Mr John'],
    'Php body',
    []
)

response = client.downloadSmsAuditTrail('SMS_ID','CERTIFICATE_ID')

$response = $client->getUsers();

$response = $client->getSeats();

$response = $client->getUser('USER_ID');

$response = $client->inviteUser('[email protected]', 'admin');

$response = $client->changeUserRole('USER_ID', 'member');

$response = $client->removeUser('USER_ID');

$response = $client->removeSeat('SEAT_ID');

$response = $client->getGroups();

$response = $client->getGroup('GROUP_ID');

$response = $client->createGroup('test_node');

$response = $client->updateGroup('GROUP_ID', 'new_name');

$response = $client->deleteGroup('GROUP_ID');

$response = $client->addManagerToGroup('GROUP_ID', 'USER_ID');

$response = $client->addMemberToGroup('GROUP_ID', 'USER_ID');

$response = $client->removeManagerFromGroup('GROUP_ID', 'USER_ID');

$response  = $client->removeMemberFromGroup('GROUP_ID', 'USER_ID');

$response = $client->getContacts();

$response = $client->getContact('CONTACT_ID');

$response = $client->createContact('[email protected]', 'name');

$response = $client->updateContact('CONTACT_ID', '[email protected]', 'name1');

$response = $client->deleteContact('CONTACT_ID');

$response = $client->getSubscriptions();

$response = $client->getSubscription('SUBSCRIPTION_ID');

$response = $client->createSubscription('http://httpbin.org/post', 'email_processed');

$response = $client->updateSubscription('SUBSCRIPTION_ID', null, 'email_delivered');

$response = $client->deleteSubscription('SUBSCRIPTION_ID');