code: public Token refreshToken(Token token) throws OAuthTokenException, JSONSerializerException, HttpClientException, URISyntaxException, InvalidRequestException {
          // Prepare the hash
          String doHash = clientSecret + "|" + token.getRefreshToken();
          MessageDigest md;
          try {
              md = MessageDigest.getInstance("SHA-256");
          } catch (NoSuchAlgorithmException e) {
              throw new RuntimeException("Your JVM does not support SHA-256, which is required for OAuth with Smartsheet.", e);
          }
          byte[] digest;
          try {
              digest = md.digest(doHash.getBytes("UTF-8"));
          } catch (UnsupportedEncodingException e) {
              throw new RuntimeException(e);
          }
          //String hash = javax.xml.bind.DatatypeConverter.printHexBinary(digest);
          String hash = org.apache.commons.codec.binary.Hex.encodeHexString(digest);
  
  
          // Create a map of the parameters
          Map<String,Object> params = new HashMap<String,Object>();
          params.put("grant_type", "refresh_token");
          params.put("client_id",clientId);
          params.put("refresh_token",token.getRefreshToken());
          params.put("redirect_uri", redirectURL);
          params.put("hash",hash);
  
          // Generate the URL and get the token
          return requestToken(QueryUtil.generateUrl(tokenURL, params));
      }
docs: Refresh token.
  
  Exceptions:
  - IllegalArgumentException : if token is null.
  - InvalidTokenRequestException : if the token request is invalid
  - InvalidOAuthClientException : if the client information is invalid
  - InvalidOAuthGrantException : if the authorization code or refresh token is invalid or expired,
  the redirect_uri does not match, or the hash value does not match the client secret and/or code
  - UnsupportedOAuthGrantTypeException : if the grant type is invalid
  - OAuthTokenException : if any other error occurred during the operation
  
  @param token the token to refresh
  @return the refreshed token
  @throws NoSuchAlgorithmException the no such algorithm exception
  @throws UnsupportedEncodingException the unsupported encoding exception
  @throws OAuthTokenException the o auth token exception
  @throws JSONSerializerException the JSON serializer exception
  @throws HttpClientException the http client exception
  @throws URISyntaxException the URI syntax exception
  @throws InvalidRequestException the invalid request exception