How to use same request token for whole day ??

Every time i need to generate new requestToken then restart my application,
that's why my application not properly working,
Please reply how can i use same request token for whole day..
  • cisk
    Why generate request token again and again for the whole day? Once you get "access token" using your request token, use it for the entire trading session, valid for the day. You only have to generate new access token everyday(trading session from 9.15am to 3.30pm) manually
  • aakashps1995
    @cisk, please see this code and tell me what is my fault
    public static void main(String[] args) throws Exception {
    // TODO Auto-generated method stub

    try {

    String apiKey = "";
    String clientId = "";
    String apiSecret = "";
    String requestToken = "";

    KiteConnect kiteConnect = new KiteConnect(apiKey);

    kiteConnect.registerHook(new SessionExpiryHook() {
    public void sessionExpired() {
    System.out.println("session expired");

    UserModel userModel = kiteConnect.requestAccessToken(requestToken, apiSecret);

    String stock1 = "INFY";

    Quote quote1 = kiteConnect.getQuote("NSE", stock1);

    } catch (KiteException e) {
    System.out.println(e.message+" "+e.code+" "+e.getClass().getName());
    } catch (JSONException e) {


  • sujith
    Don't call the requestAccessToken method every time you run the app.
    Once you get access token, store it and re-use it for subsequent runs.
Sign In or Register to comment.