Upload and Manual Send API Demo
  • API Demo Form
  • SERVER CODE
Fill out the form to create a document. *Mandatory fields

Party 1 Details:

Party 2 Details:

Uploads Documents:

PHP CURL

Retrieve Access Token

                                                                               
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.esigngenie.com/esign/api/oauth2/access_token",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&scope=read-write",
  CURLOPT_HTTPHEADER => array(
	"cache-control: no-cache",
	"content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
									

Send Signing PDF

                                        
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.esigngenie.com/esign/api/folders/createfolder",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => '
-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file1.pdf"
Content-Type: application/octet-stream

'.file_get_contents('/path/to/your/file1').'
-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="file2.pdf"
Content-Type: application/octet-stream

'.file_get_contents('/path/to/your/file2').'
-----011000010111000001101001
 Content-Disposition: form-data; name="data"

{"folderName":"Sample Documents","processTextTags":true,"signInSequence":false,"sendNow":false,"createEmbeddedSendingSession":true,"fixRecipientParties":true,"fixDocuments":true,"sendSuccessUrl":"YOUR_PAGE_TO_REDIRECT_USER_FROM_EMBEDDED_SESSION","sendErrorUrl":"YOUR_PAGE_TO_REDIRECT_USER_FROM_EMBEDDED_SESSION","createEmbeddedSigningSession":false,"allowSendNowAndEmbeddedSigningSession":false,"emailIdOfEmbeddedSigner":"EMAIL_ID_OF_ONE_OF_THE_RECIPIENTS","signSuccessUrl":"YOUR_PAGE_TO_REDIRECT_USER_FROM_EMBEDDED_SESSION","signDeclineUrl":"YOUR_PAGE_TO_REDIRECT_USER_FROM_EMBEDDED_SESSION","signLaterUrl":"YOUR_PAGE_TO_REDIRECT_USER_FROM_EMBEDDED_SESSION","signErrorUrl":"YOUR_PAGE_TO_REDIRECT_USER_FROM_EMBEDDED_SESSION","parties":[{"firstName":"FIRST_NAME_OF_RECIPIENT_PARTY","lastName":"LAST_NAME_OF_RECIPIENT_PARTY","emailId":"EMAIL_ID_OF_RECIPIENT_PARTY","permission":"FILL_FIELDS_AND_SIGN","workflowSequence":1,"sequence":1}]}
-----011000010111000001101001--',

  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer YOUR_ACCESS_TOKEN",
    "cache-control: no-cache",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}