Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
I am for the first time trying to create a APP that will upload a backup file into dropbox and although I managed to get it to work with the code example provided here https://www.dropbox.com/developers-v1/core/start/java the generated code only last for one run, next time it does not work anymore and I need to generate a new code.
How do I get my app (JAVA) to only request approval for my APP once and then be able to always run the app and upload my backup file?
Many Thanks
It sounds like you're referring to the "authorization code", stored as `code` in the tutorial. The authorization code is temporary and can only be used once. The "access token", stored as `accessToken` in the tutorial, doesn't expire, so you can store and re-use that. When the user comes back, you can just retrieve that access token instead of sending them to the authorize URL again.
Many thanks Gregory I had failed to see that, if accessToken is valid I don't need to to run the "authorization code" and that the "authorization code" creates accessToken.
DbxAuthFinish authFinish = webAuth.finish(code);
String accessToken = authFinish.accessToken;
Stored accessToken in a file and it's all good now.
Many Thanks for your help
Hi there!
If you need more help you can view your support options (expected response time for a 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!