getCandle function is throwing error and returning null
-
smartConnect.candleData(requestObejct) has an issue with code.
SmartConnect class on line 699
return response.getString("data");it's throwning below error while fetching candle
JSONObject["data"] is not a string. -
@pashriva
Thanks for replying. Did exactly same and resolved at my end. -
Hi Raised this issue a few days back. I was able to fix the issue by downloading the project and making the code change and putting the class file in my jar file. But after that it is running into another issue. Check this thread.
@admin please help
-
@admin please check
-
code snippet
SmartConnect smartConnect = new SmartConnect("API_KEY");
User user = smartConnect.generateSession("<username>",<password>"); smartConnect.setAccessToken(user.getAccessToken()); smartConnect.setUserId(user.getUserId()); JSONObject requestObejct = new JSONObject(); requestObejct.put("exchange","NSE"); requestObejct.put("symboltoken","3045"); requestObejct.put("interval", "ONE_DAY"); requestObejct.put("fromdate","2022-03-30 15:35"); requestObejct.put("todate","2022-03-31 15:35"); String response=smartConnect.candleData(requestObejct);