OpenApi-5p / py5paisa

Official Python SDK for 5paisa APIs natively written in VB .NET
https://5paisa.github.io
92 stars 68 forks source link

Getting Error while login. 'NoneType' object is not subscriptable #153

Open Sudarshan-Gope opened 2 years ago

Sudarshan-Gope commented 2 years ago

Description

Got API keys from https://invest.5paisa.com/DeveloperAPI/APIKeys

While running the file got error: 'NoneType' object is not subscriptable

Code: from py5paisa import FivePaisaClient cred={ "APP_NAME":"######", "APP_SOURCE":"######", "USER_ID":"######", "PASSWORD":"######", "USER_KEY":"######", "ENCRYPTION_KEY":"######" }

client = FivePaisaClient(email="######", passwd="######", dob="######",cred=cred) client.login()

The values in cred are from the page from I got the API credentials. Email and password are my login details.

Do I need to get a token for login as we do in other API vendors?

There is this link for token: https://dev-openapi.5paisa.com/WebVendorLogin/VLogin/Index?VendorKey=&ResponseURL=

What will be the Vendor key? I assume Redirect URL can be custom, but no documentation for the Vendor Key.

5paisa commented 2 years ago

User Key is same as Vendor Key

darsheik commented 2 years ago

I am getting a similar issue. Has anyone found the solution?

AkiMosi commented 2 years ago

Having the same issue @5paisa I could see there are multiple issues in this same scenario. When this would be fixed?

varadjoshi90 commented 2 years ago

@sudarshan6 did you end up getting a solution to this?

AkiMosi commented 2 years ago

@varadjoshi90 I tried the same thing next day, and it worked for me. I think their server might be irresponsive then and there. Which is kind of freaking too, have to consider all these risks, when trying to deploy some trading bot in actual markets with these inconsistencies.

varadjoshi90 commented 2 years ago

thanks @AkiMosi. I have heard IBKR API is good, you need to put 10-15k idle money in IBKR though to stream the API data.

Sudarshan-Gope commented 2 years ago

@varadjoshi90 I tried for few days, didn't found any solution. Was just trying to use the api. Will update if I get any solution.