Get PDF with curl returns nothing
Wednesday, September 28, 2016 at 11:36amI'm trying to get the pdf file via php using curl but I get nothing returned.
When I do the same in Postman I get the PDF file.
Here is my php code
$headers = array('Content-Type: application/json', 'Authorization: Basic '.$ApiKey, 'Accept: application/pdf', 'Connection: Keep-Alive');
$url = 'https://apps.e-signlive.com/api' . '/packages/'.$packageId.'/documents/'.$documentid.'/pdf';
$ch = curl_init();
$timeout = 60;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
echo $data;
Can someone see something I missed?
Thanks
Reply to: Get PDF with curl returns nothing
Wednesday, September 28, 2016 at 01:52pm$data = curl_exec($ch); $err = curl_error($ch); curl_close($ch); if ($err) { print_r($err); } else { echo $data; };Let me know.Reply to: Get PDF with curl returns nothing
Thursday, September 29, 2016 at 03:47amReply to: Get PDF with curl returns nothing
Thursday, September 29, 2016 at 09:07am