Skip to content
Hoody.com

Subscribe to in-container notifications in real time. The primary transport is a WebSocket: the client sends an upgrade request and receives 101 Switching Protocols, then reads JSON notification and heartbeat messages from the open socket. A non-upgrade GET request receives a 200 text/event-stream response as a fallback. Use this when the client needs push-based updates without polling. For background on the notification model and display IDs, see the Notification Server overview.

Establishes a WebSocket connection for real-time notification updates. The server replies with a 101 Switching Protocols response, after which the client receives a continuous stream of notification messages and periodic heartbeat messages for the subscribed displays. Pass a comma-separated list of display IDs in the displays query parameter, or all to subscribe to every display in the container. Display IDs start at 1; there is no display :0.

NameInTypeRequiredDescription
displaysquerystringNoComma-separated display IDs (1,:2,3), or all / * for every display. Required for SSE (400 without it). Optional for WebSocket: without it the socket receives nothing until the client sends a subscribe message; an invalid ID arrives as an error frame after the upgrade.

A successful handshake returns 101 Switching Protocols. The response carries no body; after this point the connection is a WebSocket and the client begins receiving notification and heartbeat messages.

The endpoint upgrades HTTP to WebSocket. curl will perform the handshake, but maintaining the open socket and consuming messages requires a WebSocket-capable client. The example below shows the upgrade request with the displays query parameter.

Terminal window
curl -i \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
"https://{projectId}-{containerId}-n-1.{server}.containers.hoody.com/api/v1/notifications/stream?displays=1,2,3"
Terminal window
curl -i \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" \
-H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \
"https://{projectId}-{containerId}-n-1.{server}.containers.hoody.com/api/v1/notifications/stream?displays=all"