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 !.
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
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 ?
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.
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
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 .
We will update documentation.
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 ?
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.
By the time my opportunity might have gone ! , then what is the point of using API , I could login to web and place order
I will put it across the team and let you know the update.
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 .