# Can I fetch all parties via the streaming api?

**URL:** <https://forum.canton.network/t/can-i-fetch-all-parties-via-the-streaming-api/1882>\
**Category:** App Development\
**Created:** [January 4, 2021, 2:45pm UTC](https://forum.canton.network/t/can-i-fetch-all-parties-via-the-streaming-api/1882 "2021-01-04T14:45:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [January 4, 2021, 2:45pm UTC](https://forum.canton.network/t/can-i-fetch-all-parties-via-the-streaming-api/1882/1 "2021-01-04T14:45:51Z")

</div>

I would like to use the streaming equivalent of the `/v1/parties` endpoint.

I cannot see any hint on this in the documentation: [https://docs.daml.com/json-api/index.html#streaming-api](https://docs.daml.com/json-api/index.html#streaming-api)

And the `v1/stream/parties` endpoint doesn’t seem to work. I was trying with this code, as an analogy to the example code snippet in the docs:

```haskell
const tokenPrefix = "jwt.token.";
const jwt = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwczovL2RhbWwuY29tL2xlZGdlci1hcGkiOnsibGVkZ2VySWQiOiJjcmVhdGUtZGFtbC1hcHAtc2FuZGJveCIsImFwcGxpY2F0aW9uSWQiOiJmb29iYXIiLCJhY3RBcyI6WyJBbGljZSJdfX0.ahT0RApOdZlrC5u0BH7ybdQcYY_DKLDQkdPCK8dz3R4";
const subprotocols = [`${tokenPrefix}${jwt}`, wsProtocol];
const ws = new WebSocket("ws://localhost:7575/v1/stream/parties", subprotocols);
 
ws.addEventListener("message", function incoming(data) {
		app.ports.partiesStream.send(event.data);

	});

```

The error message is:

`WebSocket connection to 'ws://localhost:7575/v1/stream/parties' failed: Unexpected response code: 404`

The `v1/stream/query` end point works.

Is this streaming endpoint not supported?

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [January 4, 2021, 2:46pm UTC](https://forum.canton.network/t/can-i-fetch-all-parties-via-the-streaming-api/1882/2 "2021-01-04T14:46:49Z")

</div>

There is no streaming version of the parties endpoint at this point. This applies to both the gRPC Ledger API as well as to the JSON API. So for now, you have to keep polling to discover new parties.

---

<div class="post-metadata">

**Author:** ![gyorgybalazsi](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gyorgybalazsi/32/684_2.png) [@gyorgybalazsi](https://forum.canton.network/u/gyorgybalazsi)\
**Post date:** [January 4, 2021, 2:50pm UTC](https://forum.canton.network/t/can-i-fetch-all-parties-via-the-streaming-api/1882/3 "2021-01-04T14:50:46Z")

</div>

Thank you!
