Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    getCandle function is throwing error and returning null

    NodeJS SDK
    0
    5
    30
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dipeshbodas last edited by

      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.

      D 1 Reply Last reply Reply Quote 0
      • D
        dipeshbodas @dipeshbodas last edited by

        @dipeshbodas

        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);
        
        P 1 Reply Last reply Reply Quote 0
        • D
          dipeshbodas last edited by

          @admin please check

          1 Reply Last reply Reply Quote 0
          • P
            pashriva @dipeshbodas last edited by

            @dipeshbodas

            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.

            362d580b-575c-4f22-8334-1b4688a2ff0a-image.png

            @admin please help

            D 1 Reply Last reply Reply Quote 0
            • D
              dipeshbodas @pashriva last edited by

              @pashriva
              Thanks for replying. Did exactly same and resolved at my end.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post