All the calls work fine but the call to exit order fails with error "Invalid `api_key` or `access_token`" I'm writing a script to exit all my CO positions at EOD. As mentioned else where, I'm getting all orders that have trigger pending and are 'CO' product type, looping through them and issuing an exit order. This same token and api_key work for all other preceding calls except this one. Pls help.
This happens if I cancel the subscription before the expiry of subscription. Even though I have paid for a few more days, the app is being marked as inactive.
@pavvu_kk, Can you run pykiteconnect with debug logs on and paste the complete stack trace? You can private message the complete stack trace since it will contain your credentials as well.
@rakeshr@sujith, wanted to let you guys know that changing 'co' to 'CO' actually worked. @sujith you should fix the incorrect error message @rakeshr thank you
Im facing a similar issue.
when i try to login with https://kite.zerodha.com/connect/login?api_key=XXXXXXXXX&v=3, i get the following response.
{"status":"error","message":"Invalid `api_key`","data":null,"error_type":"InputException"}
My api key is valid.
I hope u would fix it.
Please write to kiteconnect(at)zerodha.com someone from the team will take a look at this.
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "DELETE /orders/CO/200417002036102?order_id=200417002036102&variety=CO&parent_order_id=200417002036100 HTTP/1.1" 307 0
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): api.kite.trade:80
DEBUG:urllib3.connectionpool:http://api.kite.trade:80 "DELETE /orders/co/200417002036102?order_id=200417002036102&variety=CO&parent_order_id=200417002036100 HTTP/1.1" 301 None
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "DELETE /orders/co/200417002036102?order_id=200417002036102&variety=CO&parent_order_id=200417002036100 HTTP/1.1" 400 109
INFO:root:Order exit failed: Invalid `api_key` or `access_token`.
Can you run pykiteconnect with debug logs on and paste the complete stack trace? You can private message the complete stack trace since it will contain your credentials as well.
One can cancel auto-renewal by going to the billing section and un-link the Zerodha account.
You seem to have canceled your app.
that is what I did and got that log. The call that precedes this call to fetch all orders goes through properly.
CO
instead ofco
.You need to sendvariety=co
Check input params detail here.
@sujith you should fix the incorrect error message
@rakeshr thank you