One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
RDev
8 years agoNew member | Level 2
Generation access token for V2 using V1 access key and secret key
Hi
I have been trying to generate oauth 2 access token for my app (which was created using core api 1 in java), based on the documentation provided for migration but every time I tried it I got
{"error": "Invalid app key (consumer key). Check your app's configuration to make sure everything is correct."}.
I tried both the sdk approach as well as the http one but to no avail.I am stuck . Kindly need help to figure out where am I going wrong with this. Below code is the one I used to fetch oauth2.0 token. Here is the java approach I tried
DbxOAuth1Upgrader upgrader;
DbxOAuth1AccessToken oAuth1AccessToken;
DbxRequestConfig requestConfig = new DbxRequestConfig(appName);
DbxAppInfo appInfo = new DbxAppInfo(accessKey, secretKey);
upgrader = new DbxOAuth1Upgrader(requestConfig, appInfo);
oAuth1AccessToken = new DbxOAuth1AccessToken(accessKey, secretKey);
String newToken = upgrader.createOAuth2AccessToken(oAuth1AccessToken);
upgrader.disableOAuth1AccessToken(oAuth1AccessToken);
The same accesskey and secretKey are working fine with the coreAPI 1.
- Greg-DB
Dropbox Staff
You're using the same accessKey/secretKey pair for both your app info and access token. These should actually be different pairs of strings. The app key and secret (a.k.a. consumer key and secret) identify your app. They can be found on the app's page on the App Console. The access token key and secret are different strings that are specific to the user.
So, these two lines should look like this, with the correct and distinct values for each of the four parameter variables:
DbxAppInfo appInfo = new DbxAppInfo(appKey, appSecret);
oAuth1AccessToken = new DbxOAuth1AccessToken(oauth1AccessTokenKey, oauth1AccessTokenSecret);
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,951 PostsLatest Activity: 2 hours 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!