Forum Discussion

sauditracking's avatar
sauditracking
Explorer | Level 3
7 years ago

Dropbox access token keep revoke after some time

I have a personal account on dropbox for saving some data automatically through python script, the account working smoothly with the script except one issue, the access token keep changing every 2 days or like that (my script working daily automatically), because of this issue I have to every some time generate new access token and replace it with the one in script still I didn't find any reason for ,
I have the following python script to deal with dropbox :

access_token = 'bMDDDDggkS5jzV1_diCIGK6bZCzUp'
file_from = file_path
file_to = to_path
dbx = dropbox.Dropbox(access_token)
f = open(file_from, 'rb')
dbx.files_upload(f.read(), file_to)

as I said the script working fine, but how could I keep the access token without revoke ?

BTW I know the access token not get expired, why this happen ?
steps I did :

- create an app folder and make limited access for script
- only 1 user access to the dropbox account
- user linked

3 Replies

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

    [Cross-linking for reference: https://stackoverflow.com/questions/58909301/dropbox-access-token-keep-revoke-after-some-time ]

    By default, Dropbox API access tokens for your app(s) don't expire by themselves, but there a number of different ways that a Dropbox API access token can become invalid, including:
    If the Dropbox API isn't behaving as expected, feel free to contact support by opening an API ticket.
  • sauditracking's avatar
    sauditracking
    Explorer | Level 3
    7 years ago

    Thx for your good reply 

    as you mention the access token couldn't revoke by it self, and there are some reasons, here as i'm the admin & account owner & only user use the account I will reply with actions token before based on your mention : 

    the Connected apps page : connected
    the Security checkup page : connected
    any client with the access token can revoke : there is no clients , there is one user, it's me 
    can revoke access tokens found publicly posted on GitHub : it's not uploaded to github
    if the app uses the "app folder" permission, the access token can effectively be disabled by deleting the app folder : app folder still exist
    the app can be disabled : app still enabled 
    the account that owns the app can be disabled : account still enabled
    the connected account can be disabled : connected account still enabled 
    as you mention the access token wouldn't expire , may you explan with the wrong thing I did ? 

    BTW, I change the access token ysterday, it was working fine yesterday , today it's got revoked ! 

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

    I can't say offhand what may have happened, but if the API isn't working for you, please feel free to open an API ticket with details from the relevant 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!