dropboxdropbox-apicore-api

Get access token from dropbox api wihout user interaction


I read the Dropbox core API authentication and in the documentation it is written that the user must open a link, copy the authorization code, paste it and then the API will change it to access token. Is there a way to avoid all that? for example when opening the Dropbox chooser and authenticating using email and password how do can I get access token as a result? any updates on that?

Note : The purpose is to get the access token as a result after the user signs in using Dropbox chooser API.


Solution

  • Of course user interaction is required, but all the user needs to do is log in (if not already logged in) and click an "Allow" button to grant your app access. You might want to take a look at sample web apps (and not command-line examples). E.g. give https://mdwebhook.herokuapp.com/ a try and take a look at the code.

    Note that the Chooser won't give you an access token; it only gives you access to the specific file chosen by the user. To get an access token, you'll need to take the user through the OAuth flow. Perhaps Dropbox's OAuth guide will help.