Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Deepika G.1
9 years agoNew member | Level 1
I want to implement a funtionallity that user can login to their dropbox account by my web application and i want to show all folder of dropbox on my web application screen . How can i do this .
I want to implement a functionality that user can login to their dropbox account by my web application and i want to show all folder of dropbox on my web application screen . How can i do this .
15 Replies
Replies have been turned off for this discussion
- Deepika G.19 years agoNew member | Level 1
Now am using
CURLOPT_HTTPHEADER => array( 'Authorization: Bearer ' . $key, 'Dropbox-API-Arg:' . $data),
but it giving me below error.
Error in call to API function "files/download": You provided a non-empty HTTP "Content-Type" header ("application/x-www-form-urlencoded"). This API function requires that the header be missing or empty.
Can you please tell me what parameter should i pass to get response
- Steve M.9 years ago
Dropbox Staff
Sorry, I think I steered you wrong. Your Content-Type header was fine... here's code that's working for me:
$accessToken = '<REDACTED>';
$ch = curl_init();
$data = json_encode(array('path' => '/test.txt'));
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://content.dropboxapi.com/2/files/download',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => array("Content-Type:", "Authorization: Bearer $accessToken", "Dropbox-API-Arg: $data"),
));
$output = curl_exec($ch);
curl_close($ch);
echo $output; - Steve M.9 years ago
Dropbox Staff
An alternative (drop both CURLOPT_POST and the Content-Type header):
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://content.dropboxapi.com/2/files/download',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array("Authorization: Bearer $accessToken", "Dropbox-API-Arg: $data"),
)); - Deepika G.19 years agoNew member | Level 1
Now am using above code. Error is removed now but its not returning any response.
- Greg-DB9 years ago
Dropbox Community Moderator
If you're not getting an error, the response should be the file content. Is it possible the file is 0 bytes? You can check on the Dropbox web site.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!