Conversation Management
Sync User Conversations
Sync user’s conversation list and status
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)
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 channel2- 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:Real-time Sync
Periodic Sync:Offline Recovery
Sync After Reconnection:Best Practices
- Incremental Sync: Use version-based incremental sync to reduce data transfer
- Appropriate Message Count: Set reasonable msg_count based on UI needs
- Error Handling: Handle network errors and implement retry logic
- Caching: Cache conversation data locally to improve performance
- Real-time Updates: Combine with WebSocket events for real-time updates
- Filtering: Use exclude_channel_types to filter out unwanted channel types
- Batch Processing: Process conversation updates in batches for better performance

