cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Status codes: Dropbox sdk java

Status codes: Dropbox sdk java

Michal5
Explorer | Level 4
Go to solution

Hi Dropbox team,

Is there a possibility to acces status code in dropbox sdk java ? for example Check User

"If you receive an HTTP 200 response with the supplied query" how can I access status code ?

Thank you for your answer.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The official Dropbox SDKs don't return the actual status codes directly. They instead translate them to different exception types that you can catch natively.

For example, in the Java SDK, the DbxUserCheckRequests.user method will return an EchoResult if the call is successful (i.e., a 200 status code), or raise an exception, such as DbxApiException or DbxException, if the call failed (e.g., a 4xx or 5xx status code).

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

The official Dropbox SDKs don't return the actual status codes directly. They instead translate them to different exception types that you can catch natively.

For example, in the Java SDK, the DbxUserCheckRequests.user method will return an EchoResult if the call is successful (i.e., a 200 status code), or raise an exception, such as DbxApiException or DbxException, if the call failed (e.g., a 4xx or 5xx status code).

Michal5
Explorer | Level 4
Go to solution

So there is no way to access status codes directly ? I know about exception. I am catching exceptions but it is not enough. Anyway thank you for your answer.

Greg-DB
Dropbox Staff
Go to solution

That's correct, the Java SDK doesn't directly expose the status code itself. In the case of that method, if it returns a EchoResult that means that the API returned a 200 status, and the different exceptions correspond to the different kinds of failures. Can you elaborate on what you need that that doesn't cover? Thanks!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Michal5 Explorer | Level 4
What do Dropbox user levels mean?