# Using websocket to listen for responses related to those orders originally placed through REST API endpoints

**URL:** <https://community.tradovate.com/t/using-websocket-to-listen-for-responses-related-to-those-orders-originally-placed-through-rest-api-endpoints/3770>\
**Category:** Community Support\
**Created:** [January 20, 2022, 5:58pm UTC](https://community.tradovate.com/t/using-websocket-to-listen-for-responses-related-to-those-orders-originally-placed-through-rest-api-endpoints/3770 "2022-01-20T17:58:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fin1](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@fin1](https://community.tradovate.com/u/fin1)\
**Post date:** [January 20, 2022, 5:58pm UTC](https://community.tradovate.com/t/using-websocket-to-listen-for-responses-related-to-those-orders-originally-placed-through-rest-api-endpoints/3770/1 "2022-01-20T17:58:24Z")

</div>

Hi @Alexander ,

Can we have a websocket to listen on subsequent events related to those orders originally placed through REST API endpoints - /placeorder and /placeoso?

We like to use to use small stop losses. As the stop loss orders are rejected by the exchange in certain volatile conditions, we would like to listen for rejection messages and place a new stop loss order.

I hope this makes sense. Please advise. Thank you!

---

<div class="post-metadata">

**Author:** ![fin1](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@fin1](https://community.tradovate.com/u/fin1)\
**Post date:** [January 21, 2022, 3:46pm UTC](https://community.tradovate.com/t/using-websocket-to-listen-for-responses-related-to-those-orders-originally-placed-through-rest-api-endpoints/3770/2 "2022-01-21T15:46:08Z")

</div>

Hi @Alexander ,

Just a quick follow-up for your thoughts. Appreciate your help as always. Thank you!

---

<div class="post-metadata">

**Author:** ![Alexander](https://sea1.discourse-cdn.com/flex015/user_avatar/community.tradovate.com/alexander/32/988_2.png) [@Alexander](https://community.tradovate.com/u/Alexander)\
**Post date:** [January 21, 2022, 3:58pm UTC](https://community.tradovate.com/t/using-websocket-to-listen-for-responses-related-to-those-orders-originally-placed-through-rest-api-endpoints/3770/3 "2022-01-21T15:58:18Z")

</div>

Yes you can use the real time User Data socket. Subscribe to `user/syncrequest` to start a subscription to get a live feed on user data. Initially you’ll receive a big response object that looks like the response object for [this api doc operation](https://api.tradovate.com/#operation/syncRequest). As soon as you place an order, you’ll receive through that websocket messages like this:

```auto
{ e: 'props', d: { entity: Object, entityType: string, eventType: string } }

```

There are a few `entityTypes` that you could watch for. You can watch ExecutionReports to see when a pending order has been filled, or to see rejection status on an order. Or you could watch directly for Orders, which once filled will also come through this way. You can watch for any of the entities listed in that big response object from the link above.
