I built one strategy in tradingview pine scrip and wanted to generate buy and sell signal from tradingview platform to zerodha account using REST API. It looks all good but I just wanted to confirm about access token, how do we pass access token in REST API? Is it in header or in body ?
@sujith There's not specific information I could find on this APIs. In example they've just mentioned -h and -d, and there's no specification on how this should be.
@sujith Thanks for your response, I have built one strategy on tradingview platform, and they're providing webhooks to make trade according to signal generated from strategy, but the problem is its only possible to provide data in body, and not in header, is there anyway we can achieve this ?
@sujith also, wanted to confirm about derivatives market, can we trade in derivatives market with API ? because there's no specification about derivatives trading in REST API document.
@rakeshr Yes, its already enabled in my account, but when I was trying with free publisher app (with just html button) it was not working with derivatives.
I get this error whenever I put derivative symbol in button control. For equity, it works fine. {"status":"error","message":"No valid orders found in payload.","data":null,"error_type":"InputException"}
I wanted to try with Nifty Jan Future, "NIFTY21JANFUT" this is the symbol I used... < button data-kite="API KEY" data-exchange="NSE" data-tradingsymbol="NIFTY21JANFUT" data-transaction_type="BUY" data-quantity="1" data-order_type="LIMIT" >Buy NIFTY
You can get api_key from the developers console after creating a Kite Connect app and you can get an access token after login flow. You can know more here.
For equity, it works fine.
{"status":"error","message":"No valid orders found in payload.","data":null,"error_type":"InputException"}
< button data-kite="API KEY"
data-exchange="NSE"
data-tradingsymbol="NIFTY21JANFUT"
data-transaction_type="BUY"
data-quantity="1"
data-order_type="LIMIT"
>Buy NIFTY
-H "Authorization: token api_key:access_token"
-H "Authorization: token <api_key>:<access_token>"