/*** Mandatory data ***/ // Post URL (Get this value from the Integration Help menu of this plugin) $postURL = "http://www.example.com/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php"; // The Secret key (Get this value from the settings menu of this plugin) $secretKey = "4bc67180656782.45045137"; //The source file URL (The file that you want to stamp) $fileURL = "http://www.example.com/wp-content/uploads/test-ebook.pdf"; /*** Optional Data ***/ //Customers Name $customerName = "John Doe"; //Customer Email address $customerEmail = "john.doe@gmail.com"; //Customer's Address $customerAddress = "123 Some Street, San Jose, CA - 95130, U.S.A."; // prepare the data $data = array (); $data['secret_key'] = $secretKey; $data['source_file'] = $fileURL; $data['customer_name'] = $customerName; $data['customer_email'] = $customerEmail; $data['customer_address'] = $customerAddress; // send data to post URL $ch = curl_init ($postURL); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $returnValue = curl_exec ($ch); // Process the return values list ($status, $value) = explode ('\n', $returnValue); if(empty($value)){ list ($status, $value) = explode (' ', $returnValue); } $status = trim($status); $value = trim($value); if(strpos($status,"Success!") !== false) { $file_url = trim($value); echo "The URL of the stamped file is: ".$file_url; } else { echo "An error occured while trying to stamp the file! Error details: ".$value; }