查询会话信息
GET
/im/v2/conversations/{conversation_id}请求参数
Path 参数
conversation_id
string
必需
需要查询的会话 ID。若传入的会话 ID 不存在会返回 414 错误码。
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
必需
msg
string
必需
data
object
必需
conversation_id
string
会话 ID。
会话 ID。
sender_id
string
会话我方的账号 ID。
会话我方的账号 ID。
receiver_id
string
会话对方的账号 ID 或群组 ID。
会话对方的账号 ID 或群组 ID。
type
integer
会话类型。
会话类型。1:单聊会话;2:高级群会话;3:超大群会话。
stick_top
boolean
是否为置顶会话。
是否为置顶会话。
group_ids
array[integer <long>]
会话所属分组列表。
会话所属分组列表。
server_extension
string
会话扩展字段。
会话扩展字段。
message_state
integer
会话中的最后一条消息状态。
会话中的最后一条消息状态。0 表示普通消息;1 表示撤回消息。
last_message
object
会话中的最后一条消息。
会话中的最后一条消息。如果是撤回消息,该字段为空,具体内容参见 revoke_message。
revoke_notification
object
会话中的最后一条消息撤回通知。
会话中的最后一条消息撤回通知。message_state 为 1 时返回。
unread_count
integer
会话未读消息数。
会话未读消息数。
sort_order
integer <long>
会话排序字段。
会话排序字段。默认将置顶会话排首位,如有多条置顶会话,则按其创建时间进行排序。
create_time
integer <long>
会话创建时间。
会话创建时间(毫秒)。
update_time
integer <long>
会话更新时间。
会话更新时间(毫秒)。
示例
{
"code": 0,
"msg": "string",
"data": {
"conversation_id": "string",
"sender_id": "string",
"receiver_id": "string",
"type": 0,
"stick_top": true,
"group_ids": [
0
],
"server_extension": "string",
"message_state": 0,
"last_message": {
"sender_no_sense": "false",
"receiver_no_sense": "false",
"extension": "string",
"message": {
"message_type": 0,
"sub_type": 1,
"text": "string",
"attachment": {}
},
"message_config": {
"unread_enabled": "true",
"mutil_sync_enabled": "true",
"offline_enabled": "true",
"history_enabled": "true",
"roaming_enabled": "true",
"conversation_update_enabled": "true"
},
"route_config": {
"route_enabled": "true",
"route_environment": "string"
},
"push_config": {
"push_enabled": "true",
"push_nick_enabled": "true",
"push_content": "string",
"push_payload": "string",
"push_forcepush_all": "false",
"push_forcepush_ids": [
"string"
],
"push_forcepush_content": "string"
},
"antispam_config": {
"antispam_enabled": true,
"antispam_business_id": "string",
"antispam_extension": "string",
"antispam_custom_message_enabled": false,
"antispam_custom_message": "string",
"antispam_cheating": "string"
},
"p2p_option": {
"check_friend": true
},
"team_option": {
"mark_as_read": "false",
"check_team_member_valid": true
},
"superteam_option": {
"ignore_chat_banned": "false",
"check_team_member_valid": true
},
"robot_config": {
"robot_account_id": "string",
"robot_topic": "string",
"robot_function": "string",
"robot_custom_content": "string"
}
},
"revoke_notification": {
"server_id": 0,
"attach": "string",
"revoke_id": "string",
"custom_info": "string",
"revoke_type": 0
},
"unread_count": 0,
"sort_order": 0,
"create_time": 0,
"update_time": 0
}
}
最后修改时间: 1 年前