Skip to content
Theory · Chat · lesson 4 of 11

API and data model

A messenger has two kinds of API. Almost everything goes over the WebSocket: sending, new messages, receipts, sync. Rare actions stay on HTTPS: create a group, add a member, register a device. The data model is built for three queries: write a message with the next position, read a page of history, and learn which conversations changed.

In this lesson

  • Sending
  • Events for the device
  • Sync and history
  • Messages
  • Conversations and members
  • Index, devices and memory
  • Common mistake
  • Key points