How to Read Live Price and Place ORDERS or check account status

k365
I am trying to
- Read Live Price
- Place orders and read Status of orders
using visual basic.
I tried to contact support but there is no one to help. I have made the payment and 2000 credits are already used for activation. Even the service is Paid why there is no technical support on phone, neither any technical person to help nor any sample codes?

So now, I am writing it here, let me know how to do this. I am getting invalid session error everytime
"{"status": "error", "message": "Invalid session", "error_type": "TokenException"}"

i have tried logging many times and then regenerated the request token.

this is what i am trying..
https://api.kite.trade/instruments/NSE/INFY?api_key=xxx&access_token=yyy

in xxx, i have placed the api key. And in yyy i have placed the request token received after authentication using the link https://kite.trade/connect/login?api_key=xxx

it is showing error of invalid session as given above.
so let me know if I am doing it the right way or what is missing ?

Similarly.. how to place orders ?


  • Vivek
    Vivek edited August 2016
    @k365 It seems like you are using request token instead of access token. After you acquire request token from login redirect you have to exchange it for access_token which should ideally be stored on your side and use it for subsequent request.
    A successful login comes back with a request_token as a URL query parameter to the registered redirect url. This request_token, along with a checksum (SHA-256 of api_key + request_token + api_secret) should be POSTed to the token API to obtain a secret access_token, which is then used for all subsequent requests.
    Please refer the documentation and most of your support questions might already be answered in this forum so please search for it before posting.
  • k365
    yes got the request token, but what to do next ? give me the steps for getting Access token using URL links like we get request token
  • Vivek
    Vivek edited August 2016
    @k365 Please check the documentation here - https://kite.trade/docs/connect/v1/#authentication
  • k365
    ok..
    now i am trying this from the link you given.
    https://api.kite.trade/session/token?api_key=xxx&request_token=yyy&checksum=zzz

    what will be the value for checksum ? i am passing all this in url
    {"status": "error", "message": "Route not found", "error_type": "GeneralException"}
  • k365
    for checksum it is given
    hash of (api_key + request_token + api_secret)

    so i am generating hash 256 value for api_key and request toke...api secret

    now do i have to generate the hash 256 after joining all three values or have to convert each them seperatly and join with + sign or directly..???

    kindly guide me, i am passing values in url. so let me know accordingly
  • Vivek
    @k365 You should string concatenate api_key + request_token + api_secre
    and pass hex value of generated hash.
  • k365
    i tried it but getting the error
    {"status": "error", "message": "Route not found", "error_type": "GeneralException"}

    i concatenated all values, converted it to hash256 and then passed in checksum in link.. but not working please help
  • Vivek
    @k365 Can you post the line of your code in which you are generating checksum?
  • k365
    you people dont provide any phone support, neither there was any demo for it
    i have paid for your service, neither there is any proper response, nor there is any person to guide ? there is no example code too ? at time of payment it was told that we can use it in with vb and .net both

    all my credits are being wasted on daily just posting here and asking to link the api with my program ? what is going on here ? if anyone else is also getting the same problem raise your voice here ? and we should get refund for this untill our problem is solved.

    also give us some direct phone no. to talk
  • k365
    4 days no reply ? still after several requests... nw what would you say ?
  • Vivek
    @k365 You have PMed your query and have answered also. Currently we don't have a bandwidth for a phone support, may be we will have one in future as of now please post your query and we will try to answer. Also it seems like you are looking for examples on VB but we don't have any at the moment but you can refer our official Python and Node library to checked how apis is implemented.
  • k365
    k365 edited August 2016
    i have to use for desktop application, and at time of purchase it was told that it will support all languages including vb
    i am doing this with http request using vb..
    you can provide me an example in vb.net c# or asp.net either just for the login flow till access token..
  • Kailash
    @k365 Where were you explicitly told about VB?

    The APIs are simple HTTP requests, so they'll pretty much work universally with every programming language, including VB. Anything that can make HTTP requests (including browser addons, terminal etc.) can connect to the API easily.

    I'm afraid we're unable to provide examples in particular languages though (C#, VB etc.) as we don't use these ourselves. There are other developers on this forum who have successfully implemented (there are discussion threads. You may search) the APIs in C#. You may try speaking to them.
  • k365
    thank you Kailash for a detailed reply

    yes i am doing this with http requests. but i am stuck at the last step where access token should be generated..
    when starting steps is ok, then it must also go right with access token..

    do it require redirection to some https secured website for access token ? or can it be done in desktop application itself using http requests?

    i have searched on the forum and not found any such who has used in c# or vb sucessfully. you must have replied to any such discussion, can please forward me the link ?
  • Kailash
    All requests to the Kite API are over https, so there is no question of http.

    Here are a couple threads with C#
    https://kite.trade/forum/discussion/11/kite-connect-api-using-c?style=kite2
    https://kite.trade/forum/discussion/210/websocket-response-c?style=kite2
Sign In or Register to comment.