Navigation

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

    Not able to fetch Holding details

    C#/.Net SDK
    2
    5
    43
    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.
    • F
      firosh last edited by

      Hi Team,
      'I am not able to fetch my portfolio details. Below is the response I am getting.

      c5d46f7a-8b8b-4796-b96e-d46ddfe1fbc8-image.png

      "Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'AngelBroking.HoldingData' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\r\nPath 'data', line 1, position 58."

      Below is the code. Using this same code I could able to fetch
      getPosition()
      getOrderBook();
      getTradeBook();
      GetProfile()

      string Client_code = "xxxx"; //YOUR CLIENT CODE
      string Password = "xxxx"; //YOUR PASSWORD
       string api_key = "xxxx";
      string JWTToken = ""; // optional
      string RefreshToken = ""; // optional
      SmartApi connect;
      OutputBaseClass obj;
      
                 connect = new SmartApi(api_key, JWTToken, RefreshToken);
                 obj = new OutputBaseClass();
                 //Login by client code and password
                  obj = connect.GenerateSession(Client_code, Password);
                  AngelToken agr = obj.TokenResponse;
                  //Get Token
                  obj = connect.GenerateToken();
                  agr = obj.TokenResponse;
      
      
      
                 obj = connect.getHolding();
                  if (obj.status)
                  {
                      return obj.GetHoldingResponse.data;
                  }
      
      A 1 Reply Last reply Reply Quote 0
      • A
        admin @firosh last edited by

        Hi @firosh Your issue has been reported.

        F 1 Reply Last reply Reply Quote 0
        • F
          firosh @admin last edited by

          @admin Any update on this?

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

            HI @firosh We will update you on this.

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

              hi @firosh Please download the latest copy of DLL from git repo DLL folder and add reference to your project .

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