cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

How to get OAuth2 access token from OAuth1 token and secret with API v2 JDK

How to get OAuth2 access token from OAuth1 token and secret with API v2 JDK

Rajarshi
New member | Level 2

 

String my_app_key = "test1234";
String my_app_secret = "test567";
String client_app_key = "cltest123";
String client_app_secret = "cltest456";
 
DbxAppInfo appInfo = new DbxAppInfo(my_app_key, my_app_secret);
DbxOAuth1AccessToken oauth1AccessToken =
new DbxOAuth1AccessToken(client_app_key, client_app_secret);
 
DbxRequestConfig requestConfig = new DbxRequestConfig("myappname");
DbxOAuth1Upgrader upgrader = new DbxOAuth1Upgrader(requestConfig, appInfo);
String s = upgrader.createOAuth2AccessToken(oauth1AccessToken);
System.out.println("s====== " + s);

 

This is my code to fetch accesstoken key from V1.I am getting error of

"unexpected HTTP status code: 403: {"error": "Access token does not belong to this app."}"

 

Please help me out.

2 Replies 2

Greg-DB
Dropbox Staff
This error message indicates that the access token you're using (client_app_key and client_app_secret in your code) doesn't correspond to the app key and secret (my_app_key and my_app_secret in your code) that you're using.

When making this case, these pairs needs to match. That is, the access token you're trying to upgrade must have originally been retrieved using an app key and secret for the same app as you're using now.

So in this case, you'll need to swap in the correct app key and secret (my_app_key and my_app_secret in your code) to be able to upgrade this access token (client_app_key and client_app_secret in your code).

Rajarshi
New member | Level 2

Thank You very very much Greg. It's really help.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Rajarshi New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?