We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

Michal5's avatar
Michal5
Explorer | Level 4
5 years ago

Status codes: Dropbox sdk java

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.

  • 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).

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    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's avatar
      Michal5
      Explorer | Level 4

      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's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        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!