PHP code example of clicksign / clicksign-php

1. Go to this page and download the library: Download clicksign/clicksign-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/ */

    

clicksign / clicksign-php example snippets


$docs = $client->documents->all();

foreach ($docs as $d)
{
    print $d->document->key;
}

$client->documents->upload("/Users/clicksign/Documents/Filename.pdf");

$signers = array(array("email" => "[email protected]", "act" => "sign"), array("email" => "[email protected]", "act" => "witness"));
$message = "Please sign this document.";
$skipEmail = false;

$options = array("signers" => $signers, "message" => $message, "skipEmail" => $skipEmail);

$client->documents->upload("/Users/clicksign/Documents/Filename.pdf", $options);

$doc = $client->documents->find("DOCUMENT_KEY");

print $doc->document->original_name;

$file = $client->documents->download("DOCUMENT_KEY");

$signers[0]["email"] = "[email protected]";
$signers[0]["act"] = "sign";

$signers[1]["email"] = "[email protected]";
$signers[1]["act"] = "witness";

$client->documents->createList("DOCUMENT_KEY", $signers);

$signers = array(array("email" => "[email protected]", "act" => "sign"), array("email" => "[email protected]", "act" => "witness"));
$client->documents->createList("DOCUMENT_KEY", $signers);

$client->documents->createList("DOCUMENT_KEY", $signers, "Hi guys, please sign this document.", false);

$email = "[email protected]";
$message = "This is a reminder. Please sign the document";
$client->documents->resend("DOCUMENT_KEY", $email, $message);

$client->documents->cancel("DOCUMENT_KEY");

$hook = $client->hooks->create("DOCUMENT_KEY", "http://example.com/clicksign/callback.php");

$hooks = $client->hooks->all("DOCUMENT_KEY");

$client->hooks->delete("DOCUMENT_KEY", 2163);

$documentKeys = array("DOCUMENT_KEY_1", "DOCUMENT_KEY_2", "DOCUMENT_KEY_3");
$batch = $client->batches->create($documentKeys);

$batches = $client->batches->all();

$client->batches->delete("DOCUMENT_BATCH_KEY");
javascript
{
    "gn/clicksign-php": "*"
    }
}