This package is a PHP wrapper around the Signaturit API. If you didn't read the documentation yet, maybe it's time to take a look here.
You'll need at least PHP 5.5 to use this package (http://php.net/supported-versions.php).
The recommended way to install the SDK is through Composer.
composer require signaturit/signaturit-sdk
Then import Composer's autoload.php file from your script and instantiate the Client class passing in your API access token.
require_once __DIR__.'/vendor/autoload.php';
$accessToken = 'OTllYjUwM2NhYmNjNmJlYTZlNWEzNWYzYmZjNTRiZWI2YjU0ZjUxNzUwZDRjZjEwZTA0ZTFkZWQwZGExNDM3ZQ';
$client = new Signaturit\Client($accessToken);
Please note that by default the client will use our sandbox API. When you are ready to start using the production environment just get the correct access token and pass an additional argument to the constructor:
$client = new Signaturit\Client($accessToken, true);
Count your signature requests.
$response = $client->countSignatures();
Retrieve all data from your signature requests using different filters.
$response = $client->getSignatures();
$response = $client->getSignatures(50);
$response = $client->getSignatures(100, 0, ['crm_id' => 'CUSTOM_ID'])
Get the information regarding a single signature request passing its ID.
$response = $client->getSignature('a066298d-2877-11e4-b641-080027ea3a6e');
Create a new signature request. You can check all signature params.
$filePath = '/documents/contracts/receipt250.pdf';
$recipients = ['email' => 'john.doe@example.com', 'name' => 'John Doe'];
$options = ['subject' => 'Receipt no. 250', 'body' => 'Please sign the receipt'];
$response = $client->createSignature($filePath, $recipients, $options);
You can add custom info in your requests
$filePath = '/documents/contracts/receipt250.pdf';
$recipients = ['email' => 'john.doe@example.com', 'name' => 'John Doe'];
$options = ['subject' => 'Receipt no. 250', 'body' => 'Please sign the receipt', 'data' => ['crm_id' => '45673']];
$response = $client->createSignature($filePath, $recipients, $options);
You can send templates with the fields filled
$recipients = ['email' => 'john.doe@example.com', '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);
Cancel a signature request.
$response = $client->cancelSignature('a066298d-2877-11e4-b641-080027ea3a6e');
Send a reminder email.
$response = $client->sendSignatureReminder('a066298d-2877-11e4-b641-080027ea3a6e');
Get the audit trail of a signature request document
$response = $client->downloadAuditTrail('a066298d-2877-11e4-b641-080027ea3a6e', 'd474a1eb-2877-11e4-b641-080027ea3a6e');
Get the signed document of a signature request document
$response = $client->downloadSignedDocument('a066298d-2877-11e4-b641-080027ea3a6e', 'd474a1eb-2877-11e4-b641-080027ea3a6e');
Get all account brandings.
$response = $client->getBrandings();
Get a single branding.
$response = $client->getBranding('6472aad7-2877-11e4-b641-080027ea3a6e');
Create a new branding. You can check all branding params.`
$options = [
'layout_color' => '#FFBF00',
'text_color' => '#2A1B0A',
'application_texts' => ['sign_button' => 'Sign!']
];
$response = $client->createBranding($options);
Update a single branding.
$options = ['application_texts' => ['send_button' => 'Send!']];
$response = $client->updateBranding('6472aad7-2877-11e4-b641-080027ea3a6e', $options);
Retrieve all data from your templates.
$response = $client->getTemplates();
####Get all certified emails
response = client->getEmails()
####Get last 50 emails
response = client->getEmails(50)
####Navigate through all emails in blocks of 50 results
response = client->getEmails(50, 50)
Count all certified emails
response = client->countEmails()
Get a single email
client->getEmail('EMAIL_ID')
Create a new certified email.
response = client.createEmail(
['demo.pdf', 'receipt.pdf'],
['email' => 'john.doe@signaturit.com', 'name' => 'Mr John'],
'Php subject',
'Php body',
[]
)
Get the audit trail document of an email request.
response = client.downloadEmailAuditTrail('EMAIL_ID','CERTIFICATE_ID')
response = client->getSms()
Count all certified sms
response = client->countSms()
Get a single sms
client->getSms('SMS_ID')
Create a new certified sms.
response = client.createSms(
[],
['phone' => '34123456', 'name' => 'Mr John'],
'Php body',
[]
)
Get the audit trail document of an sms request.
response = client.downloadSmsAuditTrail('SMS_ID','CERTIFICATE_ID')
Get all account users
$response = $client->getUsers();
Get all account seats
$response = $client->getSeats();
Get a single user
$response = $client->getUser('USER_ID');
Invite user to join the team
$response = $client->inviteUser('bob.soap@signaturit.com', 'admin');
Change role for user
$response = $client->changeUserRole('USER_ID', 'member');
Remove user from the team
$response = $client->removeUser('USER_ID');
Remove seat from the team
$response = $client->removeSeat('SEAT_ID');
Get all account groups
$response = $client->getGroups();
Get a single group
$response = $client->getGroup('GROUP_ID');
Create a new group
$response = $client->createGroup('test_node');
Update group name
$response = $client->updateGroup('GROUP_ID', 'new_name');
Delete a group
$response = $client->deleteGroup('GROUP_ID');
Add a manager to a group
$response = $client->addManagerToGroup('GROUP_ID', 'USER_ID');
Add a member to a group
$response = $client->addMemberToGroup('GROUP_ID', 'USER_ID');
Remove a manager from group
$response = $client->removeManagerFromGroup('GROUP_ID', 'USER_ID');
Remove a member from group
$response = $client->removeMemberFromGroup('GROUP_ID', 'USER_ID');
Get all contacts
$response = $client->getContacts();
Get a single contact
$response = $client->getContact('CONTACT_ID');
Create a new contact
$response = $client->createContact('email@signaturit.com', 'name');
Update contact
$response = $client->updateContact('CONTACT_ID', 'new_email@signaturit.com', 'name1');
Delete a contact
$response = $client->deleteContact('CONTACT_ID');
Get all subscriptions
$response = $client->getSubscriptions();
Get a single subscription
$response = $client->getSubscription('SUBSCRIPTION_ID');
Create a new subscription
$response = $client->createSubscription('http://httpbin.org/post', 'email_processed');
Update contact
$response = $client->updateSubscription('SUBSCRIPTION_ID', null, 'email_delivered');
Delete a subscription
$response = $client->deleteSubscription('SUBSCRIPTION_ID');