403 ERROR Request blocked

Hello,

I am trying to place the order using C++ code. It gives error like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Request blocked.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: PhkcJIt1brXGOd5M5X_meq86hXMV0Rnwg6qC0fJs2cBD2ewNZCJlGA==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>

In code, I am using the url as “https://api-hft.upstox.com/v2/order/place”:

Can you check why I am not able to place order using this code and guide me if at all I am doing anything wrong ?

Thanks,
Saurabh
User ID:196847
Client Id:01111129

@saurabhkumarbansal

Please have this checked - 403 Forbidden for Trade Orders API - #3 by shanmu

Thanks!

Hello @shanmu

The curl utility when launched from terminal works:

curl --location 'https://api-hft.upstox.com/v2/order/place' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer my_token' \
--data '{
  "quantity": 1,
  "product": "D",
  "validity": "DAY",
  "price": 4400.1,
  "tag": "string",
  "instrument_token": "BSE_EQ|INE467B01029",
  "order_type": "LIMIT",
  "transaction_type": "BUY",
  "disclosed_quantity": 0,
  "trigger_price": 0,
  "is_amo": false
}'

The status is success: {“status”:“success”,“data”:{“order_id”:“240820000336503”}}

But I facing the problem if I am using curl functions in C++ using url as “https://api-hft.upstox.com/v2/order/place”. I observed that the problem does not arise when using old url “https://api.upstox.com/v2/order/place”.
Why the new enhanced url giving error when used in C++ ?

Thanks,
Saurabh

any takers of this issue :slightly_smiling_face:

@shanmu @Pradeep_Jaiswar