Forum Discussion

almazultra's avatar
almazultra
New member | Level 1
23 days ago

Unable to refresh access token without refresh token and app key

Hello! I created an application in python, but every day the access token is updated and the error Unable to refresh access token without refresh token and app key appears. How to make a long-term access token?

  • DB-Des's avatar
    DB-Des
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi almazultra,

    As Rich mentioned, the option for long-lived or long-term access token is no longer available.

    Apps can get long-term access by requesting "offline" access though, 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. Refresh tokens do not expire automatically and can be used repeatedly. 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.

    When using the Python SDK, there is no need to implement all of this logic yourself. You can find OAuth flow examples specific to the Python SDK here.

    If you continue encountering errors, please reply with: 

    • the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
    • the full text of any error or unexpected output
  • Rich's avatar
    Rich
    Icon for Super User II rankSuper User II
    almazultra wrote:

    I created an application in python, but every day the access token is updated and the error Unable to refresh access token without refresh token and app key appears. How to make a long-term access token?

    Long-lived (or permanent) tokens were deprecated back in 2021 and can no longer be created. You now use refresh tokens to retrieve new short-lived tokens as needed. See here for more information:

    • https://www.dropboxforum.com/discussions/101000014/we-need-long-live-access-token/629228/replies/629344#M29066

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,941 PostsLatest Activity: 2 hours ago
350 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!