Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ "fault": { "code": 999003, "description": "Please refer https://www.kotaksecurities.com/itrade/user/marketing.exe?action=trade_api&req=92", "message": "You are not authorized to access this platform. Please refer https://www.kotaksecurities.com/itrade/user/marketing.exe?action=trade_api&req=92" } } #38

Open
kalilinux-png opened this issue Oct 1, 2022 · 4 comments

Comments

@kalilinux-png
Copy link

Any Idea

@Kart69
Copy link

Kart69 commented Oct 1, 2022

mee to have the Invalid One-time token issue Send a Mail they told me to make changes in the endpoint. so sick

@kalilinux-png
Copy link
Author

mee to have the Invalid One-time token issue Send a Mail they told me to make changes in the endpoint. so sick

With me the same thing is working for my account but when i try this with another account it raised error

@Kart69
Copy link

Kart69 commented Oct 6, 2022

you can search in google "HTTPS" endpoint.
they told me with a mail like this:
Add below endpoints in your code

session token generate
Use the below endpoints in the order mentioned below-

  1. POST​/session​/login​/userid Login using Userid
  2. POST​/session​/2FA​/accesscode Generate final Session Token

after this message they mailed me saying that the problem is resolved.
they are not willing to help.
KotakSecurities would be India's best brokers if they hired the Proper staff.

@CosmicTrader
Copy link

Use below code, it will be easier.

api = ks_api.KSTradeApi(access_token = access_token, userid = user_id, consumer_key = consumer_key, ip = ip, consumer_secret = consumer_secret, host = "https://tradeapi.kotaksecurities.com/apim")

def login():
global api

login_data = api.login(password)
one_time_token = login_data['Success']['oneTimeToken']

headers = {'accept':'application/json',
        'oneTimeToken':one_time_token,
        'consumerKey':consumer_key,
        'ip':ip,
        'appId':consumer_secret,
        'Authorization':'Bearer '+access_token,
        'Content-Type':'application/json'}

data = {'userid': user_id}

response = json.loads(requests.post(url = url, headers = headers, data = json.dumps(data)).content)

return response

response = login()
api.session_token = response['success']['sessionToken']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants