cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox 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: 

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

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

Aravindb
Explorer | Level 3

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 5

Greg-DB
Dropbox Staff

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
Explorer | Level 3

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
Dropbox Staff

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
New member | Level 2

Hi.

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

Thanks!

Greg-DB
Dropbox Staff

@Testman It sounds like you're referring to using the official Dropbox API v2 .NET SDK. You can find information on how to implement the OAuth 2 app authorization flow to get an access token using that here:

https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_DropboxOAuth2Helper.htm

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Testman New member | Level 2
  • User avatar
    Aravindb Explorer | Level 3
What do Dropbox user levels mean?