Navigation

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

    400 Bad Request Error When Placing Order with AngelOneWebView (React Native + Axios)

    General Discussion
    0
    15
    75
    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.
    • M
      Moderator_3 @sahil08 last edited by

      Hello @sahil08
      Currently we don't havce the CNC product type Can you please use the product Type as Delivery

      Regards,
      SmartAPI Team

      S 1 Reply Last reply Reply Quote 0
      • S
        sahil08 @Moderator_3 last edited by

        @Moderator_3 Still I am gettin 400 Bad Request , even after changing producttype to DELIVERY , can you please confirm that the auth_token that I get after login in the redirected uri , i.e after logging in through this https://smartapi.angelbroking.com/publisher-login?api_key=xxx, I get a redirected to a url which has auth_token , feed_token , refresh_token in params, can I use that auth_token as Bearer token in the request header?? Please can you confirm that

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

          Hello @sahil08
          Yes, you can use the auth_token as Barear in header.But you request is not vaolid json so please put all the keys also in double quots ("") then try the same

          Regards,
          SmartAPI Team

          S 1 Reply Last reply Reply Quote 0
          • S
            sahil08 @Moderator_3 last edited by

            @Moderator_3 I have tried with all the keys also in double quots ("") in Postman , still it gives 400 Bad Request , I am attaching screenshots of my Postman request

            5dcde50e-c2c8-4368-8726-da764bc5bf94-image.png

            59250ea5-0a05-4b01-80dc-2cc7185c29cf-image.png

            Please help me find the solution to it

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

              Hello @sahil08

              Can you please share the request body here so that we can have a look on that

              Regards,
              SmartAPI Team

              S 4 Replies Last reply Reply Quote 0
              • S
                sahil08 @Moderator_3 last edited by

                @Moderator_3 Sure

                {
                "variety": "NORMAL",
                "tradingsymbol": "SBIN-EQ",
                "symboltoken": "3045",
                "transactiontype": "BUY",
                "exchange": "NSE",
                "ordertype": "MARKET",
                "producttype": "DELIVERY",
                "duration": "DAY",
                "price": "",
                "squareoff": "0",
                "stoploss": "0",
                "quantity": "1"
                }

                This is my request body

                1 Reply Last reply Reply Quote 0
                • S
                  sahil08 @Moderator_3 last edited by

                  @Moderator_3 This is my request body data

                  {
                  "variety": "NORMAL",
                  "tradingsymbol": "SBIN-EQ",
                  "symboltoken": "3045",
                  "transactiontype": "BUY",
                  "exchange": "NSE",
                  "ordertype": "MARKET",
                  "producttype": "DELIVERY",
                  "duration": "DAY",
                  "price": "",
                  "quantity": "1"
                  }

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

                    @Moderator_3 Hey any update on this

                    1 Reply Last reply Reply Quote 0
                    • S
                      sahil08 @Moderator_3 last edited by

                      @Moderator_3 @admin I have provided the request body , can you please check and provide me the solution

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

                        Hello @sahil08

                        Kindly check your header body Since you are not sending the mac address, client public IP and client locla Ip.
                        Kindly modify the header body then try

                        Regards,
                        SamartAPI Team

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          sahil08 @Moderator_3 last edited by

                          @Moderator_3 Are those compulsory values to be passed in header? and I am using React Native and WebView , so X-SourceID should be Web or Mobile ?, please help me with it

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

                            Hello @sahil08

                            The value of headers should be as per the documentation as mentioned below
                            https://smartapi.angelbroking.com/docs/ResponseStructure

                            Regards,
                            SmartAPI Team

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              sahil08 @Moderator_3 last edited by

                              @Moderator_3 Can you help me to know , how do we get MACaddress and local ip for ios using React Native

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

                                Hello @sahil08

                                Open Cmd prompt and type ipconfig/all there you can see

                                • Physical Address is the MAC address

                                • IPv6 Address is the local ip

                                Regards,
                                SmartAPI Team

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