Navigation

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

    Please send JSONObject or JSONArray for return type of smartconnect.candleData(JSONObject params)

    NodeJS SDK
    2
    7
    65
    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.
    • V
      vvbchandrasekhar last edited by

      Folks, it is hard to process the return type of String to fetch the data we need. can you return the JSONObject or or JSONArray in the com.angelbroking.smartapi.SmartConnect?

      I know you may have converted to String to print, but you can print the String, but pass the actual JSONObject or JSONArray.


      com.angelbroking.smartapi.SmartConnect.java:
      ...
      public String candleData(JSONObject params) {
      try {
      String url = routes.get("api.candle.data");
      JSONObject response = smartAPIRequestHandler.postRequest(this.apiKey, url, params, accessToken);
      System.out.println(response);

      Please pass the response itself below instead of response.getString("data")

      	return response.getString("data"); 
      	}
      	catch(Exception | SmartAPIException e) {
      		System.out.println(e.getMessage());
      		return null;
      	}
      }
      
      A 1 Reply Last reply Reply Quote 0
      • A
        admin @vvbchandrasekhar last edited by

        Hi @vvbchandrasekhar we will discuss this with our team and update you.

        V 1 Reply Last reply Reply Quote 0
        • V
          vvbchandrasekhar @admin last edited by

          @admin thank you. let me know once this is fixed

          A 1 Reply Last reply Reply Quote 0
          • A
            admin @vvbchandrasekhar last edited by

            Hi @vvbchandrasekhar we have noted this as one of our product enhancement feature and we will try to make this changes in next release.

            V 1 Reply Last reply Reply Quote 0
            • V
              vvbchandrasekhar @admin last edited by

              @admin thanks! i got the code working with some json parsing on my side. not really needed now.

              A 1 Reply Last reply Reply Quote 0
              • A
                admin @vvbchandrasekhar last edited by

                Hi @vvbchandrasekhar ok.

                1 Reply Last reply Reply Quote 0
                • J
                  jaskirat1208 last edited by

                  Any updates on this?

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