ed", "error": "invalid_grant"}
I uploaded successfully few files using the Dropbox API. But now I am receiving this message:
com.dropbox.core.DbxException$BadRequest: {"error_description": "code doesn't exist or has expired", "error": "invalid_grant"}
for this code
final String APP_KEY = "aaaaaaaaaaaaaaaa";
final String APP_SECRET = "sssssssssssssss";
DbxAppInfo appInfo = new DbxAppInfo(APP_KEY, APP_SECRET);
DbxRequestConfig config = new DbxRequestConfig("JavaTutorial/1.0",
Locale.getDefault().toString());
DbxWebAuthNoRedirect webAuth = new DbxWebAuthNoRedirect(config, appInfo);
// Have the user sign in and authorize your app.
String authorizeUrl = webAuth.start();
System.out.println("1. Go to: " + authorizeUrl);
System.out.println("2. Click \"Allow\" (you might have to log in first)");
System.out.println("3. Copy the authorization code.");
String code = "codexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
// Once the user has delivered the authorization code to our app, we can
// exchange that code for an access token via finish:
DbxAuthFinish authFinish = webAuth.finish(code);
String accessToken = authFinish.accessToken;
DbxClient client = new DbxClient(config, accessToken);
System.out.println("Linked account: "
+ client.getAccountInfo().displayName);