# Websocket interface

**URL:** <https://community.developer.atlassian.com/t/websocket-interface/34586>\
**Category:** Trello\
**Tags:** trello\
**Created:** [December 27, 2019, 12:18am UTC](https://community.developer.atlassian.com/t/websocket-interface/34586 "2019-12-27T00:18:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![FabioManganiello](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/fabiomanganiello/32/39007_2.png) [@FabioManganiello](https://community.developer.atlassian.com/u/FabioManganiello)\
**Post date:** [December 27, 2019, 12:18am UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/1 "2019-12-27T00:18:56Z")

</div>

I’ve been building a Trello integration on top of my automation project and something I’m missing is the possibility to easily subscribe to board updates over websocket. The provided webhook interface is great, but it requires a callback URL hosted on a machine with an IP address reachable from the Trello servers. For the sake of flexibility and easier integration, it’d be great to have a websocket interface as well, similar to what’s provided by Todoist. A client would open a connection to a private token-authorized websocket server and updates would be streamed there in the same format they’re currently provided to the webhooks. Such a mechanism would remove much of the security/management burden required by webhooks, and it’d also allow local machines without a public IP addresses (like a RaspberryPi connected to a home network) to subscribe to Trello updates.

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [December 30, 2019, 8:10pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/2 "2019-12-30T20:10:06Z")

</div>

Thanks for the feedback, @FabioManganiello. The Trello web client uses websockets to remain synced and up-to-date with changes occurring in the backend, so it is something that we’re familiar with. Although it isn’t something that is officially supported nor documented it might be worth checking out what the Trello web client is doing and seeing if you can subscribe to the same websockets it is using.

I’ll pass this along to the team so that they know there is interest in a publicly available and supported websockets interface.

---

<div class="post-metadata">

**Author:** ![FabioManganiello](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/fabiomanganiello/32/39007_2.png) [@FabioManganiello](https://community.developer.atlassian.com/u/FabioManganiello)\
**Post date:** [January 2, 2020, 8:27pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/3 "2020-01-02T20:27:24Z")

</div>

Thanks for the reply! I’ve managed to get some insights on the protocol by debugging the connection on `wss://trello.com/1/Session/socket?token=<token>`. However, when I try to use my own long-lived token I get an `unauthorized` error. At first glance, it looks that the token follows the format `<board_id>/<token>`. Is that actually the case? That’d be quite unpractical - I’d have to open as many websocket connections as the number of boards that I want to subscribe.

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [January 2, 2020, 8:39pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/4 "2020-01-02T20:39:00Z")

</div>

> [@FabioManganiello](#):
>
> At first glance, it looks that the token follows the format `<board_id>/<token>` . Is that actually the case?

That sounds correct as the web client only ever has a single board open at a time. So only needs to receive updates regarding a single board.

---

<div class="post-metadata">

**Author:** ![FabioManganiello](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/fabiomanganiello/32/39007_2.png) [@FabioManganiello](https://community.developer.atlassian.com/u/FabioManganiello)\
**Post date:** [January 2, 2020, 9:08pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/5 "2020-01-02T21:08:26Z")

</div>

At a closer look it seems that the format is actually `<user_id>/<token>`. However, I’ve tried both the combinations `<user_id>/<token>` and `<board_id>/<token>`, where `<token>` is a long-lived token I previously got from `/authorize`: neither of them works (still `unauthorized` when I send a board subscription request). Things work instead if I use the token used by an active web client session. Are those different types of token? The token provided by the API is a shorter hex-encoded token, while the one used by the web client is longer and base64-encoded.

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [January 10, 2020, 7:54pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/6 "2020-01-10T19:54:54Z")

</div>

Asking more about this internally and have found that the only types of tokens currently supported are those from active web client sessions, unfortunately.

---

<div class="post-metadata">

**Author:** ![FabioManganiello](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/fabiomanganiello/32/39007_2.png) [@FabioManganiello](https://community.developer.atlassian.com/u/FabioManganiello)\
**Post date:** [January 13, 2020, 3:06pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/7 "2020-01-13T15:06:28Z")

</div>

Would it be possible to extend it to API tokens? It sounds like a relatively low-hanging fruit to me, and since the format of the messages returned by the websocket interface is quite straightforward, it’d make interaction much simpler.

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [January 13, 2020, 8:05pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/8 "2020-01-13T20:05:05Z")

</div>

I’m talking with folks now to see how feasible it is for us to extend and support this. Once I hear more, I’ll let you know.

---

<div class="post-metadata">

**Author:** ![FlorianBellmann](https://avatars.discourse-cdn.com/v4/letter/f/c37758/32.png) [@FlorianBellmann](https://community.developer.atlassian.com/u/FlorianBellmann)\
**Post date:** [October 10, 2022, 2:02pm UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/9 "2022-10-10T14:02:48Z")

</div>

Hey, is there any update on this? I feel like a lot of apps for trello could benefit from the websocket connection 🙂

---

<div class="post-metadata">

**Author:** ![FabioManganiello](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/fabiomanganiello/32/39007_2.png) [@FabioManganiello](https://community.developer.atlassian.com/u/FabioManganiello)\
**Post date:** [November 18, 2023, 8:57am UTC](https://community.developer.atlassian.com/t/websocket-interface/34586/10 "2023-11-18T08:57:11Z")

</div>

For those who are still interested, I’ve managed to get things to work by:

1. Setting up a websocket connection to `wss://trello.com/1/Session/socket?clientVersion=build-194674`
2. Adding the `cloud.session.token` cookie to the connection, sniffed from a UI session
