Navigation

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

    Data Pull Failed with Error - Couldn't parse the JSON response received from the server: b''

    Test
    0
    3
    14
    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.
    • T
      TheM3 last edited by

      After stablishing the connection to SmartAPI, I am trying to pull the historic data. While pulling the data I am getting this error: Data Pull Failed with Error - Couldn't parse the JSON response received from the server: b''

      Kindly help me.
      Regards,
      TheM3

      M 1 Reply Last reply Reply Quote 0
      • M
        Moderator_3 @TheM3 last edited by

        Hello @TheM3
        Could you please share the request body and header so that we can have a look on it
        Regards,
        SmartAPI Team

        1 Reply Last reply Reply Quote 0
        • R
          rr33 last edited by

          Same error while testing place_order() functionality

          #place order
          try:
              orderparams = {
                  # "variety": "NORMAL",
                  "tradingsymbol": "DIL",
                  "symboltoken": "8657",
                  "exchange": "NSE",
                  "transactiontype": "BUY",
                  "ordertype": "MARKET",
                  "producttype": "CNC",
                  "price": "7.8",
                  "duration": "DAY",
                  "triggerprice" : "7.8",
                  "squareoff": "9",
                  "stoploss" : "5",
                  "trailingStopLoss" : "0.1",
                  "disclosedquantity" : '1',
                  "quantity": "1",
                  "ordertag" : "testing",
                  }
              # Method 1: Place an order and return the order ID
              orderid = smartApi.placeOrder(orderparams)
              logger.info(f"PlaceOrder : {orderid}")
              # Method 2: Place an order and return the full response
              response = smartApi.placeOrderFullResponse(orderparams)
              logger.info(f"PlaceOrder : {response}")
          except Exception as e:
              logger.exception(f"Order placement failed: {e}")
          
          raise ex.DataException("Couldn't parse the JSON response received from the server: {content}".format(
              SmartApi.smartExceptions.DataException: Couldn't parse the JSON response received from the server: b''
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post