cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done here!

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Java dropbox API permanent key

Java dropbox API permanent key

Ricardo W.
New member | Level 1

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

2 Replies 2

Re: Java dropbox API permanent key

Greg-DB
Dropboxer

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.

Re: Java dropbox API permanent key

Ricardo W.
New member | Level 1

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

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Ricardo W. New member | Level 1
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?