cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We recently received a question asking for advice on how to set up a Dropbox account for an elderly family member. This prompted us to think about the different ways we can make Dropbox more accessible in general, learn about it and add your tips right over 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: 
1
Ask
2
Reply and help

Dropbox Java API Problem

Dropbox Java API Problem

Julian M.11
New member | Level 1

Hi,

 

i wanted to learn how to use the Dropbox API, so i followed the Tutorial and adapted it to my program. Now, when i want to use the .getAccountInfo() - method, i get an error:

Exception in thread "main" java.lang.IllegalArgumentException: Illegal character(s) in message header value: Bearer <the access token>

I have no idea why this happens, the access token seems to be correct.

I hope someone here can help me.

 

2 Replies 2

Re: Dropbox Java API Problem

Greg-DB
Dropboxer

Unfortunately this will be hard to debug remotely, since you need to redact the access token itself, for the sake of security.

Where did you get the access token and how are you loading it though? Can you double check there aren't any stray characters on it? E.g., if you copied and pasted it from somewhere, make sure there aren't any invisible characters that got included. You could try copying it in to a plain text editor to make sure you only have plain text.

For reference, access tokens should look like this:

Zu9U1XOZl8QAAAAAAAMnj9WQmUPh1KcbbU4uh2ks-t_viUgiJG4OF1jBFH3KwF9p

(I've redacted this one to share as an example.)

Re: Dropbox Java API Problem

Julian M.11
New member | Level 1

Thanks for your quick answer, i checked the acces token file again and noticed that it had two lines (1 empty line). I dont know where that came from, but i removed  it and now everything works fine!

Thanks for the help!

Who's talking

Top contributors to this post

  • User avatar
    Julian M.11 New member | Level 1
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?