Hi, I am trying to automate the TPIN authorisation for which I am trying to use the /edisbulk/form API. I am able to get the HTML form but how to render it and submit the TPIN?
Trying to use Selenium with python for this use case but since this is HTML code, I am not able to render it. Any help around this would be highly appreciated
I have unescaped using the following code but rendering and moving ahead to fill the TPIN is not working
PS: Currently I don’t have any holding in my account because I am doing development using API and don’t want to misfire anything
Hi @Naman, I’ve written this snippet in my function to write the escaped HTML.
with open('form.html', 'w') as f:
f.write(html.unescape(escaped_html))
On opening it manually, I am getting the following error. Please let me know what should I do? Also, if you have some code already working for this API, it would be really helpful for me
It will be helpful for us to troubleshoot if you can share the HTML code for this CDSL page loaded, so that we know it has all the information as intended in the API response.
In addition to this, can you confirm if you are passing array of ISIN in the variable isin as visible in your code.
Apologies for the late reply, I might have skipped the thread. I did check the CDSL authorisation flow on our open APIs and it is working fine. On the code that you shared, it seems that the HTML was missing some file components, might be because of the libraries used to automate this.
I will request you to try open this once without automating OTP flow. Also, we will soon be adding entire eDIS API flow as part of our Python library, for ease of integration.
@Hardik it would be great if you could help me close this. It’s a blocker for me. I’ve my entire algo system on dhan, and am expecting this to be automated as well.
Any piece of code which you used for testing this would be helpful for me. Also, ETA for the addition of edis API to the python library would help me prioritise accordingly.
Do we need to run this function on loop for all the ISIN, or can we pass on the list? Basically, I want to approve for all the stocks I have in my holding
@Hardik do we have any ETA for bulk ISIN? The individual looping is not practical considering I have ~40 holdings any given point in time.
Also, is there any sandbox environment where I can see my APIs executing? Before deploying into production, I want to ensure that there are no misses. Currently, there is no way to see if the orders are getting placed without putting in real money, which is risky
We are planning this with the next release of the Python library. Since we are parallelly working to release Market Feed APIs as well with the next build, it is difficult to provide you with an ETA here.
There is no such sandbox to test APIs, however, you can try api.dhan.co to call APIs straight from your browser.