I am able to login and able to generate access_token but when I am using it in either quotes or historical API, I am getting "400 Client Error". When I used the same URL that fetches quote with "i" as instrument token and correct api_key and access_token, getting result as {"status":"error","message":"Invalid `api_key` or `access_token`.","data":null,"error_type":"InputException"}
Below are example of REST APIs for fetching RELIACNE data. Masked api_key and access_token intentionally. Verified that api_key is same as present in the active app in developer account and access_token is latest generated using API, https://kite.trade/connect/login?api_key=XXXXXXX
From last Friday (October 6th) we have discontinued query params based authentication which is sending api_key and access_token via query params instead of headers. Infact we never officially supported it and it was internally used by our systems which we stopped doing it. Please migrate your custom clients to use only header based auth - https://kite.trade/docs/connect/v3/user/#authentication-and-token-exchange
i have been using this request to fetch positions in python, which uses api key and access_token. I started giving me error today. what changes has been done ? what's the new request i have to send now in python. Please note that i could not understand the changes from above mentioned article.
It would have helped if a note was sent to the API users that query params way is being discontinued and it is mandatory to use header based authentication now.
Do you have php library [like kiteconnect] without composer and header based authentication. I am using kiteconnect 3.0 without composer but it uses query param based authentication. Since you have discontinued query based authentication, so its giving me error: {'status': 'error', 'message': 'Invalid `api_key` or `access_token`.', 'data': None, 'error_type': 'InputException'}
without composer but it uses query param based authentication
No, the previous version without composer, uses header-based auth as well $request_headers[] = "Authorization: token " . $this->api_key . ":" . $this->access_token;. You can check the previous code v3.0.0, composer was introduced in v4.0.0.
Hi Rakesh, when I am using header based auth then now I am getting error: {"status":"error","message":"Incorrect `api_key` or `access_token`.","data":null,"error_type":"TokenException"}LTP not available for NFO:BANKNIFTY23OCTFUT
Verified that api_key is same as present in the active app in developer account and access_token is latest generated using API, https://kite.trade/connect/login?api_key=XXXXXXX
https://api.kite.trade/quote?i=738561&api_key=XXXXXXX&access_token=XXXXXXX
https://api.kite.trade/instruments/historical/738561/5minute?from=2023-09-01+00:00:00&to=2023-10-09+15:29:00&oi=1&api_key=XXXXXXX&access_token=XXXXXXX
requests.get("https://api.kite.trade/portfolio/positions?api_key=********&access_token=******
response - {'status': 'error', 'message': 'Invalid `api_key` or `access_token`.', 'data': None, 'error_type': 'InputException'}
$request_headers[] = "Authorization: token " . $this->api_key . ":" . $this->access_token;
. You can check the previous code v3.0.0, composer was introduced in v4.0.0.