400 Bad Request Error When Placing Order with AngelOneWebView (React Native + Axios)
-
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 tryRegards,
SamartAPI Team -
@Moderator_3 @admin I have provided the request body , can you please check and provide me the solution
-
@Moderator_3 Hey any update on this
-
@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"
} -
@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
-
Hello @sahil08
Can you please share the request body here so that we can have a look on that
Regards,
SmartAPI Team -
@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
Please help me find the solution to it
-
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 sameRegards,
SmartAPI Team -
@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
-
Hello @sahil08
Currently we don't havce the CNC product type Can you please use the product Type as DeliveryRegards,
SmartAPI Team