1. Go to this page and download the library: Download blueink/blueink-client-php 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/ */
blueink / blueink-client-php example snippets
use Blueink\ClientSDK\Client;
// Provide the key directly...
$client = new Client('<YOUR_PRIVATE_API_KEY>');
// ...or set BLUEINK_PRIVATE_API_KEY in the environment and call:
// $client = new Client();
$response = $client->bundles->list();
foreach ($response->data as $bundle) {
echo $bundle['id'] . "\n";
}
use Blueink\ClientSDK\BundleHelper;
$bundle = new BundleHelper([
'label' => 'A Test Bundle',
'email_subject' => 'Please sign this test bundle',
'is_test' => true,
]);
// Add signers (each t build time), file path
// (streamed as multipart at request time), or raw HTML.
$doc_key = $bundle->addDocumentByURL('https://example.com/contract.pdf');
// $bundle->addDocumentByPath('/tmp/nda.pdf');
// $bundle->addDocumentByFile('/tmp/large.pdf', 'application/pdf');
// $bundle->addDocumentByHTML('<h1>Statement of Work</h1>...');
// Add a field at fixed coordinates, scoped to a list of editor packet keys.
$bundle->addField(
document_key: $doc_key,
x: 1, y: 15, w: 60, h: 6, p: 1,
kind: 'inp',
editors: [$signer1, $signer2],
label: 'Full name',
);
// Or let the API auto-place a field by searching the document text.
$bundle->addAutoPlacement(
document_key: $doc_key,
kind: 'sig',
search: 'Signature:',
w: 30, h: 6,
offset_x: 8, offset_y: -1,
editors: [$signer1],
);
$response = $client->bundles->createFromBundleHelper($bundle);