Authentication

rajtk
I have implemented the following code
import hashlib

api_key = "xxxx"
api_secret = "yyyy"

request_token = "zzzz"

h = hashlib.sha256(api_key + request_token + api_secret)
checksum = h.hexdigest()

And I am getting only the following
dc04c02809311ab1fd7cf7ad57c76cd36f5ef2ae4503d707fc92ad20671eab9f

What to do to get the response as per your website ??
{
"status": "success",
"data": {
"access_token": "f67c2bcbfcfa30fccb36f72dca22a817",
"public_token": "5dd3f8d7c8aa91cff362de9f73212e28",
"user_id": "AB0012",
"user_type": "investor",
"email": "kite@connect",
"user_name": "Kite Connect",
"login_time": "2015-12-19 17:16:36",
"broker": "ZERODHA",
"exchange": [
"MCXSXFO",
"MCXSXCM",
"BSE",
"NSE",
"BFO",
"NFO",
"NCDEX",
"MCX",
"CDS",
"MCXSX"
],
"product": [
"BO",
"CO",
"CNC",
"MIS",
"NRML"
],
"order_type": [
"LIMIT",
"MARKET",
"SL",
"SL-M"
]
}
}
  • sujith
    Hi @Rajatk,
    You don't have to decrypt data. You will be getting back JSON response. Check out python code.
  • rajtk
    Thanks , I referred to the code .
    When is send a CO , and try to modify the SL , it doesn't seem to modify the trigger price . Sending the snippet for reference
    order placement -
    access_token = kite.set_access_token(data["access_token"]) # add this before ordering,
    order_id = kite.order_place(exchange = "NSE", tradingsymbol = "SBIN", transaction_type = "BUY", quantity = 1, order_type = "MARKET",validity = "DAY", trigger_price = 302.00, product = "MIS", variety='co')

    The order and the SL order is placed successfully.

    Modify Order
    print " sending modify order"
    access_token = kite.set_access_token(data["access_token"]) # add this before ordering
    modified_stop_loss = kite.order_modify(order_id=sl_id, parent_order_id = primary_id , exchange="NSE", tradingsymbol="SBIN",trigger_price= 304.00,product = "co", variety='co')
    print " Modify Order complete", modified_stop_loss

    Result - it does not modify the trigger price.
    Result says it modified but it does not reflect in the order book.

    SL ID: 170809000450265
    Sleeping for 60secs
    sending modify order
    Modify Order complete 170809000450265
  • sujith
    Hi @Rajatk,
    You need to pass product as 'MIS' and quantity param is missing.
    Just take a look at bracket order second leg modification here, it is similar to modifying second leg cover order. Make sure you are passing all the params.
This discussion has been closed.