'error_code': 'DH-905', 'error_type': 'Input_Exception', 'error_message': 'Missing required fields, bad values for parameters etc

df = dhan.historical_daily_data(security_id=‘ACC’,exchange_segment=‘NSE_EQ’,instrument_type=‘Equity’, expiry_code=0,from_date=‘2025-01-01’,to_date=‘2025-03-31’)

df = dhan.historical_daily_data(‘ACC’,‘NSE_EQ’,‘Equity’,‘2025-01-01’,‘2025-03-31’)

df = dhan.historical_daily_data(‘1333’,‘NSE_EQ’,‘Equity’,‘2025-01-01’,‘2025-03-31’)

all above 3 examples, it gives following error. Pl. help.

{‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-905’, ‘error_type’: ‘Input_Exception’, ‘error_message’: ‘Missing required fields, bad values for parameters etc.’}, ‘data’: {‘errorType’: ‘Input_Exception’, ‘errorCode’: ‘DH-905’, ‘errorMessage’: ‘Missing required fields, bad values for parameters etc.’}}
–Return–

1 Like

Hi @SEBI.RA.Samir.Sir,

As per the code you shared, we request you to enter the security ID instead of the scrip name.

Security ID - Instrument List - DhanHQ Ver 2.0 / API Document

Happy Trading !

@Shubham_Singh
Hi Experts,
I am making forever sell order through Dhan API using google script. I have successfully given forever buy order but issue is I am unable to modify it. I have gone though API documentation but no help found.
Please see the error log and identify what is missing here for which order is not getting modified.

12:37:07 AM Info Payload sent: {dhanClientId:11073301xx,orderId:4132507271300,securityId:14592,orderFlag:SINGLE,orderType:LIMIT,quantity:9,price:899.70,disclosedQuantity:1,triggerPrice:899.60,validity:DAY}
12:37:08 AM Info :warning: Failed to Modify SL → FORTIS, Response: {errorType:Input_Exception,errorCode:DH-905,errorMessage:Missing required fields, bad values for parameters etc.}

Same error getting even using MARKET order. Please help.

11:05:19 PM Info Payload sent: {dhanClientId:11073301xx,orderId:6132507282040,orderFlag:SINGLE,orderType:MARKET,legName:ENTRY_LEG,productType:CNC,quantity:5,price:,disclosedQuantity:1,triggerPrice:842.45,validity:DAY}
11:05:19 PM Info :warning: Failed to Modify SL → FORTIS, Response: {errorType:Input_Exception,errorCode:DH-905,errorMessage:Missing required fields, bad values for parameters etc.}