Get Signed Document in HelloSign:
In my previous blog, you can do a digital signature. But at that time when we download that signed document, sometimes sign was not implemented on that document.
This is done because, Hellosign API takes some time to implement sign on that document.
For download a signed document:
For this firstly you have to set a callback URL.
In my case i am using test.php.
Write down in test.php without underline
Hello API Event Received
And after sending sign request when to redirect to another page.
Then write this code on this another page.
<?php
try {
require_once 'vendor/autoload.php';
$client = new HelloSign\Client('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$account = new HelloSign\Account;
$signature = Yii::app()->session['signature_req_id'];
$dest_file_path = 'PATH_OF_FILE_WHERE_TO_SAVE_WITH_NAME';
$account->setCallbackUrl'PATH_OF_test.php');
$resp = $client->updateAccount($account);
$response = $client->getSignatureRequest($signature);
if ($response->isComplete()) {
$client->getFiles($signature, $dest_file_path, HelloSign\SignatureRequest::FILE_TYPE_PDF);
} else {
execCommand(); //call this function
}
} catch (Exception $e) {
echo 'Error Occured ' . $e;
}
public function execCommand()
{
require_once 'vendor/autoload.php';
$client = new HelloSign\Client('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$signature = Yii::app()->session['signature_req_id'];
$dest_file_path = 'PATH_OF_FILE_WHERE_TO_SAVE_WITH_NAME';
$response = $client->getSignatureRequest($signature);
if ($response->isComplete()) {
$client->getFiles($signature, $dest_file_path, HelloSign\SignatureRequest::FILE_TYPE_PDF);
return true;
} else {
$this->execCommand(); //recursion function
}
}
?>
Thanks
In my previous blog, you can do a digital signature. But at that time when we download that signed document, sometimes sign was not implemented on that document.
This is done because, Hellosign API takes some time to implement sign on that document.
For download a signed document:
For this firstly you have to set a callback URL.
In my case i am using test.php.
Write down in test.php without underline
Hello API Event Received
And after sending sign request when to redirect to another page.
Then write this code on this another page.
<?php
try {
require_once 'vendor/autoload.php';
$client = new HelloSign\Client('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$account = new HelloSign\Account;
$signature = Yii::app()->session['signature_req_id'];
$dest_file_path = 'PATH_OF_FILE_WHERE_TO_SAVE_WITH_NAME';
$account->setCallbackUrl'PATH_OF_test.php');
$resp = $client->updateAccount($account);
$response = $client->getSignatureRequest($signature);
if ($response->isComplete()) {
$client->getFiles($signature, $dest_file_path, HelloSign\SignatureRequest::FILE_TYPE_PDF);
} else {
execCommand(); //call this function
}
} catch (Exception $e) {
echo 'Error Occured ' . $e;
}
public function execCommand()
{
require_once 'vendor/autoload.php';
$client = new HelloSign\Client('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$signature = Yii::app()->session['signature_req_id'];
$dest_file_path = 'PATH_OF_FILE_WHERE_TO_SAVE_WITH_NAME';
$response = $client->getSignatureRequest($signature);
if ($response->isComplete()) {
$client->getFiles($signature, $dest_file_path, HelloSign\SignatureRequest::FILE_TYPE_PDF);
return true;
} else {
$this->execCommand(); //recursion function
}
}
?>
Thanks