You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

oen124's avatar
oen124
New member | Level 2
4 years ago

How to get a refresh token

I have an app written in Python to upload files which I set up in the www.dropbox.com/developers/apps section. I generated an access token and chose the expiration to be "No Expiration". When I run i...
  • Greg-DB's avatar
    4 years ago

    If you're using a long-lived access token (e.g., as you described, by setting the "Access token expiration" setting in the App Console to "No Expiration" and then using the "Generate" button to generate an access token for your account and app), then you don't also need a refresh token. (Refresh tokens are for use with short-lived access tokens, not long-lived access tokens. Please note that long-lived access tokens are considered deprecated though. )

     

    The particular error you're getting here is indicating that you did not pass a non-empty value for either the oauth2_access_token parameter (for a long-lived or short-lived access token) or oauth2_refresh_token (for a refresh token) when building your client. At least one of these parameters is needed to make API calls.

     

    How are you passing your access token in and constructing that Dropbox object? It sounds like something about your environment isn't successfully retrieving your access token when running from the cron job.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,893 PostsLatest Activity: 5 hours ago
327 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!