code: public UserStateResult getUserState(String username)
              throws APIConnectionException, APIRequestException {
          StringUtils.checkUsername(username);
          ResponseWrapper response = _httpClient.sendGet(_baseUrl + userPath + "/" + username + "/userstat");
          return UserStateResult.fromResponse(response, UserStateResult.class);
      }
docs: Get user state
  
  @param username Necessary
  @return user state info, include login and online message.
  @throws APIConnectionException connect exception
  @throws APIRequestException    request exception