cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

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 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 .

Deepika G.1
New member | Level 1

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 15

Richard P.
Super User alumni

www.dropbox.com/developers

Start with the documentation and sample apps.

Deepika G.1
New 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.
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.1
New 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-DB
Dropbox Staff

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.1
New 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-DB
Dropbox Staff

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.1
New member | Level 1

yuppy thanks Gregory .Its working 🙂

Deepika G.1
New 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

 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Deepika G.1 New member | Level 1
  • User avatar
    Steve M. Dropbox Staff
What do Dropbox user levels mean?