Automation of Dhan Access token

Dear @Tradehull_Imran sir,

Is there any proper way we can automate setting the Dhan Access token daily before the market starts?

As of now, I am running my strategy from my laptop, and planning to move it to a server. Looking for a way to have it 100% automated.

Thanks in advance!

best Regards.

@Hitesh_G Generate API Key instead of Access Token from Dhan account and automate login using headless chrome. Follow API docs to maintain a proper login flow to receive an access token in the end.

Hi @Hitesh_G ,

You can automate the access token generation process using the API Key and Secret. This mechanism allows your system to seamlessly generate valid tokens without manual intervention.

To explore the implementation flow for the same, you may refer to our documentation available at the link here - Authentication - DhanHQ Ver 2.0 / API Document

Hi @Hitesh_G ,

You can upgrade the codebase version and use the pin+totp method which automatically generates access token without any manual effort, refer the below thread and follow the process to use that method -

1 Like

Thank you Sir.

1 Like