Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Hrvoje A.'s avatar
Hrvoje A.
New member | Level 1
10 years ago

Logging to API (for folder/file listing/downloading) with least number of credentials?

I am trying to make an option for every user, to log to his Dropbox via my website (API), and there his files will be listed. After that he can do other stuff which are not important for this question. So I need the smallest number of user's dbx login info. One or two would be perfect. Thanks.

6 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    I'm not sure I understand your question. Can you clarify what you mean by "the smallest number of user's dbx login info"?

    Dropbox API apps should send users through an OAuth flow to authorize the app to access their account (or not) and receive an access token back. The API app itself should never handle the user's Dropbox actual credentials.

  • Hrvoje A.'s avatar
    Hrvoje A.
    New member | Level 1
    10 years ago

    Grek K. - but how he chooses the app? That means he needs to enter app name? his login data (mail and password)? I need the option where he will enter at the most two of those.

  • Hrvoje A.'s avatar
    Hrvoje A.
    New member | Level 1
    10 years ago

    And also, is there a way to list all dropbox files without using Dropbox apps?

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

    Thanks for elaborating. The end users of your app don't need to enter any app name or anything to identify your app. When a user uses your app, e.g., by browsing to your app's web site, your app has its own app key already, and directs the user through an OAuth flow. This sends them to Dropbox to authorize your app. At that point, they will log in to Dropbox, if they aren't already logged in, however they normally login, e.g., using their username and password. The user is then sent back to your app. This way, your app never needs to handle user credentials. You can find more information on how this works in the OAuth guide here:

    https://www.dropbox.com/developers/reference/oauthguide

    We recommend using one of the official SDKs, if possible, as they'll do most of the work for you:

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

    Once a user is linked to your app, you can use the /delta endpoint to get the full list of files and folders in the user's Dropbox account:

    https://www.dropbox.com/developers/core/docs#delta
    https://blogs.dropbox.com/developers/2013/12/efficiently-enumerating-dropbox-with-delta/

  • Hrvoje A.'s avatar
    Hrvoje A.
    New member | Level 1
    10 years ago

    Greg thanks for thoroughness. That also helped a lot, but I wanted to know (It was my mistake if I forgot to emphasize that :/) the whole last question but regarding "Every user on my website logs in to his own dropbox folder" and not on one "static/fixed" Dropbox (eg. mine). So what would be the least he needs to type in to login to his app through my website, and to retrieve his folder. (yes I am using PHP SDK, but I'm kinda new..botj in PHP and APIs )

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

    That is the normal scenario, that is, every user goes through the OAuth flow to authorize the app to connect to their own Dropbox account (and not just one static/fixed account).

    I recommend trying out the web-file-browser sample app included with the PHP SDK to see how the flow works. It will look the same for each user, but each user will log into their own Dropbox account.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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

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!