DHAN Webhook - 500 Internal Server Error

Hi,

Iam trying to send automated orders using dhan webhook. But getting the following error

{
“timestamp”: “2023-12-26T07:55:14.155+00:00”,
“status”: 500,
“error”: “Internal Server Error”,
“path”: “/tv/alert/ebfbcc2b1c3745e9956eb5878ea7b692/ADFE6820”
}

Hello @marketcalls

Welcome to Dhan Community!

Are you trying to send POST request directly on the Webhook URL via Postman or any other tool?

Tried using Tradingview - orders are not punching and so tried with postman
getting the above-mentioned error. Yes I tried sending a post request from postman

@marketcalls

You can post the JSON message being generated from TradingView alerts, and we can take a look.

Meanwhile, for the postman request error, this happens because we have built Webhooks only for alerts coming from TradingView.com, and not any other source (in this case, your own system).

Here is the JSON Message used in tradingview

{“secret”:“wyv7c”,
“alertType”:
“multi_leg_order”,
“order_legs”:
[{“transactionType”:“B”,
“orderType”:“MKT”,
“quantity”:“1”,
“exchange”:“NSE”,
“symbol”:“NIFTY1!”,
“instrument”:“FUT”,
“productType”:“M”,
“sort_order”:“1”,
“price”:“0”}]}

Hello @marketcalls

Checked logs for this. Over here, the JSON secret that you are passing is different from the one which is currently active for your ID.

Do note that Webhook URL is mapped to JSON secret, as authentication. And every time a new Webhook URL is generated, JSON secret is also changed.

This means that at any given point of time, only one Webhook URL is active with a secret code.