We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
UserMateUser
8 months agoNew member | Level 2
Java SDK getting "Invalid authorization value in HTTP header/URL parameter"
Hello! I'm using Java SDK and trying to add dropbox into my app. I was following the guide from dropbox github https://github.com/dropbox/dropbox-sdk-java/tree/main When I try to check if it works,...
- 8 months ago
It looks like you're using this constructor, where you provide the DbxRequestConfig and an access token String. That is fine and should work. To confirm, I tried this condensed version of your code, with the latest v6.1.0 of the Dropbox Java SDK:
DbxRequestConfig config = DbxRequestConfig.newBuilder("TMS/1.0").build(); String token = "<REDACTED>"; DbxClientV2 dropboxClient = new DbxClientV2(config, token); FullAccount account = dropboxClient.users().getCurrentAccount(); System.out.println(account.getName().getDisplayName());
That worked successfully for me. You may want to also try this basic version to see if this works for you to try to narrow down where this is breaking in your setup.
And I see you mentioned checking that 'token' was set properly for you originally, but I recommend stepping through the rest of your process to see if/where something may be getting changed. We can't provide support for Beans or autowiring though, as that's not made by Dropbox.
For reference, there are a number of ways of using the Dropbox app authorization functionality, and exactly how you set it up will depend on your scenario and requirements. I recommend referring to the following resources for more information:
- https://developers.dropbox.com/oauth-guide
- https://www.dropbox.com/developers/documentation/http/documentation#authorization
- https://dropbox.tech/developers/using-oauth-2-0-with-offline-access
- https://github.com/dropbox/dropbox-sdk-java/tree/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize
Greg-DB
8 months agoDropbox Staff
It looks like you're using this constructor, where you provide the DbxRequestConfig and an access token String. That is fine and should work. To confirm, I tried this condensed version of your code, with the latest v6.1.0 of the Dropbox Java SDK:
DbxRequestConfig config = DbxRequestConfig.newBuilder("TMS/1.0").build();
String token = "<REDACTED>";
DbxClientV2 dropboxClient = new DbxClientV2(config, token);
FullAccount account = dropboxClient.users().getCurrentAccount();
System.out.println(account.getName().getDisplayName());
That worked successfully for me. You may want to also try this basic version to see if this works for you to try to narrow down where this is breaking in your setup.
And I see you mentioned checking that 'token' was set properly for you originally, but I recommend stepping through the rest of your process to see if/where something may be getting changed. We can't provide support for Beans or autowiring though, as that's not made by Dropbox.
For reference, there are a number of ways of using the Dropbox app authorization functionality, and exactly how you set it up will depend on your scenario and requirements. I recommend referring to the following resources for more information:
- https://developers.dropbox.com/oauth-guide
- https://www.dropbox.com/developers/documentation/http/documentation#authorization
- https://dropbox.tech/developers/using-oauth-2-0-with-offline-access
- https://github.com/dropbox/dropbox-sdk-java/tree/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf 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!