Take Your Search Game to the Next Level with Dropbox Dash  🚀✨ Curious how it works? Ask us here! 

Forum Discussion

PBrackenSyn's avatar
PBrackenSyn
New member | Level 1
5 months ago
Solved

Are you able to login to the API through code only without a browser?

I am trying write a backup process that will run which obviously won't have any user interaction. It seems like the API only supports redirecting to a login page to authorize? Is this true or is there some other way to login?

  • That's correct, the user needs to authorize the app to access their account in their web browser. This only needs to be done once per account though. For long-term unattended access, the app should request "offline" access, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    That's correct, the user needs to authorize the app to access their account in their web browser. This only needs to be done once per account though. For long-term unattended access, the app should request "offline" access, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation. There's a basic outline of processing this flow in this blog post which may serve as a useful example.

    • PBrackenSyn's avatar
      PBrackenSyn
      New member | Level 1

      So theoretically I could just login myself, capture the auth code, use postman or something to obtain the refresh token and then hard code that into my app and it should work?

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Yes, but note that that would only be for your own account. If this is only for your own use, that's fine, but you shouldn't distribute your refresh token to any other users.

About Dropbox API Support & Feedback

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

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!