Events
Receive realtime events: Socket.IO, SSE, polling. · 3 endpoints
Event type catalog
GET
/api/v1/events/typesNo API key neededExample request
bash
curl "http://127.0.0.1:9900/api/v1/events/types"Get events after a seq cursor (polling)
GET
/api/v1/eventsScope: events:subscribeCall repeatedly with since = pagination.next_since. Events are kept for 7 days / 50,000 records; change this in Settings (Cài đặt).
Parameters
sincequery · optional | integer ≥ 0 · default 0 | The last seq you received |
limitquery · optional | integer ≥ 1 · ≤ 1000 · default 200 | |
typesquery · optional | string[] max 50 items | Filter by event type, e.g. message.*,friend.request.received |
account_idsquery · optional | string[] max 200 items |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/events" \
-H "Authorization: Bearer dpk_xxx"Server-Sent Events stream
GET
/api/v1/events/streamScope: events:subscribeEach event: id: <seq>, event: <type>, data: <json>. Reconnect with the Last-Event-ID header or ?since= to receive what you missed. A : ping comment is sent every 15 seconds.
Parameters
sincequery · optional | integer ≥ 0 | |
typesquery · optional | string[] max 50 items | Filter by event type, e.g. message.*,friend.request.received |
account_idsquery · optional | string[] max 200 items |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/events/stream" \
-H "Authorization: Bearer dpk_xxx"