Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. sugagenius
    3. Posts
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 7
    • Best 2
    • Groups 0

    Posts made by sugagenius

    • RE: scripconsent order parameter missing in Java library. Order placement fails with Null

      I fixed the issue by changing 3 files in the JAVA SDK code and rebuilding it. I doubt fixing Order.java alone would resolve this.

      I fixed SmartConnect.java -> params.put("scripconsent", "yes");

      Order.java ->
      @SerializedName("scripconsent")
      public String scripconsent

      and OrderParams.java ->
      public String scripconsent

      Now I can see AMO orders reaching Angel One :). Huge relief. Will re-check on Monday once the exchanges are online just to be sure.

      posted in Java SDK
      S
      sugagenius
    • RE: scripconsent order parameter missing in Java library. Order placement fails with Null

      Even if I ignore the fix for Order.java, my fix on SmartConnect.java should have got my order submitted at least to the exchange. But that didnt happen. How sending the post request is affected by not modifying Order.java. Order.java is used for receiving the data. I see no Error while sending the postRequest or while receiving the postRequest inside the API JAR. I see only this after receiving the response. Basically, the request is not even reaching the server for such scripts I think. That is the reason we get null. but this issue is not seen in the SDK logs.

      posted in Java SDK
      S
      sugagenius
    • RE: scripconsent order parameter missing in Java library. Order placement fails with Null

      I changed the SmartConnect.java.
      Just before sending the order in placeOrder() method, I added this line "params.put("scripconsent", "yes")"

      But you have mentioned Order.java as well. I will rectify that as well. I see that Order.java is used for serialization/deserilization. Let me fix and retry tomorrow. I can test only when market is live. Is there any way to test such things when market is off ?

      posted in Java SDK
      S
      sugagenius
    • RE: scripconsent order parameter missing in Java library. Order placement fails with Null

      Even after replacing the class with the missing parameter, I still a null pointer error.

      posted in Java SDK
      S
      sugagenius
    • RE: scripconsent order parameter missing in Java library. Order placement fails with Null

      @sugagenius In fact I wasted a lot of effort only to find this as the root cause. The APIs failed silently with Null pointer exception. It is from my great effort and experience i were able to find something out of nowhere.

      posted in Java SDK
      S
      sugagenius
    • RE: scripconsent order parameter missing in Java library. Order placement fails with Null

      @algo_trading_50 That defeats the purpose of using an SDK JAR released. It adds additional burden for me to compile and build such things. I should be able to use the jar straight away from Angel one. I have bigger things to do.

      posted in Java SDK
      S
      sugagenius
    • scripconsent order parameter missing in Java library. Order placement fails with Null

      The scripconsent=yes parameter cannot be set with smartconnect smartapi-java-2.2.6.jar which is the latest. I get an error as below from SmartConnect API:

      2026-02-18 13:27:55.094 ERROR [ Transaction-0] com.angelbroking.smartapi.SmartConnect : [316] JSONObject["data"] is not a JSONObject (class org.json.JSONObject$Null : null).

      My order placement fails. Upon investigation I found I get error only for certain stocks like stocks of BSE shares which are cautionary. I dont get this when i place orders for stocks like HDFC or SILVERMIC.

      I cant override or cannot do much. I have done all my code with your JAVA APIs, and now I am stuck in this blocker. Please update the JAVA API, if smartconnect API added any changes so that your API documentation is in sync with your Java implementation.

      posted in Java SDK
      S
      sugagenius