cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CURL access has recently stopped working

CURL access has recently stopped working

RockwoodON
New member | Level 2
I have been accessing dropbox files using CURL with an access token via the follwing url:
 
 
Recently CURL calls are timing out with 0 bytes returned. The formt of my call is as shown below. Has something changed that would cause this to fail? And ideas?
 
Thanks,
Chris
 
 
CODE (PHP):
-----------------------------------------------------------------------------------------
 
$header_array = array(
'Authorization: Bearer ' . $accessToken,
'Content-Type:',
'Dropbox-API-Arg: {"path":"' . $fileid . '"}'
);
 
$ch = curl_init();
 
curl_setopt($ch, CURLOPT_CAINFO, "cacert.pem");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);
curl_setopt($ch, CURLOPT_FILE, $out_fp);
 
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); 
curl_setopt($ch, CURLOPT_TIMEOUT, 20); //timeout in seconds
 
$output = curl_exec($ch);
4 Replies 4

Greg-DB
Dropbox Staff

Can you enable verbose mode (that should be "CURLOPT_VERBOSE") and share the full output so we can take a look? Be sure to redact the access token though. Thanks!

Greg-DB
Dropbox Staff

By the way, it appears you are disabling verification, which is a security issue; see https://curl.se/libcurl/c/CURLOPT_SSL_VERIFYHOST.html and https://curl.se/libcurl/c/CURLOPT_SSL_VERIFYPEER.html .

RockwoodON
New member | Level 2

Thanks for your quick reply. I enabled the VERBOSE option, but did not get a response. The CURL error is:

"Operation timed out after 20001 milliseconds with 0 bytes received"

On a more positive note, I can confirm that posting/uploading a file to Dropbox is working, so it is something about the download process.

Greg-DB
Dropbox Staff

Is that the entirety of the output you get from curl? There should be more output in verbose mode. For example, when I try this code with verbose mode, I get a bunch of output starting with "* Trying"... which then shows the IP address of the server it connected to, and so on. Can you share the rest of that? It should be useful context for debugging this. Please be sure to redact the access token though. Thanks!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    RockwoodON New member | Level 2
What do Dropbox user levels mean?