Dino Anastos
Dino Anastos

Reputation: 139

GET Request Pandadoc API PHP

Is there anything wrong with the following CURL GET request I am making?

As per https://developers.pandadoc.com

I successfully uploaded a pdf as the JSON response was

{"name": "PSA", "uuid": "b7dwPya77AURKB7Y8ZFnDh", "status": "document.uploaded", "date_created": "2015-03-07T14:42:59.863517Z", "date_modified": "2015-03-07T14:42:59.863517Z"}   

but when I use the following code to retrieve document status
the CURL request times out after 300 seconds resulting in nothing

echo $ret = curl_exec($ch);
$response = json_decode($ret, true);

$uuid = $response['uuid'];

$url = "https://api.pandadoc.com/public/v1/documents/$uuid";
$headr = array();
$headr[] = 'Content-length: 0';
$headr[] = 'Content-Type: application/json;charset=UTF-8';
$headr[] = "Authorization: Bearer $ACCESS_TOKEN";

$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER,$headr);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_STDERR, $fp);

$ret = curl_exec($ch);

$response = json_decode($ret, true);

Upvotes: 2

Views: 341

Answers (0)

Related Questions