how to automate the request_token retrival and how to genarate the check sum.

raag
raag edited December 2020 in API clients
Hi,
I am new to this automation, and tyring to understand basics. and first 2 questions
1. if I understood it correctly, everyday morning pre-market hours, we need to gernarate request_token and access_token..is there a way we can automate it?
2. and how to generate this checksum (checksum (SHA-256 of api_key + request_token + api_secret) to have access token..?

Thank you In Advance.
Raag.
  • rakeshr
    @raag
    1. It is mandatory by the exchange that a user has to log in manually at least once a day. We don't recommend automating login.
    2. Either you can use any client library, which does checksum calculation for you or do it at your end manually using 3rd party source like this.
  • raag
    Hi Rakesh, Thank you for quick response. i am trying to run the curl command which given in the kite documentation

    curl https://api.kite.trade/orders/regular \
    -H "X-Kite-Version: 3" \
    -H "Authorization: token api_key:access_token" \
    -d "tradingsymbol=ACC" \
    -d "exchange=NSE" \
    -d "transaction_type=BUY" \
    -d "order_type=MARKET" \
    -d "quantity=1" \
    -d "product=MIS" \
    -d "validity=DAY"

    and I get the error
    {"status":"error","message":"unknown Authorization scheme","data":null,"error_type":"InputException"}%


    how i need to input the Authiruzation keys?
    exactly like this?
    -H "Authorization: token my_api_key: my_access_token" ?
  • raag
    nevermind, fixed the syntax errors.. its working now..!
This discussion has been closed.