Learn how to make the most out of the Dropbox Community here 💙.
Forum Discussion
Reshma
3 years agoExplorer | Level 3
is there any Java sdk method to generate access token on the run by taking app key and app secret??
Hello Dropbox team,
As Access token is expiring every 4 hours, we have to regenerate them every 4 hrs. This is becoming difficult to update the access code in my script manually. I'm looking for ...
- 3 years ago
Hi again Reshma ,
Seems you have misunderstood me. You can't just place one type of token where other type is expected! In Java SDK a DbxCredential object should be used as a proxy (don't ask me why) for refresh token.
Hope it's a bit more clear now.
Greg-DB
Dropbox Staff
3 years agoReshma As Здравко indicated, you cannot use a refresh token as an access token. Refresh tokens and access tokens serve different purposes and are not interchangeable. You can find examples of using the authorization flow in the Java SDK here. You can find an example of using a credential with a client to make call here.
Also, for future reference, do not publicly post your refresh token or app secret. I've redacted them from your post. You may want to revoke it for the sake of security.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,965 PostsLatest Activity: 7 minutes ago
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!