cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

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: 

BadResponseException: Bad JSON

Highlighted

BadResponseException: Bad JSON

Explorer | Level 3

Hi there,

I've recently ran into an issue with Dropbox API (Java dropbox-sdk-java v2.1.1) that started as early as Mar 8. It happens when trying to create a shared link when one has already been created -- normally this produces a CreateSharedLinkWithSettingsErrorException, but now, a BadResponseException is returned. I'm creating the link using:

DbxClientV2.sharing().createSharedLinkWithSettings().getUrl()

The error is:

com.dropbox.core.BadResponseException: Bad JSON: expected end of object value. at [Source: (sun.net.www.protocol.http.HttpURLConnection$HttpInputStream); line: 1, column: 139]

 Any ideas what might be causing the issue or what I can do to fix the problem?

Thanks,

Stephen

1 Accepted Solution

Accepted Solutions
Highlighted

Re: BadResponseException: Bad JSON

Dropboxer

Thanks for the report! We recently made an update to the /2/sharing/create_shared_link_with_settings endpoint (which is what createSharedLinkWithSettings calls). It wasn't a breaking change, but it looks like a bug in older versions of the Java SDK can cause the SDK to not properly handle it.

Please update to the latest version of the SDK (currently v3.0.11) and try again.

View solution in original post

3 Replies 3
Highlighted

Re: BadResponseException: Bad JSON

Dropboxer

Thanks for the report! We recently made an update to the /2/sharing/create_shared_link_with_settings endpoint (which is what createSharedLinkWithSettings calls). It wasn't a breaking change, but it looks like a bug in older versions of the Java SDK can cause the SDK to not properly handle it.

Please update to the latest version of the SDK (currently v3.0.11) and try again.

View solution in original post

Highlighted

Re: BadResponseException: Bad JSON

Explorer | Level 3

Thanks for the quick reply. I'll give it a go on the new version of the SDK. In the meantime, can I safely assume that I'll have to change my usage pattern with the existing version to get around this issue?

Thanks again.

Highlighted

Re: BadResponseException: Bad JSON

Dropboxer

Yes, if you want to continue using v2.1.1 for now, you'll need to update your code, at least to handle that BadResponseException.

The upgrade from v2.1.1 to v3.* shouldn't be too significant though. The only breaking changes should be the two mentioned here: https://github.com/dropbox/dropbox-sdk-java/releases/tag/3.0.0 

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?