We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

Aravindb's avatar
Aravindb
Explorer | Level 3
7 years ago

How to use username and password for upload files from web application using DropBox api

Hello,
     How to use username and password for upload files from web application using DropBox api instead of using access token,App key and App secret.

Pls reply asap

Regards,
Aravind

5 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    The Dropbox API does not support uploading using the username and password. 

    Your app should implement the OAuth flow so that each user can choose to connect their Dropbox account to your app. This way, your users don't need to register their own apps, and your app never handles their usernames/passwords. You can find information on how the OAuth flow works here:

    https://www.dropbox.com/developers/reference/oauth-guide

    You can find the documentation for it here:

    https://www.dropbox.com/developers/documentation/http/documentation#authorization 

    Once your app has an access token for a user, it can use it to upload files, e.g., using /2/files/upload:

    https://www.dropbox.com/developers/documentation/http/documentation#files-upload

    Those are links to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible:

    https://www.dropbox.com/developers/documentation

    Those have corresponding native methods for the HTTPS endpoints. They also do most of the work of implementing the OAuth flow for you.

  • Aravindb's avatar
    Aravindb
    Explorer | Level 3
    7 years ago

    Hi , Thanks for reply, 
        I want some more explanitaion, i have 1000 more user, each user have their own dropbox account, 
      I have web application in that each user enter their username and password of dropbox and in file broser button , they browse file and click upload.
     Once submit file insert into their own dropbox which what dropbox username and password they typed.

    For this how i get each user access tokes or app ID or screate key, we know only username and password only, but i can upload file using access token.

    If only upload file with access token, then how to get access token using username and password ? or how to get api key and screat key using username and password

    so how this will do in web application,
     interface screenshot :http://prntscr.com/l4b4w0

    Regards,
    Aravind

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    Users should not be entering their Dropbox username and password into your app, and your app should never prompt them to do so.

    Your app must implement the OAuth app authorization flow so that it can get an access token for each user, without ever seeing their Dropbox username and password. The app can use the resulting access token to make API calls, e.g., to upload files, etc.

    Please refer to the OAuth guide and documentation for more information on how to do this. We also recommend using one of the official SDKs, if possible, as they will handle most of the work for you.

    There's a basic example of this flow implemented in the API v2 Explorer demo, for instance.

  • Testman's avatar
    Testman
    New member | Level 2
    6 years ago

    Hi.

    How can i get an oauth2 token in c# to call the new DropBoxClient with the token?

    Thanks!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 7 hours ago
411 Following

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

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!