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

playstationmobile's avatar
playstationmobile
Explorer | Level 4
6 months ago

How can I simply upload files via API without manually generating an access token?

* I have the app secret and key
* I had some script working but the access token is short lived, as I used the one I generated from the console
* I cant find any API info on how to generate an access token? All I see is stuff about where you generate some code and then you have to open a webpage and enter the code.......how is my planned cron job going to run if I have to involve opening a browser and entering an access code etc etc

  • Hi playstationmobile,

    As seems, it passed long time since you last used your application console to generate long lived access token. Years have passed since this feature has been deprecated and already dropped. If you have some long lived access token, it'll work still, but all new issued access token (it doesn't matter how exactly issued) are mandatory short lived (they have few hours live - typically 4 hours or so).

    You can still have long term access (in similar way as has been before), but you need refresh token (one more in addition to access token). The refresh token is long lived and doesn't expire itself. For a possible way (one of number of options) to receive and use refresh token, you may take a look here. Just implement the steps in your application' workflow and all should look the same as before. 😉 You will need to implement in the application the last (repetitive) step only, where new access token will comes up as result of refresh token usage. If you're using some of official Dropbox SDKs, the only thing you need is proper client object initialization with everything needed (including refresh token, app key, and optionally app secret - optional when you used PKCE OAuth flow otherwise mandatory). Dropbox SDK has implemented the last repetitive step already, so you don't need to change anything more; just continue using your code as before.

    Hope this gives direction.

  • Hi playstationmobile,

    As seems, it passed long time since you last used your application console to generate long lived access token. Years have passed since this feature has been deprecated and already dropped. If you have some long lived access token, it'll work still, but all new issued access token (it doesn't matter how exactly issued) are mandatory short lived (they have few hours live - typically 4 hours or so).

    You can still have long term access (in similar way as has been before), but you need refresh token (one more in addition to access token). The refresh token is long lived and doesn't expire itself. For a possible way (one of number of options) to receive and use refresh token, you may take a look here. Just implement the steps in your application' workflow and all should look the same as before. 😉 You will need to implement in the application the last (repetitive) step only, where new access token will comes up as result of refresh token usage. If you're using some of official Dropbox SDKs, the only thing you need is proper client object initialization with everything needed (including refresh token, app key, and optionally app secret - optional when you used PKCE OAuth flow otherwise mandatory). Dropbox SDK has implemented the last repetitive step already, so you don't need to change anything more; just continue using your code as before.

    Hope this gives direction.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,885 PostsLatest Activity: 14 hours ago
326 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!