Skip to content

Commit

Permalink
Add more dev docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Sep 6, 2024
1 parent 206c36a commit fa54ab5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docs/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,26 @@ Note that there is both a [Definition Version 1](https://api.openshock.app/swagg

The OpenAPI documentation contains all HTTP endpoints, but does not document the WebSockets and SignalR hubs.

## WebSockets
### Authentication

Authentication for applications is done via a API Token which are to be sent as a header with the name/key `Open-Shock-Token`.

You can generate a API Token on the website. [New API Token UI](https://next.openshock.app/settings/api-tokens)

### WebSockets

There is a few different WebSocket endpoints. Most of them use json. The Hub (previously named Device) websocket uses flatbuffers binary serialization.

- /1/
GW = Gateway or LiveControlGateway (e.g. de1-gateway.openshock.app)
API = Main API (e.g. api.openshock.app)

- [GW]/1/ws/live/{deviceId} # Live Control Websocket, json
- [GW]/1/ws/device # Hubs (devices) websocket, flatbuffers
- [API]/1/ws/device # Legacy Hubs (Deprecated, not implemented anymore as of 31.08.2024)

## SignalR

SignalR is a Realtime Messaging Framework developed by Microsoft. The transport way we use is only WebSocket with JSON.

- [API]/1/hubs/user
- [API]/1/hubs/share/link/{id}

0 comments on commit fa54ab5

Please sign in to comment.