API 参考

Sync and realtime

3 个接口 · 概览

GET/v1/spaces/{sid}/snapshot

Full listing of live nodes for the first sync; read the journal after the first page's at_seq
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$

参数 · 查询

  • cursorstring
  • limitinteger
    default 500 · ≥ 1 · ≤ 1000

响应

请求示例
curl "https://side.example.com/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/snapshot" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 200
{
  "nodes": [
    {}
  ],
  "at_seq": 1,
  "next_cursor": "next_cursor"
}

GET/v1/spaces/{sid}/journal

Changes after a seq, strictly ordered and gap-free
Bearer 令牌

参数 · 路径

  • sidstring必填
    ^spc_[0-9A-HJKMNP-TV-Z]{26}$

参数 · 查询

  • afterinteger必填
    ≥ 0
  • limitinteger
    default 500 · ≥ 1 · ≤ 1000

响应

请求示例
curl "https://side.example.com/v1/spaces/spc_01JD7Q2M8X4V6N0R3T5W9Y1B2C/journal?after=1" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"
响应示例 · 200
{
  "entries": [
    {}
  ],
  "last_seq": 1,
  "has_more": false
}

GET/v1/ws

WebSocket for realtime signals (see proto/ws.md). Auth by bearer header or ?access_token=.
Bearer 令牌

响应

  • 101
    Switching protocols
请求示例
curl "https://side.example.com/v1/ws" \
  -H "Authorization: Bearer $SIDESPACE_TOKEN"