Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 1.01 KB

File metadata and controls

18 lines (13 loc) · 1.01 KB

API Reference

USERSCHATSCONTACTSFILES • WEBSOCKET • JSON


1. Opening a websocket

Connect your websocket client to ws://<server>[:port]/<id>, where id is a DeviceSession id obtained from the login process. After connection succeeds notifications from the websocket client will be received in the following JSON format:

{
   event: "…",      // an event name, such as "message" or "auxiliary"
   source: "…",     // an entity caused this notification, such as user (`id` converted to string) or "system" (or something else in the future)
   payload: <JSON>  // an actual object you need to decode as your data object, such as `ChatMessage`
}

See also: a test with a websocket client example.