WebSocket API

The WebSocket API is our preferred method of delivering you your end-device data as it is:

  • Cloud-friendly (existing HTTP traffic optimisation can be used)
  • Bi-directional, real-time interface
  • Easy to implement
  • Lower overhead compared to REST
  • Supported in all major web browsers and many programming languages

For more information about WebSockets the RFC is a good starting point. In simple terms, it’s just a protocol on top of HTTP, initiated by a HTTP Upgrade request.

Our sample WebSocket application (view source) can help your development.

We only support secure (TLS) WebSockets. Plaintext WebSockets are not allowed.

How to connect

Go to your application page and note the WebSocket URL (it starts with wss://). Provide this to KotahiNet.

Using your favourite programming language, connect to the WebSocket.

Once you get a 101 response to your Upgrade request, the WebSocket connection has succeeded and can listen for incoming data as well as be used to send data to your devices.