since: 0,游标映射可省略或传空对象。后续请求应完整回传上次since、message_cursors、message_change_cursors 和message_delete_cursors。如果 messages_has_more 为 true,应立即使用响应Authorization: Bearer ********************im:read-读取可见会话、成员、历史、已读状态并增量同步{
"since": 0,
"client_id": "string",
"active_cid": "string",
"message_cursors": {
"property1": 0,
"property2": 0
},
"message_change_cursors": {
"property1": [],
"property2": []
},
"message_delete_cursors": {
"property1": [],
"property2": []
}
}curl --location 'https://api.yearnstudio.cn/sync' \
--header 'Content-Type: application/json' \
--data '{
"since": 0,
"client_id": "string",
"active_cid": "string",
"message_cursors": {
"property1": 0,
"property2": 0
},
"message_change_cursors": {
"property1": [],
"property2": []
},
"message_delete_cursors": {
"property1": [],
"property2": []
}
}'{
"code": 200,
"msg": "ok",
"data": {
"since": 0,
"changed": [
{
"id": "string",
"type": "1:1",
"name": "string",
"avatar": "string",
"announcement": "string",
"announcement_updated_at": 0,
"announcement_editor": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"join_policy": "invite_only",
"invite_confirmation": true,
"all_muted": true,
"owner_uid": 0,
"created_at": 0,
"updated_at": 0,
"pinned_at": 0,
"pinned": true,
"last_read_id": 0,
"peer": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"my_role": "string",
"my_muted_until": 0,
"notifications_muted": true,
"is_system": true,
"kind": "string",
"read_only": true,
"can_send": true,
"member_count": 0,
"online_uids": [
0
],
"all_read_id": 0,
"members": [
{
"uid": 0,
"role": "owner",
"muted_until": 0,
"info": {
"uid": 0,
"nickname": "string",
"avatar": "string"
}
}
],
"last_message": {
"id": 0,
"conversation_id": "string",
"sender": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"is_official": true,
"content": "string",
"msg_type": "string",
"mention_uids": [
0
],
"mention_all": true,
"reply": {
"message_id": 0,
"sender": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"content": "string"
},
"status": "normal",
"recalled_by": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"created_at": 0,
"edited_at": 0,
"edit_version": 0,
"client_message_id": "string",
"title": {
"app_id": "string",
"app_name": "string"
},
"attachments": [
{
"id": "string",
"filename": "string",
"mime_type": "string",
"size": 0,
"is_image": true,
"download_url": "string",
"preview_url": "string"
}
]
},
"unread": 0,
"mentioned": true,
"new_messages": [
{
"id": 0,
"conversation_id": "string",
"sender": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"is_official": true,
"content": "string",
"msg_type": "string",
"mention_uids": [
0
],
"mention_all": true,
"reply": {
"message_id": 0,
"sender": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"content": "string"
},
"status": "normal",
"recalled_by": {
"uid": 0,
"nickname": "string",
"avatar": "string"
},
"created_at": 0,
"edited_at": 0,
"edit_version": 0,
"client_message_id": "string",
"title": {
"app_id": "string",
"app_name": "string"
},
"attachments": [
{
"id": "string",
"filename": "string",
"mime_type": "string",
"size": 0,
"is_image": true,
"download_url": "string",
"preview_url": "string"
}
]
}
],
"deleted_message_ids": [
0
],
"message_delete_cursor": [],
"message_cursor": 0,
"messages_has_more": true
}
],
"presence": {
"property1": [
0
],
"property2": [
0
]
},
"conversation_ids": [
"string"
],
"message_cursors": {
"property1": 0,
"property2": 0
},
"message_change_cursors": {
"property1": [],
"property2": []
},
"message_delete_cursors": {
"property1": [],
"property2": []
},
"messages_has_more": true,
"conversation_messages_has_more": {
"property1": true,
"property2": true
}
}
}