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
- Richard P.9 years ago
Super User alumni
Start with the documentation and sample apps.
- Deepika G.19 years agoNew member | Level 1
Thanks for reply . But i am using api funtion already to get files and folder by api functions of a particular account by api acess token. But now the issue is that i want to get all the files and folder of login user( not from a particular account on which app is created ) Is their any funtionallity that i can get this by user login id or some thing else
- Richard P.9 years ago
Super User alumni
You need to get them to link your app to their Dropbox account, and then use the token that process gives you.
As I said, read the documentation and the example apps.
- Deepika G.19 years agoNew member | Level 1
i am using oAuth1 to login a user. Now after login i am getting access token of a user. But when i am trying to fetch all files and folders using v2 version by https://api.dropboxapi.com/2/files/list_folder using this access_token its shows a error . my response after login is
Array ( [oauth_token_secret] => <redacted> [oauth_token] => 0z8UB9b6JHyfUqBc [access_token_secret] => <redacted> [access_token] => 2oez4dz7r9w4xmlf )
Also can i use oauth 1 for v2 version - Greg-DB9 years ago
Dropbox Community Moderator
API v2 only supports OAuth 2, not OAuth 1, so you won't be able to use an OAuth 1 access token with OAuth 2.
The OAuth 2 endpoints are documented here:
https://www.dropbox.com/developers/documentation/http/documentation#authorization
(If you need to, you can use existing OAuth 1 tokens to get OAuth 2 tokens using /1/oauth2/token_from_oauth1.)
- Deepika G.19 years agoNew member | Level 1
can you please tell me the parameter for https://api.dropboxapi.com/1/oauth2/token_from_oauth1 url . how can i pass the above access token to this to convert oauth1 access token to oauth2 access token . i am using below code
$ch = curl_init();
$postData = array(access_token => "32uqesryirha3ubf");
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://api.dropboxapi.com/1/oauth2/token_from_oauth1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($postData),
CURLOPT_HTTPHEADER => array('Content-Type:application/json'),
CURLOPT_SSL_VERIFYPEER => false
));
echo $output = curl_exec($ch);
curl_close($ch); - Greg-DB9 years ago
Dropbox Community Moderator
That endpoint requires OAuth 1 signing. For example, see step 4 in this blog post:
https://blogs.dropbox.com/developers/2012/07/using-oauth-1-0-with-the-plaintext-signature-method/
- Deepika G.19 years agoNew member | Level 1
yuppy thanks Gregory .Its working :)
- Deepika G.19 years agoNew member | Level 1
Hey Gregory
I have a query regarding download api. I am trying to download files by curl thorugh api.https://content.dropboxapi.com/2/files/download. But when am trying to send a curl req by sending below code it return nothing.
$ch = curl_init();
$postData = array('path' => $folder);
$data = json_encode($postData);
curl_setopt_array($ch, array(
CURLOPT_URL => 'https://content.dropboxapi.com/2/files/download',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array('Content-Type: ', 'Authorization: Bearer ' . $key, 'Dropbox-API-Arg:' . $data),
CURLOPT_SSL_VERIFYPEER => false
));
echo $output = curl_exec($ch);
curl_close($ch);where $folder = /deepikag4@chetu.com/newTask.xlsx
Can you please help me out
- Steve M.9 years ago
Dropbox Staff
What do you mean by "it returns nothing"?
This part looks wrong:
'Content-Type: ', 'Authorization: Bearer ' . $key
But in general, the API returns pretty clear error messages that tell you what is wrong with a request, so make sure you're able to read the HTTP response bodies even when an error occurs.
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!