Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. pankaj8932
    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 12
    • Best 0
    • Groups 0

    pankaj8932

    @pankaj8932

    1
    Reputation
    5
    Profile views
    12
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    pankaj8932 Unfollow Follow

    Latest posts made by pankaj8932

    • Websocket error "Error observed : {"isTrusted":true}"

      Hi,

      I am trying to create websocket connection using java script but it gives this error. I used below url format to connect the server where I have replaced variables with actual value. I am able to get profile information using simple get profile api call but websocket connect doesn't work.

      It says failed to connect and gives this error "Error observed : {"isTrusted":true}" Can anybody please help me here?
      My client Id : P51757

      let NEW_URL = "wss://smartapisocket.angelbroking.com/websocket?jwttoken=" + JWT_TOKEN + "&&clientcode=" + FEED_TOKEN + "&&clientcode=" +CLIENT_CODE+ "&&apikey=" +API_KEY + "&&feedType=" + FEED_TYPE
      let websocketObj = new WebSocket(NEW_URL);
      websocketObj.onopen = function() {
                  let strwatchlistscrips = "nse_cm|2885&nse_cm|1594&nse_cm|11536";
                  var _watchReq = '{"task":"mw","channel":"' + strwatchlistscrips + '","token":"' + FEED_TOKEN + '","user": "' + CLIENT_CODE + '","acctid":"' + CLIENT_CODE + '"}'; 
                  console.log('connection req : ' + _watchReq);
                  websocketObj. send(_watchReq);
                  console.log('socket opened.')
              }
      websocketObj.onerror = function(error) {
                  console.log('Error observed : ' + JSON.stringify(error));
                };
      
      posted in Bugs
      P
      pankaj8932
    • Not getting mw feed from websocket

      Hello sir,

      I have subscribed using your websocket api using below code. Not sure what is the issue but I am getting token instead of market feed. Can you please let me know what is causing the issue here.?</br></br>

      var websocketObj = new websocketObj("wss://omnefeeds.angelbroking.com/NestHtml5Mobile/socket/stream");</br>
      var _req = '{"task":"cn","channel":"","token":"' + FEED_TOKEN + '","user": "' + CLIENT_CODE + '","acctid":"' + CLIENT_CODE + '"}'; </br>

      websocketObj.send(_req); </br>

      var strwatchlistscrips = "nse_cm|2885&nse_cm|1594&nse_cm|11536";</br>

      var _req = '{"task":"mw","channel":"' + strwatchlistscrips + '","token":"' + FEED_TOKEN + '","user": "' + CLIENT_CODE + '","acctid":"' + CLIENT_CODE + '"}'; </br>

      websocketObj.send(_req); </br></br>

      I am getting tokens returned ("XXXXXXXXXXXXXXXXXXX") instead of market feed. Can you please help me on this.

      posted in Python SDK
      P
      pankaj8932
    • RE: 'TypeError' object has no attribute 'message' Error while placing order

      @admin Can you please check what is the issue with my user. Is there any settings need to enable for my user?

      posted in Python SDK
      P
      pankaj8932
    • 'TypeError' object has no attribute 'message' Error while placing order

      Hello sir, I am unable to place order using your sample code. I am able to generate tokens but while placing order it gives error "'TypeError' object has no attribute 'message'" . I am using below code</br>
      </br>

      obj=SmartConnect(api_key="XXXX") #"XXXX replaced with api key"</br>
      data = obj.generateSession("P51757","XXXX") #"XXXX replaced with pass"</br>
      refreshToken= data['data']['refreshToken']</br>
      feedToken=obj.getfeedToken()</br>
      userProfile= obj.Profile(refreshToken)</br>

      try:</br>
      orderparams = {</br>
      "variety": "NORMAL",</br>
      "tradingsymbol": "SBIN-EQ",</br>
      "symboltoken": "3045",</br>
      "transactiontype": "BUY",</br>
      "exchange": "NSE",</br>
      "ordertype": "LIMIT",</br>
      "producttype": "MARGIN",</br>
      "duration": "DAY",</br>
      "price": "477",</br>
      "squareoff": "0",</br>
      "stoploss": "0",</br>
      "quantity": "1"</br>
      }</br>
      orderId=object.placeOrder(orderparams)</br>
      print("The order id is: {}".format(orderId))</br>
      return orderId</br>
      except Exception as e:</br>
      print("Order placement failed: {}".format(e.message))</br>
      return "Not Placed"</br>
      </br>
      Can you please let me know what causing the issue.
      Thanks

      posted in Python SDK
      P
      pankaj8932
    • RE: can't login , Getting "USER IS BLOCKED FOR TRADING" error

      @admin Can you check this?

      posted in NodeJS SDK
      P
      pankaj8932
    • RE: can't login , Getting "USER IS BLOCKED FOR TRADING" error

      @Jeet-Pattani This form I already had submitted earlier. And API was working for me after that. It again stopped working after some time ... Can you do the needful to fix this.

      posted in NodeJS SDK
      P
      pankaj8932
    • can't login , Getting "USER IS BLOCKED FOR TRADING" error

      Hello sir,

      I am using Java SDK and getting below error while trying to login using smart api.

      "message":"USER IS BLOCKED FOR TRADING",
      "errorcode":"AB1007"

      Can you please do the needful

      my client ID is P51757

      posted in NodeJS SDK
      P
      pankaj8932
    • RE: JSONObject["data not found"] not found.

      @admin
      SmartConnect smartConnect = new SmartConnect();
      smartConnect.setApiKey(angel_api_key);
      smartConnect.generateSession(angel_userId, angel_password); (Error in this line)

      It gives below error
      Exception in thread "main" org.json.JSONException: JSONObject["data not found"] not found.

      posted in NodeJS SDK
      P
      pankaj8932
    • RE: JSONObject["data not found"] not found.

      @admin Now I can place the intraday/margin sell order first through app/desktop but now I am unable to access API. It gives same error again " JSONObject["data not found"] not found".

      I think these issues are interrelated. Can you please check from your side what is causing the issue.

      posted in NodeJS SDK
      P
      pankaj8932
    • RE: JSONObject["data not found"] not found.

      @admin After migration I can access API with no issues. But now I am unable to place sell order from app. Every time it says "Trade in Margin product type is not allowed". When changing to Intraday again it says "Intraday trade is not allowed"

      Always I have to buy first then sell. If I do sell first then it gives above error. Earlier I was able to place this order. Can you check what goes wrong in my account?

      Same I tried in code and it give error if I use product type as PRODUCT_INTRADAY or PRODUCT_MIS

      posted in NodeJS SDK
      P
      pankaj8932