public TokenSet renewAccessToken ( String refreshToken , String apiSecret ) throws IOException , KiteException , JSONException { String hashableText = this . apiKey + refreshToken + apiSecret ; String sha256hex = sha256Hex ( hashableText ) ; Map < String , Object > params = new HashMap <> ( ) ; params . put ( "api_key" , apiKey ) ; params . put ( "refresh_token" , refreshToken ) ; params . put ( "checksum" , sha256hex ) ; JSONObject response = new KiteRequestHandler ( proxy ) . postRequest ( routes . get ( "api.refresh" ) , params , apiKey , accessToken ) ; return gson . fromJson ( String . valueOf ( response . get ( "data" ) ) , TokenSet . class ) ; }
Get a new access token using refresh token .