Multiple connection using same api key and token

prateek3211
Hi Team,
I have 2 separate python application which are using zerodha api. I have created 1 app in zerodha, for which I have 1 api key and 1 secret key. Now I am generating 1 token for each application, ie 2 in all. But only one of them works at any given instance and the older one expires once new is generated. Also I tried to connect both application with same token as well, but it gave an error saying 'token expired or invalid'. Can u suggest how can I connect multiple application using the single app
  • sujith
    You can use a single access token on both the apps. If you try creating a new one then the old one is invalidated.
  • prateek3211
    prateek3211 edited May 14
    hi @sujith

    On execution of below code in the application on consecutive lines. I am getting error as mentioned below
    Code:
    kite = KiteConnect(api_key='**my_api_key**)
    kite.generate_session('**my_access_token**',api_secret='**my_api_secret**')
    kite.generate_session('**my_access_token**',api_secret='**my_api_secret**')

    Error:
    kiteconnect.exceptions.TokenException: Token is invalid or has expired.'

    Can you please help how to get 2 connections using same token
This discussion has been closed.