Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
ksprasad
9 years agoNew member | Level 2
Unexpected response code 400
Hi,
I had been able to successfully connect to dropbox using dropbox api. I am using the bundle dropbox-core-sdk 1.7.6 from maven repository.
But since recently I am getting the below error from the same code.
Caused by: com.dropbox.core.DbxException$BadResponse: unexpected response code: 400
at com.dropbox.core.DbxClient$4.handle(DbxClient.java:274)
at com.dropbox.core.DbxClient$4.handle(DbxClient.java:270)
at com.dropbox.core.DbxRequestUtil.doGet(DbxRequestUtil.java:265)
at com.dropbox.core.DbxClient.doGet(DbxClient.java:1912)
at com.dropbox.core.DbxClient.getAccountInfo(DbxClient.java:270)
at org.apache.camel.dropbox.utils.DropboxApp.connect(DropboxApp.java:42)
Any idea what could be going wrong?
Below is the code:
final DropboxAppConfiguration appConfig = new DropboxAppConfiguration(appKey, appSecret,
accessToken, host, port);
final DropboxApp app = DropboxApp.create(appConfig);
try {
client = app.connect();
logger.debug("Client connected: " + client.getAccountInfo().displayName);
} catch (final FileNotFoundException e) {
throw new IllegalArgumentException(e);
} catch (final IOException e) {
throw new IllegalArgumentException(e);
} catch (final DbxException e) {
throw new IllegalArgumentException(e);
}
Regards,
ksprasad
The Dropbox Java SDK you're using (v1.7.6) is old and is using the now retired API v1. Calling API v1 will return a 400 error since it is now disabled.
You should instead use the latest version of the Dropbox Java SDK (currently v3.0.5), which uses API v2.
11 Replies
Replies have been turned off for this discussion
- Tanny8 years agoExplorer | Level 3You are the best !!!!! It finally works!!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!