Can fetch the instruments list but the same apiToken and auth headers doesn't work for quotes.

swapv18
I retrieve the access token as a Auth header and send it in the format mentioned here to get the list of instruments.

This part works fine for me :)


But when I try to access the quotes as mentioned on the same page using the same auth headers as above.
curl "https://api.kite.trade/quote?i=NSE:INFY" \
-H "X-Kite-Version: 3" \
-H "Authorization: token api_key:access_token". // access_token is replaced by my personal access token


I get an error with Description "authorization value should atleast be `api_key`:`access_token`" and error_type: InputException.

I need to fix this asap.
I have attached screenshot where you could see the same API token being usedAlso I have taken care that the token is not fully visible in the screenshot.
  • sujith
    You need to send authentication header as mentioned here in the documentation.
  • swapv18
    swapv18 edited March 21
    Hi Sujith,
    You have provided the same link which I had provided.
    If you see the screenshot, you can see the token api_key :access_token format.
    I would appreciate answers, but seems you haven't gone through my detailed query.
    Please see the video for additional info.
    https://jmp.sh/Y1f7ZlCQ
  • MAG
    MAG edited March 22
    @swapv18
    The instruments call with go through with or without authentication. So the fact that you get the instruments does not mean that authentication worked for the instruments call and is failing for the rest.
    Another way of saying this is that your authentication is failing (even for the instruments call). The reason could be an invalid access_token or incorrect authentication headers
    Unfortunately I dont use postman or the http api and hence I cant help you resolve this. I use the python API.

    What I would suggest is picking up the python example code as is, replacing the api_key and access_token with your own and seeing if that works. Doing so will rule out whether its a issue with an invalid token or an incorrect http api call. Once you have narrowed down that the python code works; which means your access_token is valid, you can then look at the syntax/parameters for your api call.

    Or if you dont want to use python, maybe try a raw call using curl as given in the documentation instead of postman etc. And if that works, try to figure out why it is not working with postman.

    The examples are given using curl so if you use curl and post the exact call (if it fails); someone would be able to help you find out whats wrong easily. Unless you find someone else on the forums conversant with postman, you will have to debug this on your own.
  • MAG
    On having a closer look at the screenshot in your first post I see the key as "Authorization" and value as
    "token api_key D2eho..." when it should be
    "token api_key:D2eho..." a :(colon) instead of space after api_key. RTFM and copy and paste example code so you do not make noob syntax errors.
  • swapv18
    Hello MAG,
    thank you. It helped in knowing that instruments call worked without authentication as the site doesn't mention it so is quiet misleading as the dev thinks he has used the correct format for auth and one endpoint is at fault.
    But thanks for sorting this out. Also the colon part was also true. now It works with Postman as well as java application.
This discussion has been closed.