Closed ajaipaulose closed 2 years ago
-H "Authorization: token api_key:xxxxxxxxxxxxxx"
You need to send access_token as well in auth header. The correct format would be :
-H 'Authorization: token {your_api_key}:{access_token}'
Go through the documentation here.
I tried the following command for placig a GTT order
curl https://api.kite.trade/gtt/triggers \ -H 'X-Kite-Version: 3' \ -H 'Authorization: token api_key:xxxxxxxxxxxxxxxxxxxxxxxxxx' \ -d 'type=single' \ -d 'condition={"exchange":"NSE", "tradingsymbol":"INFY", "trigger_values":[702.0], "last_price": 798.0}' \ -d 'orders=[{"exchange":"NSE", "tradingsymbol": "INFY", "transaction_type": "BUY", "quantity": 1, "order_type": "LIMIT","product": "CNC", "price": 702.5}]'
It returns the following error
{"status":"error","message":"Incorrect
api_keyor
access_token.","data":null,"error_type":"TokenException"}
I am sure api_key is correct as the following command is working
curl "https://api.kite.trade/instruments" \ -H "X-Kite-Version: 3" \ -H "Authorization: token api_key:xxxxxxxxxxxxxx"
What is wrong with the gtt command?