Unable to fetch Historical Data for NFO
-
Hi . Unable to fetch Historical data for NFO since yesterday night. Below is the error message:
I 240613 11:15:36 smartConnect:121] in pool
[E 240613 11:15:37 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Something Went Wrong, Please Try After Sometime.Please look into it
-
Hello @opt_trader
Can you please check and confirm whether you are using the updated sdk or not. Since this was fixed long back.
Regards,
SmartAPI Team -
@Moderator_3 Please find the code :
obj = SmartConnect(api_key = apikey)
data = obj.generateSession(clientId, pwd, totp)
print(data)
AUTH_TOKEN = data ["data"]["jwtToken"]
refreshToken = data['data']['refreshToken']
FEED_TOKEN = feedtokenres = obj.getProfile(refreshToken)
res["data"]["exchanges"]
print (res)And also please find the error message. It is pointing at the jwtToken but I have been using the same since long and the system is also returning the same :
TypeError Traceback (most recent call last)
Cell In[4], line 5
3 data = obj.generateSession(clientId, pwd, totp)
4 print(data)
----> 5 AUTH_TOKEN = data ["data"]["jwtToken"]
6 refreshToken = data['data']['refreshToken']
7 FEED_TOKEN = feedtokenTypeError: 'NoneType' object is not subscriptable
-
Hello @opt_trader
Could you please share the header and request body you are passing here
Regards,
SmartAPI Team