403 Forbidden for Trade Orders API

Hi, I am able to successfully fetch LTP Quotes, Fund And Margin details using API’s but when it comes to Order API’s like Place Order and Cancel order, I am getting results 403 Forbidden status.

https://api-hft.upstox.com/v2/order/cancel?order_id=240805026268214

response.Content.ReadAsStringAsync().Result also gives HTML error message that says below,

ERROR: The request could not be satisfied\n\n

403 ERROR

\n

The request could not be satisfied.

\n
\nRequest blocked.\nWe 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.\n
\nIf you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n
\n
\n
\nGenerated by cloudfront (CloudFront)\nRequest ID: eNJ5vutoR9visvI0GR7ZB9LbpJPJxPpWaUVg1K7aW-c1cWcAc2He-A==\n
\n\n

Please help me understand if there is any mistake from my end or issue with your server.

Can someone please take a look at my issue and suggest.

@Mahendra_Daware,

That is unusual. Could you please execute the following cURL command on your terminal to help clarify the situation?

curl --location --request DELETE 'https://api-hft.upstox.com/v2/order/cancel?order_id={your_order_number}' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

This should give us a better understanding. Thank you!

Yes, curl command works. I will troubleshoot my c# from my end. Thanks for your reply.

1 Like