获取会话详情
实时返回一条会话的详情。conversation_id 通过 query 参数传入(值即 List conversations 返回的 id)。响应固定包含 conversation_id / type / title / avatar_url(缺失时为空字符串),并按类型补充字段,例如群组的 members_count;找不到会话时返回 404。
https://api.unifyport.ai/v1/accounts/{account_id}/conversations/info请求头
X-Api-Key工作区 API Key,工作区由该请求头解析得到。
路径参数
account_id用于该 conversations 路由的标识符。
查询参数
conversation_id要查询的会话——即 List conversations 返回的 conversation_id 值。
type用于消歧查询的会话类型(user、group 或 channel)。
enum: user, group, channel
请求体
该接口无需 JSON 请求体。
响应体
conversation_id会话标识,发送消息或调用会话路由时作为目标使用。
type会话类型:user、group 或 channel。
enum: user, group, channel
title会话的显示标题。
username渠道提供时返回的会话用户名。
avatar_url头像 URL,未设置时为空字符串。
description群组或频道描述,存在时返回。
last_message_at最近一条消息的 RFC3339 时间戳。
format: date-time
last_message_text最近一条消息的文本摘要,存在时返回。
unread_count会话中的未读消息数。
format: int64
members_count成员数量;群组会话时返回。
format: int64
subscribers_count频道类会话的订阅者数量,存在时返回。
format: int64
is_pinned该会话是否被当前账号置顶。
is_muted该会话是否被当前账号静音。
created_at渠道提供时返回的会话创建时间。
format: date-time
extra标准字段未覆盖的渠道专属内容。
响应
200请求成功,响应体示例如上。
400请求体、路径或参数不合法。
401X-Api-Key 请求头缺失或无效。
404未找到请求的渠道资源。
409当前操作与已有的渠道账号或资源冲突。
500服务端遇到了未预期的错误。
501所选渠道尚未实现该操作。
502渠道适配器或上游渠道未能完成该操作。
请求
curl -X GET https://api.unifyport.ai/v1/accounts/{account_id}/conversations/info?conversation_id=peer_example&type=group \
-H "X-Api-Key: <YOUR_API_KEY>"响应
{
"data": {
"conversation_id": "peer_example",
"type": "group",
"title": "Group title",
"avatar_url": "",
"description": "...",
"unread_count": 0,
"members_count": 42
}
}