Search code examples
dropboxdropbox-api

Upload to Dropxbox without redirect to Web


We have a background .Net service that should upload files to our account to Dropbox. OAuth2 is not acceptable since there is no way to handle redirect to Dropbox login page and callback.

enter image description here

There is a way to generate token in Dropbox App Console. It works, but token is expiring every day.

Is there any way to get permanent token? Or any other way to obtain token compeltely from code without Dropbox login page.


Solution

  • It is not possible to fully automate the process of retrieving an access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.

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