Skip to main content
POST

Overview

Sync user’s conversation list and status, supporting both incremental and full synchronization.

Request Body

Required Parameters

string
required
User ID

Optional Parameters

integer
Version timestamp for incremental sync
string
Client’s last message sequence numbers, format: channelID:channelType:last_msg_seq|channelID:channelType:last_msg_seq
integer
Number of recent messages to return for each conversation
integer
default:0
Whether to return only unread conversations (1=only unread, 0=return all)
array
Array of channel types to exclude
integer
Channel type

Response Fields

The response is an array of conversations, each containing the following fields:

Conversation Information

string
required
Channel ID
integer
required
Channel type
  • 1 - Personal channel
  • 2 - Group channel
integer
required
Number of unread messages
integer
required
Last message timestamp
integer
required
Last message sequence number
integer
required
Conversation version number (nanosecond timestamp)

Message List

array
required
List of latest messages in the conversation

Status Codes

Parameter Details

Message Count (msg_count)

Controls the number of messages returned for each conversation:

Version-based Incremental Sync

Use version parameter for efficient incremental synchronization:

Last Message Sequence Tracking

Track message sequences to detect missed messages:

Use Cases

Chat List Display

Initial Load:
Unread Badge Update:

Real-time Sync

Periodic Sync:

Offline Recovery

Sync After Reconnection:

Best Practices

  1. Incremental Sync: Use version-based incremental sync to reduce data transfer
  2. Appropriate Message Count: Set reasonable msg_count based on UI needs
  3. Error Handling: Handle network errors and implement retry logic
  4. Caching: Cache conversation data locally to improve performance
  5. Real-time Updates: Combine with WebSocket events for real-time updates
  6. Filtering: Use exclude_channel_types to filter out unwanted channel types
  7. Batch Processing: Process conversation updates in batches for better performance