Data API not returning LTP or OHLC data

@Dhan
After subscribing for data api I received LTP only for 2 days after that it is returning error. I used following google script test code, following API doc, it is also not working .

 const securityIdToTest = '29135';
 const apiUrl = "https://api.dhan.co/v2/marketfeed/ltp";
    
    // The precise, hardcoded payload suggested by the Dhan support team.
    const payload = { "NSE_EQ": [securityIdToTest] };
      
    const options = {
      'method': 'post',
      'contentType': 'application/json',
      'headers': { 
          'access-token': DHAN_DATA_API_ACCESS_TOKEN,
          'client-id': DHAN_CLIENT_ID, 
          'Accept': 'application/json' 
      },
      'payload': JSON.stringify(payload),
      'muteHttpExceptions': true
    };

I am getting following response:
HTTP Response Code: 400

Full Raw Response Body:
{“data”:{“814”:“Invalid Request”},“status”:“failed”}

out of 30 day My code returned LTP for 2 days only and after that it is returning above error, with the same access token is working as trading API and I am successfully buying and selling stock using my algo.
Please help or guide me how to get full refund of the subscription amount 499+gst.

Heyyy @Mrinal_Chakraborty .

It was great connecting with you over the video meet! We’re happy to know that you’re now able to receive the required data successfully using the correct endpoint and request structure.

Glad we could get this sorted for you.

1 Like

Thank You @Trishul_Devadiga ,
With your help I identified the issue.
I was using: const payload = { “NSE_EQ”: [“1333”] };
Correct version is: const payload = { “NSE_EQ”: [1333] };
Security ID should be in number.