Token

naveen278
For Web Socket what are the list of tokens I need to provide here for below? What tokens are expected here? Is it access token or request token?

KiteTicker tickerProvider = new KiteTicker(kiteSdk.getAccessToken(), kiteSdk.getApiKey());
tickerProvider.subscribe(tokens);

Tagged:
  • SRIJAN
    Its a list of instrument tokens for the instruments you want to subscribe.

    Instrument tokens can be fetched through the instruments API.
    https://kite.trade/docs/connect/v3/market-quotes/#instruments
  • naveen278
    I dont see any APi called instruments API in the link you mentioned. Also can we pass in Symbol to make it easier?
  • SRIJAN
    Read the documentation properly provided to you in your threads first,write code according to the documentation,and if there are any problems,then ask your queries.
  • naveen278
    I dont see any API hence I ran the url with my apikey and access token

    https://api.kite.trade/quote/ltp?i=NSE:INFY&i=BSE:SENSEX&i=NSE:NIFTY+50 -H X-Kite-Version: 3 -H Authorization: api_key:acess_token

    and it gives an error

    {"status":"error","message":"Invalid `api_key` or `access_token`.","data":null,"error_type":"InputException"}

    I rechecked both my API key and access token and found it is correct. What is the issue here. Also is there no API to use instead of URL? Are these Rest API URLs?
  • SRIJAN
    SRIJAN edited June 2022
    Everything is described in detail in the documentation.

    As told ,you first need to have basic coding knowledge and you have to understand and use them accordingly.

    Please, don't flood the forum with queries which can easily be solved by reading the documentation.
  • naveen278
    I got this by reading documentation

    https://api.kite.trade/quote/ltp?i=NSE:INFY&i=BSE:SENSEX&i=NSE:NIFTY+50 -H X-Kite-Version: 3 -H Authorization: api_key:acess_token

    but it is giving error
    {"status":"error","message":"Invalid `api_key` or `access_token`.","data":null,"error_type":"InputException"}

    What do you want me to do here, both api key and access token is correct.
  • naveen278
    For Example for Infosys INFY do we have an instrument ID that is permanently fixed so I can use it in my code or it keeps varying regularly? Since the API needs tokens to be passed as an array list. I used Tokens which are long values obtained from the .csv file I downloaded and my listener is never getting invoked.
  • naveen278
    I subscribed using below

    long lvalue= 128053508;
    tokens.add(lvalue);
    tickerProvider.subscribe(tokens);

    but my listerner is never getting invoked to get the quotes for setOnTickerArrivalListener

    Regards,
    Naveen
Sign In or Register to comment.