.Net API Questions

Avatar
Hi,

I have few questions regarding .Net API

1. Kindly explain me the login flow. I have API Key and secret
// Initialize key and secret of your app
static string MyAPIKey = "hpdo2p8hcrxyqn4p";
static string MySecret = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
static string MyUserId = "DD00XX";

Everytime I need to login do I need to go to https://kite.trade/connect/login?api_key=hpdo2p8hcrxyqn4p ????

2. This is the response I get. Is this normal ? I get redirected to local IP.



3. Then I use this request_token from the above URL in my application as input and then the login process is successful ? Is this the process for every time I login ?
4. I need to tag my orders so that I can trace them on the way back. I see a “tag” field in the Place Order param
AddIfNotNull(param, "tag", "abc"); I am providing abc to it. But on order confirmation I do not get an echo back of abc as tag.
5. kite.GetOrder("170921000905084"); GetOrder function also does not echo back the tag
6. Console.WriteLine(JsonSerialize(orderinfo[0])); kite.GetOrder returns two elements in the List. Why ?

Kindly Help
  • tonystark
    Hi @Avatar,

    1. You will have to do this once every day. The access token you get is valid for one day. But request token is valid for only couple of minutes and can be used only once. So once you get access token stored it and use it and do not request for access token again till your session expires.
    2. Yes. You can change localhost to your own endpoint from your app dashboard.
    3. Yes. For detailed information about login flow check out this video.
    4. This is a bug. Thanks for pointing it out. As a workaround, you can clone the code from our git repo and change the line 236 to this: AddIfNotNull(param, "tag", Tag); We will fix this in the next release.
    5. and 6. GetOrder function returns the order details. This does not contain tags. Tags are only available in order book API call.
Sign In or Register to comment.