https://api.kite.trade/user/profile - Does not return login_time

Shabeershah2002
Your documentation says user/profile can be retrieved anytime and it returns login_time, i just have tried it and below is the response i received there is no time !.

{"status":"success","data":{"user_type":"investor","email":"[email protected]","user_name":"xxxxx yyyy","user_shortname":"xxxyy","broker":"ZERODHA","exchanges":["CDS","MCX","BSE","NSE","BFO","NFO"],"products":["BO","CNC","CO","MIS","NRML"],"order_types":["LIMIT","MARKET","SL","SL-M"],"avatar_url":null}}

Further there seems a correction required on your documentation that it shows wrong (curl https://api.kite.trade/session/token) to retrieve profile , while it should be /user/profile not /session/token

  • sujith
    Thank you for pointing out. It is actually /session/token response (modified). Profile call doesn't have login time.
    We will update documentation.
  • Shabeershah2002
    ohk, thank you , i can see you have updated the documentation with correct details and curl.

    I was looking for a way to validate my session before i get surprised it is not valid after placing an Order !!, so can i use /user/profile and confirm session is valid if i get a success response ?
    or is there any alternate way you can suggest ?
  • sujith
    You don't have to do this. You can just do whatever you are trying to do.
    Let us say your script starts with fetching orderbook then you should go ahead and make the call. If it fails with 403 then it means your session is expired or else you will get a successful response. In this way, you can reduce one async API call.
  • Rahul
    If suppose I am placing order and realized the session was expired , so I will do the login process and place order again you mean ?
    By the time my opportunity might have gone ! , then what is the point of using API , I could login to web and place order :)
  • sujith
    @Rahul,
    I will put it across the team and let you know the update.
  • Shabeershah2002
    Shabeershah2002 edited April 2018
    Yes i agree with Rahul, placing order is financially significant rest all other APIs are not such as fetching position or knowing margins etc, so there should be a way to validate our session periodically to ensure it is still valid before getting rejected the order due to session expiry and all strategy collapse....!, because i have many experience that during the day i get 'Session expired must login'
    I was wondering to use that user/profile API to validate session in every 1 hour or less.
    otherwise like @sujith said we could use any other API to ensure if they are returning success or 403 before placing a order .
Sign In or Register to comment.